You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by R Subram <su...@hotmail.com> on 2007/08/10 19:12:21 UTC

Equivalent of DOMWriterImpl in Xerces2.7

 Hello all, What is the equivalent of DOMWriterImp lin Xerces2.7?  I know it is LSSerializer class. My question may be simple to most of you guys but the problem I'm facing with LSSerializer is that it doesn't write the entities out as I expected. 
 
For example when I try to read and and write the following using LSSerializer:
 
My input is like this:
<project id = "TP001">             <name>Telecommunication Project</name>      <start-date>March 20 1999</start-date>      <end-date>July 30 2004 &#x02DC;</end-date></project> 
I get the output like this:  
<project id="TP001"> 
         <name>Telecommunication Project</name>
         <start-date>March 20 1999</start-date>
           <end-date>July 30 2004 ˜</end-date>
</project>
 
Is there a way to preserve the entity values as it reads. I know using DOMWriterImpl, it doesn't replaces the entity with the equivalent character.
 
 
By the way, I'm using one of the DOM3 example that comes with Xerces 2.7. 
 
 
Thanks!
_________________________________________________________________
Learn. Laugh. Share. Reallivemoms is right place!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

Re: Equivalent of DOMWriterImpl in Xerces2.7

Posted by ke...@us.ibm.com.
As far as XML is concerned, there is absolutely no semantic difference
between a character and its Numeric Character Reference form. XML parsers
generally discard this distinction; XML serializers generally write out the
character unless the encoding can't represent it (forcing the numeric
form).

If your application cares about this difference, fix your app.

______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish
(http://www.ovff.org/pegasus/songs/threes-rev-11.html)