But what I need is really a very simple way which enable me to put inside
the xml stream a  sequence of char , including the & char, without this
latter be parsed and translated in &.
Which xerces there are no mean to tell the parser to avoid to translate some
or all the characters of an output string ?

-----Messaggio originale-----
Da: Alberto Massari [mailto:[EMAIL PROTECTED]
Inviato: venerdì 16 settembre 2005 18.51
A: c-dev@xerces.apache.org
Oggetto: Re: R: R: using non standard character with zerces


Hi Enzo,

At 18.05 16/09/2005 +0200, AESYS S.p.A. [Enzo Arlati] wrote:
>But when can I include special character inside a node.
>I want to use the format &#xXX . but the '&' where processed and translate
>in & so the character ¥ whill be converted to &#xA5 instead of
>the desired current character entitity.

This is a different problem; if you want to
insert special characters using DOM you should
just place them in the string, and let DOMWriter
escape them, if the output encoding is unable to represent them.
For instance,

 >        string stmp;
 >        stmp = string( "this is a test: <> & \xA5 " );
 >        pTestRef = pDoc->createElement( X("TEST_REFERENCE_1") );
 >        dtxt                  = pDoc->createTextNode( X( stmp.c_str()));

Please be aware that every time you mix
std::string and XMLCh and do conversions between
them by means of X() or XMLString::transcode you
are doing a very tricky operation that you must
fully understand in order to succeed.
In this case, you *must* be sure that 0xA5 is a
valid character in the encoding of the machine
where your software is running, or the conversion
from local code page to Unicode will either fail
or return something you didn't anticipate.
Usually, I suggest to work directly with Unicode
strings, at least you know that the numbers you
put in the strings have only one symbol associated.

Alberto

>thank for you help.
>
>
>-----Messaggio originale-----
>Da: Alberto Massari [mailto:[EMAIL PROTECTED]
>Inviato: giovedì 15 settembre 2005 12.10
>A: c-dev@xerces.apache.org
>Oggetto: Re: R: using non standard character with zerces
>
>
>Hi Enzo,
>
>At 11.39 15/09/2005 +0200, AESYS S.p.A. [Enzo Arlati] wrote:
>
> >I have a  source like this, which I read and parse :
> >
> ><?xml version="1.0"  standalone="no" ?>
> ><Messaggio>
> >...........
> ><Test1> start  &lt; &gt;  &amp; &#x28;  &#xA5; &#x29;  end  </Test1>
> ></Messaggio>
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to