I am working with the underlying document in Xalan-J. I used the Xerces parser outside of Xalan and passed in a DOMSource for both my stylesheet and data source. There does not seem to be too much of a performance issue but I am using smaller document <30K and I am not doing any transaction processing so +- 250ms and I would never notice.
-John G
Tony Palmer wrote:
Thanks for the answer David, I sort of guessed it could not be obtained in this way. Any hints on how it could be obtained with the least amount of change to Xalan? e.g. (ab)using the transcoding functionality? Tony
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 17:22 To: [EMAIL PROTECTED] Subject: Re: XML encoding
Hi Tony,
The original encoding of the source document is not part of the XPath data model, so it is not available. Since the SAX API does not report this information, it's impossible for Xalan-C to recover and store this information, even if we wanted to.
Dave
|---------+---------------------------> | | "Tony Palmer" | | | <[EMAIL PROTECTED]| | | > | | | | | | 03/19/2004 09:03| | | AM | | | Please respond | | | to xalan-dev | |---------+--------------------------->
---------------------------------------------------------------------------
-----------------------------------------------------------------------| | | | To: <[EMAIL PROTECTED]> | | cc: (bcc: David N Bertoni/Cambridge/IBM) | | Subject: XML encoding |
---------------------------------------------------------------------------
-----------------------------------------------------------------------|
Hi, I need to obtain the xml encoding from the underlying document after is is parsed. I note that the Xerces DOMDocumentImpl has the methods virtual const XMLCh* getEncoding() const; virtual const XMLCh* getActualEncoding() const;
Looking at files in XalanDOM, XercesParserLiaison and XalanSourceTree there appears to be no way to obtain this using the Xalan document. I'm assuming that there might be no encoding attribute in the xml-decl and that the encoding could be obtained just from the bom and not defaulted to UTF-8. How can I obtain the endoding (via Xalan)? I am using the excellent Xalan-C_1_6_0 and xerces-c_2_3_0 Many regards, Tony