ca.uhn.hl7v2.validation.impl
Class XMLSchemaRule

java.lang.Object
  extended by ca.uhn.hl7v2.validation.impl.XMLSchemaRule
All Implemented Interfaces:
EncodingRule, Rule, java.io.Serializable

public class XMLSchemaRule
extends java.lang.Object
implements EncodingRule

Validate hl7 version 2 messages encoded according to the HL7 XML Encoding Syntax against xml schemas provided by hl7.org

Author:
Nico Vannieuwenhuyze
See Also:
Serialized Form

Constructor Summary
XMLSchemaRule()
          Creates a new instance of XMLSchemaValidator
 
Method Summary
 java.lang.String getDescription()
          Returns a text description of the rule.
 java.lang.String getSectionReference()
          A string indicating the section of the HL7 standard from which this rule is derived (if applicable).
 ValidationException[] test(java.lang.String msg)
          Test/validate a given xml document against a hl7 v2.xml schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLSchemaRule

public XMLSchemaRule()
Creates a new instance of XMLSchemaValidator

Method Detail

test

public ValidationException[] test(java.lang.String msg)

Test/validate a given xml document against a hl7 v2.xml schema.

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, a system property ca.uhn.hl7v2.validation.xmlschemavalidator.schemalocation. + version can be used to assign a default schema location.

Specified by:
test in interface EncodingRule
Parameters:
msg - the xml message (as string) to be validated.
Returns:
ValidationException[]

getDescription

public java.lang.String getDescription()
Description copied from interface: Rule
Returns a text description of the rule. This description may be used as a message in exceptions generated if validation against the rule fails, or in a user interface for rule configuration.

Specified by:
getDescription in interface Rule
See Also:
Rule.getDescription()

getSectionReference

public java.lang.String getSectionReference()
Description copied from interface: Rule
A string indicating the section of the HL7 standard from which this rule is derived (if applicable). Like the description, this may be used in an exception message or configuration UI.

Specified by:
getSectionReference in interface Rule
See Also:
Rule.getSectionReference()


Copyright © 2001-2011 University Health Network. All Rights Reserved.