You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Francois Granade <fr...@viafone.com> on 2000/04/20 21:22:19 UTC

Xerces parsing - how to get the character set ?

I'm not sure this is the right list to ask this question, please don't
hesitate to redirect me to the right list...

When I'm parsing a document with an character set encoding 

<?xml version="1.0" encoding="ISO-8859-1"?>
Xerces handles the char set properly. 

Nevertheless, once it's parsed, how can I know what character set this
document is using - and how can I re-export my "org.w3c.dom.Document"
tree into a stream (or file) with the right character set ?
If I don't set the right character set, I may not be abble to re-parse
my document without getting errors...

It seems that Xerces parser is stripping out the encoding information
from the tree - this information is only used and managed by the parser;
it does not appear as a "org.apache.xerces.dom.ProcessingInstruction" in
the tree...
How can I know what charset was used ?

Is it a known issue with the DOM API ? or am I missing something ?

Francois

Scott Boag/CAM/Lotus wrote:
> 
> Actually, this isn't true any more... I think you have to have a valid xsl
> namespace decl.  See the java code for the handling of this.
> 
> -scott
> 
> 
>                     "David N
>                     Bertoni/CAM/Lotus        To:     general@xml.apache.org
>                     "                        cc:     (bcc: Scott Boag/CAM/Lotus)
>                     <David_N_Bertoni@        Subject:     Re: XSLT output question
>                     lotus.com>
> 
>                     04/20/2000 01:26
>                     PM
>                     Please respond to
>                     general
> 
> 
> 
> Well it's not doing that to indicate an error -- the processor is required
> to do that.  The XSLT specification requires that the processor treat
> elements with undeclared namespaces as literal result elements.  Since
> literal result elements are copied to the output xml, you get back exactly
> what you put in -- the stylesheet.
> 
> Dave
> 
>                     Eric Hodges
> 
>                     <harmony2@swb        To:     general@xml.apache.org,
> xalan-dev@xml.apache.org
>                     ell.net>             cc:     (bcc: David N
> Bertoni/CAM/Lotus)
>                                          Subject:     Re: XSLT output
> question
>                     04/20/2000
> 
>                     11:38 AM
> 
>                     Please
> 
>                     respond to
> 
>                     general
> 
> ----- Original Message -----
> From: David N Bertoni/CAM/Lotus <Da...@lotus.com>
> To: <ge...@xml.apache.org>; <xa...@xml.apache.org>
> Sent: Thursday, April 20, 2000 9:42 AM
> Subject: Re: XSLT output question
> 
> >
> > Generally, when you just get the stylesheet back from the transform, it
> > means that the XSL namespace is incorrect in the stylesheet.
> 
> That seems like an obtuse way to indicate that the namespace is incorrect.
> 
> >  The proper
> > value is "http://www.w3.org/1999/XSL/Transform.
> 
> Let me try that real quick.
> 
> That was it.  I also had to remove the "result-ns" attribute, too.
> 
> > By the way, this question really belongs on the Xalan list -- you're
> likely
> > get quicker responses to your questions there.
> 
> OK, I'll go look for that list.
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org