[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: accessing the input XML's doctype

Subject: Re: accessing the input XML's doctype
From: "Darcy Parker" <darcyparker@xxxxxxxxx>
Date: Thu, 17 Jul 2008 14:11:58 -0400
Re:  accessing the input XML's doctype
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.