Look at the grammer explanations at xerces website. What you do is preparse
the schema and save it as a grammer, then when loading the xml you specify
thaat it shuld use that grammer and not the schema specified. Here is what
you do:

XMLGrammarPreparser preparser = new XMLGrammarPreparser();
preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
preparser.setProperty(GRAMMAR_POOL, grammarPool);
preparser.setFeature(NAMESPACES_FEATURE_ID, true);
preparser.setFeature(VALIDATION_FEATURE_ID, true);
preparser.setFeature(SCHEMA_VALIDATION_FEATURE_ID, true);
preparser.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, true);
preparser.setFeature(SCHEMA_ELEMENT_DEFAULT_ID, true);
preparser.setFeature(SCHEMA_NORMALIZED_VALUE_ID, true);

XMLInputSource inputSource = new XMLInputSource(null,null,null,schema,null
);
preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, inputSource);

and then when parsing add the property:

parser.setProperty(GRAMMAR_POOL, grammarPool);


Ron Rothblum
Active Technologies Department
IBM Haifa Research Labs
Phone:   +972 4 829-6459


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to