[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] accessing the input XML's doctype


Subject: Re: [xsl] accessing the input XML's doctype
From: "Darcy Parker" <darcyparker@xxxxxxxxx>
Date: Thu, 17 Jul 2008 14:11:58 -0400

Hi Michael,

Thanks for pointing us to SAX2.

I use a command similar to the following. (All one line from a command
line on a Windows based machine.)

"%JAVA_HOME%\bin\java.exe"
-cp saxon9.jar;xercesImpl.jar;resolver.jar;XMLCatalog;
-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
-Djavax.xml.transform.TransformerFactory=com.icl.saxon.TransformerFactoryImpl
net.sf.saxon.Transform
-x:org.apache.xml.resolver.tools.ResolvingXMLReader
-y:org.apache.xml.resolver.tools.ResolvingXMLReader
-r:org.apache.xml.resolver.tools.CatalogResolver
-iInputXML.xml -xsl:identity.xsl -o:output.xsl

I vaguely understand the command above and it works for me... but I
don't understand how to specify or configure Xerces to use SAX2 output
that would include markup of the doctype and entity declarations, and
also not resolve entity declarations in the XML.

I suspect Xerces is the most popular, but I am open to trying any sax2
parser.  Can you provide an example command that could be used with
saxon such that if I run an identity transform, I would get an xml
output that includes markup for the doctype and entity declarations
and leaves the original entities unresolved?

Thanks

Darcy
On Thu, Jul 17, 2008 at 11:28 AM, Michael Kay <mike@xxxxxxxxxxxx> wrote:
>> Can anyone point to a modified XML parser that works with
>> saxon that is similar to the one in the article?
>> http://www.xml.com/pub/a/2000/08/09/xslt/xslt.html
>
> I suspect that Eric's article was written before the introduction of SAX2,
> which provides the information that Eric was suggesting should be exposed by
> a "modified parser". So you can now use any SAX2 parser to do this job.
>>
>> Or is the custom SAX filter as Michael suggested a better approach?
>
> It's essentially the same approach. But the code to take the Java events and
> turn them into objects in the XDM data model still needs to be done.
>
> Michael Kay
> http://www.saxonica.com/


Current Thread
Keywords
xml