You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/07/12 13:56:28 UTC

DO NOT REPLY [Bug 10732] New: - JAXP1.1

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10732>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10732

JAXP1.1

           Summary: JAXP1.1
           Product: Xerces2-J
           Version: 2.0.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: JAXP
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: Maciej.Lipczynski@lido-tech.net


I use JAXP1.1, JDK 1.3.1 on WIN NT 4.0, J Builder 5.0
I have a question concerning writing DOM tree to String using Element.toString()
method. I have element which have text node containing text "45 &#176;". After
call method toString() I get String: "45 &amp;#176;" and not as I expected "45
&#176;". My DOM tree is created this way:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
  DocumentBuilder db = dbf.newDocumentBuilder();
  doc = db.newDocument();
} catch(ParserConfigurationException pce) {
  System.out.println("Problem with parser configuration. Exit.");
  System.exit(-36);
}
Element is created this way:
Element turnProcedure = doc.createElement("TURN_PROCEDURE");
turnProcedure.setAttribute("TYPE", "45 &#176;");

...

then I do smth like that:
String out = turnProcedure.toString();

And I got smth like that:
<TURN_PROCEDURE>45 &amp;#176;</TURN_PROCEDURE>
----------

Is there any way to protect before changing & char into &amp; ?

Greetings.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org