I need to process schema-based documents with Saxon where the documents need to have default attribute values that are only in the schema (these happen to be DITA documents where the processing depends on the values of the common class= attribute which normally never exists in instances).

I'm using Xerces as the parser by using these two JVM args:

-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl

That makes Xerces the parser but does not, by itself, turn on schema validation.

I added this arg:

-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.StandardParserConfiguration

But it had no apparent affect. In particular, the default attribute values were not being passed through to Saxon.

I feel like I should be able to do this completely from the command line by setting the appropriate JVM parameters but so far I have not been able to and I'm not sure if it's user error or a missing feature of Xerces.

My fallback was to create a simple subclass of SaxParserFactoryImpl and set the schema validation property there, which works (I'm now seeing the default attribute values). But I was really hoping to avoid having to maintain a custom class (with all the deployment complexity that implies) if I can do everything from the command line.

My expectation was that I would be able to use JVM args to set all the relevant Xerces parser properties or, failing that, create a configuration properties file. But I see nothing the Xerces docs that suggest either approach is supported.

So my questions are:

1. Is there a way to configure Xerces to do schema validation for JAXP-based parser users from the command line?

2. If not, why not?

Thanks,

Eliot

--
Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 610.631.6770
www.reallysi.com
www.rsuitecms.com

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

Reply via email to