[oXygen-user] Using Custom Parser With XSLT Processors
George Cristian Bina
Thu Mar 1 02:32:19 CST 2007
Hi Eliot,
oXygen uses Xerces to parse the source documents for transformations and
it creates explicitly the parser setting its configuration options from
the oXygen options, for instance if XInclude is enabled or not.
We may consider adding some more features to configure for Xerces in the
oXygen options (see Options->Preferences -- XML -- XML Parser). Please
let us know what features you need.
Currently what you can do is to configure a custom engine
(Options->Preferences -- XML -- XSLT-FO-XQuery -- Custom Engines) that
invokes Saxon using a command line, and you can pass system properties
to that java runtime to configure what sax parser to use and use that
custom engine in your scenarios.
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
W. Eliot Kimber wrote:
> In order to do XSLT processing with schema PSVI information (in
> particular, attribute defaults), I have created a little SAX parser
> factory for Xerces that turns on all the schema stuff. I can then use
> this with, for example, Saxon, to do schema-aware XSLT (for example,
> DITA-aware processing that depends on the class= attribute).
>
> I'm trying to figure out how to integrate this parser with Oxygen so
> that I can run my transforms from within Oxygen.
>
> I tried adding the necessary JVM arg to the oxygen INI file adding the
> library with the parser factory class to the classpath, but it didn't
> seem to do anything--I suspect that the XSLT process needs it's own JVM
> args spec, but the only thing I saw as a place to specify a transformer
> factory (I can do if I have to but then I'm looked into a specific
> version of Saxon, for example).
>
> Have I missed something or am I going about this the wrong way?
>
> Thanks,
>
> Eliot
>
>
> ------------------------------------------------------------------------
>
> package com.innodata.xerces;
>
> import javax.xml.parsers.ParserConfigurationException;
>
> import org.apache.xerces.jaxp.SAXParserFactoryImpl;
> import org.xml.sax.SAXNotRecognizedException;
> import org.xml.sax.SAXNotSupportedException;
>
> public class ValidatingSAXParserFactory extends SAXParserFactoryImpl {
>
> public ValidatingSAXParserFactory() throws SAXNotRecognizedException, SAXNotSupportedException, ParserConfigurationException {
> this.setFeature("http://xml.org/sax/features/validation", true);
> this.setFeature("http://apache.org/xml/features/validation/dynamic", true);
> this.setFeature("http://apache.org/xml/features/validation/schema", true);
> this.setFeature("http://apache.org/xml/features/validation/schema/normalized-value", true);
> this.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
>
> }
>
> }
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> oXygen-user mailing list
>
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
More information about the oXygen-user
mailing list