private XpathMessageValidationContext getXPathValidationContext ( ) { if ( xmlMessageValidationContext instanceof XpathMessageValidationContext ) { return ( ( XpathMessageValidationContext ) xmlMessageValidationContext ) ; } else { XpathMessageValidationContext xPathContext = new XpathMessageValidationContext ( ) ; xPathContext . setNamespaces ( xmlMessageValidationContext . getNamespaces ( ) ) ; xPathContext . setControlNamespaces ( xmlMessageValidationContext . getControlNamespaces ( ) ) ; xPathContext . setIgnoreExpressions ( xmlMessageValidationContext . getIgnoreExpressions ( ) ) ; xPathContext . setSchema ( xmlMessageValidationContext . getSchema ( ) ) ; xPathContext . setSchemaRepository ( xmlMessageValidationContext . getSchemaRepository ( ) ) ; xPathContext . setSchemaValidation ( xmlMessageValidationContext . isSchemaValidationEnabled ( ) ) ; xPathContext . setDTDResource ( xmlMessageValidationContext . getDTDResource ( ) ) ; getAction ( ) . getValidationContexts ( ) . remove ( xmlMessageValidationContext ) ; getAction ( ) . getValidationContexts ( ) . add ( xPathContext ) ; xmlMessageValidationContext = xPathContext ; return xPathContext ; } }
Gets the validation context as XML validation context an raises exception if existing validation context is not a XML validation context .