private XmlMessageValidationContext getXmlMessageValidationContext ( Element messageElement ) { XmlMessageValidationContext context = new XmlMessageValidationContext ( ) ; if ( messageElement != null ) { addSchemaInformationToValidationContext ( messageElement , context ) ; Set < String > ignoreExpressions = new HashSet < String > ( ) ; List < ? > ignoreElements = DomUtils . getChildElementsByTagName ( messageElement , "ignore" ) ; for ( Iterator < ? > iter = ignoreElements . iterator ( ) ; iter . hasNext ( ) ; ) { Element ignoreValue = ( Element ) iter . next ( ) ; ignoreExpressions . add ( ignoreValue . getAttribute ( "path" ) ) ; } context . setIgnoreExpressions ( ignoreExpressions ) ; parseNamespaceValidationElements ( messageElement , context ) ; //Catch namespace declarations for namespace context Map < String , String > namespaces = new HashMap < String , String > ( ) ; List < ? > namespaceElements = DomUtils . getChildElementsByTagName ( messageElement , "namespace" ) ; if ( namespaceElements . size ( ) > 0 ) { for ( Iterator < ? > iter = namespaceElements . iterator ( ) ; iter . hasNext ( ) ; ) { Element namespaceElement = ( Element ) iter . next ( ) ; namespaces . put ( namespaceElement . getAttribute ( "prefix" ) , namespaceElement . getAttribute ( "value" ) ) ; } context . setNamespaces ( namespaces ) ; } } return context ; }
Construct the basic Xml message validation context .