<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>Document converting < and > characters into &lt; and &gt;</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hello,</FONT>
<BR>
<BR><FONT SIZE=2 FACE="Arial">Im wondering if anybody can assist or has run into this issue before:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I have an external source which is returning xml. When I obtain that xml via BufferedReader the xml looks like this:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"><RIBCL><RESPONSE STATUS="0x0000" MESSAGE='No error' /></RIBCL></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">However when I create a new JDOM Document and add content like this:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Element root = new Element("responses");</FONT>
<BR><FONT SIZE=2 FACE="Arial">root.addContent(inputLine);</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">And then output the Document via:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Document doc = new Document(root);</FONT>
<BR><FONT SIZE=2 FACE="Arial"> doc.setDocType(new DocType("base64"));</FONT>
<BR><FONT SIZE=2 FACE="Arial"> System.out.println(doc.getDocType());</FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial"> Format format = Format.getPrettyFormat();</FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial"> XMLOutputter serializer = new XMLOutputter(format);</FONT>
<BR><FONT SIZE=2 FACE="Arial"> String xml = serializer.outputString(doc);</FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial"> System.out.println(xml);</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Where there appears to be a valide "<" or ">" tag it is replacing with &lt; &gt; </FONT>
</P>
<P><FONT COLOR="#000000" SIZE=2 FACE="Courier New"><responses>&lt;RIBCL&gt;&lt;RESPONSESTATUS="0x0000"MESSAGE='Noerror'/&gt;&lt;</FONT>
</P>
<P><FONT COLOR="#000000" SIZE=2 FACE="Courier New">How do I get make sure the string content with < and > tags are not replaced with &gt and &lt symbols?</FONT>
</P>
<P><FONT COLOR="#000000" SIZE=2 FACE="Courier New">Thanks in advance</FONT>
<BR><FONT COLOR="#000000" SIZE=2 FACE="Courier New">Rob</FONT>
</P>
</BODY>
</HTML>