[jdom-interest] HELP: I want <CUSTOMER>. I get: &lt;CUSTOMER &gt;

Rob Mitchell rjmitchell at mediaone.net
Sun Nov 18 08:57:17 PST 2001


Steve,

I have similar code that take JDBC results and formats for outputting.  The resulting XML file has the appropriate element names for my rows/cols and also encodes any "data" with appropriate translation.

So, I have something like this:

  <cps:RECORD cps:RECORDCOUNT="1">
    <cps:ID>0</cps:ID>
    <cps:clientID>100</cps:clientID>
    <cps:contactID>1000</cps:contactID>
    <cps:acctName>Account &amp;000</cps:acctName>
    <cps:acctType>Type &lt;1&gt;</cps:acctType>
    <cps:acctClosed>y</cps:acctClosed>
  </cps:RECORD>

and it shows in the browser like this

<cps:RECORD cps:RECORDCOUNT="1">
  <cps:ID>0</cps:ID> 
  <cps:clientID>100</cps:clientID> 
  <cps:contactID>1000</cps:contactID> 
  <cps:acctName>Account &000</cps:acctName> 
  <cps:acctType>Type <1></cps:acctType> 
  <cps:acctClosed>y</cps:acctClosed> 
  </cps:RECORD>


Can you send a fragment of the original XML strings?

---
Rob Mitchell
rjmitchell at mediaone.net
Base Class Technologies, Inc.
Designing and developing Java/Oracle solutions for the Web


  ----- Original Message ----- 
  From: Steve Taplin 
  To: 'jdom-interest at jdom.org' 
  Sent: Thursday, November 15, 2001 9:31 AM
  Subject: [jdom-interest] HELP: I want <CUSTOMER>. I get: &lt;CUSTOMER &gt;


  Hello,

              I am currently converting a web service from using xerces 1.2 to jdom (beta 7).

  Additionally, I have moved the project from JBuilder5 to IBM WebSphere Application Developer (Beta Version).

  Might sound daft but WSAD is excellent at creating and testing web services.

  Unfortunately,  all DOM output (i.e. Xerces and JDom) is now producing, e.g.:

   

  &lt; CUSTOMER &gt;

   

  instead of

   

  <CUSTOMER>

   

  Web browsers love it.  My client app doesn't!

   

  I have tried different encodings to no avail.  Any Ideas?

   

  The document is built purely from scratch within the class (e.g. not parsed in).  The outputter fragment is as follows:

   

        private String docToString(Document doc) {

   

              StringWriter stringOut = new StringWriter();

              XMLOutputter outputter = new XMLOutputter(" ", true);

              outputter.setEncoding("ISO-8859-1"); //tried without this, i.e. UTF-8

              outputter.setOmitDeclaration(true);

            try {

                    outputter.output(doc, stringOut);       

              } catch (Exception e) {

                    e.printStackTrace();

              }

              return stringOut.toString();

        }

   

   

  Regards,

   

  Steve.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20011118/365618b5/attachment.htm


More information about the jdom-interest mailing list