public class XMLSchemaRule extends AbstractEncodingRule
The XML schema to validate against is determined as follows:
setSchemaLocations(Map)
The validation fails, if
urn:hl7-org:v2xml
Constructor and Description |
---|
XMLSchemaRule() |
Modifier and Type | Method and Description |
---|---|
ValidationException[] |
apply(String msg)
Test/validate a given xml document against a hl7 v2.xml schema.
|
String |
getDescription()
Returns a text description of the rule.
|
String |
getSectionReference()
Returns a string indicating the section of the HL7 standard from which this rule
is derived (if applicable).
|
void |
setSchemaLocations(Map<String,String> locations) |
test
failed, failed, failed, failed, failedWithValue, getErrorCode, getSeverity, passed, result, result, setDescription, setErrorCode, setSectionReference, setSeverity
public XMLSchemaRule()
public ValidationException[] apply(String msg)
Before the schema is applied, the namespace is verified because otherwise schema validation fails anyway.
If a schema file is specified in the xml message and the file can be located on the disk this one is used. If no schema has been specified, or the file can't be located, the locations property is used.
msg
- the xml message (as string) to be validated.public void setSchemaLocations(Map<String,String> locations)
public String getDescription()
Rule
getDescription
in interface Rule<String>
getDescription
in class RuleSupport<String>
Rule.getDescription()
public String getSectionReference()
Rule
getSectionReference
in interface Rule<String>
getSectionReference
in class RuleSupport<String>
Rule.getSectionReference()
Copyright © 2001–2017 University Health Network. All rights reserved.