If these characters needed to be represented as entities, the serializer
would do so.  The quote entities are standard in the sense that they're
assumed to be understood by conformant processors, but they're not
required to be used in all contexts.  To do so unnecessarily decreases
human readability of documents.  See
http://www.w3.org/TR/2004/REC-xml-20040204/ for details as to what must
be escaped and when.

If you want to represent certain characters as entities when they don't
have to be, you'll need to modify the serializer or write your own. 

> -----Original Message-----
> From: AESYS S.p.A. [Enzo Arlati] [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, September 20, 2005 8:01 AM
> To: [EMAIL PROTECTED] Apache. Org (E-mail)
> Subject: convert the entities ' and "
> 
> 
> I build a DOM document and inside a Node I put some string 
> with the standard
> entities ( ie. & < > ' and " ).
> The first 3 entities are converted in their equivalent entity 
> reference
>  ie. &amp; &lt; &gt; )
> while the last 2 are not converted ( as show in the example belowe.
> What can I do in order to tell the xerces to replace it with 
> their enity
> ref.
> Please , if possible, send me an example.
> 
>     DOMImplementation * impl =
> DOMImplementationRegistry::getDOMImplementation( X("LS") );
> 
>     if( impl != NULL )
>     {
>        DOMDocument * pDoc = impl->createDocument( 0, 
> X("Messaggio"), 0 );
>        pDoc->setEncoding( X("UTF-16") );
>        DOMElement * pRoot = pDoc->getDocumentElement();
>        DOMElement * pTest = pDoc->createElement( X("TEST2") );
>        pRoot->appendChild( pTest );
>        stmp = " std_entities: & < > \" ' ";
>        dtxt = pDoc->createTextNode( X( stmp.c_str()));
>        pTest->appendChild( dtxt );
>        .............
>     }
> 
> DOCUMENT: <?xml version="1.0" encoding="UTF-16" standalone="no" ?>
> <Messaggio><TEST2> std_entities: &amp; &lt; &gt; " ' 
> </TEST2></Messaggio>
> 
> Regards, Enzo
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

Reply via email to