Re: JDOM and &qout;

From: Raymond DeCampo (rdecampo_at_spam-I-am-not.twcny.rr.com)
Date: 02/01/04


Date: Sat, 31 Jan 2004 23:15:44 GMT

mali_djuro wrote:
> Hi all,
> i used JDOM to create XML file.
> first, i get data from database and create Document object. in some data i
> have quotas, so it makes replacment in content of elements. for example:
> if i have "Hi" in database, i will have "Hi" in content of
> element. And it is ok, because in xml does not exist ", at least i think
> that.
> After it i want to make convert from document to string. I used
>
> XMLOutputter serializer = new XMLOutputter();
> String output = serializer.outputString(document);
>
> now, when i look what's happened with "Hi" i found following
> string
> "Hi"
> it makes conversion of & again, and that is not ok.
>
> has someone similiar problem? or do you know how to solve it?
>
> i can make parsing of string again and cut what is wrong, but is it possible
> to set something without that?
>

Friend,

It is likely that the good people at JDOM have already considered your
problem and are accounting for it themselves. So, it is probably safe
to simply pass "Hi" directly to the JDOM API without prior escaping.

Ray



Relevant Pages

  • JDOM and &qout;
    ... i used JDOM to create XML file. ... i get data from database and create Document object. ... After it i want to make convert from document to string. ... XMLOutputter serializer = new XMLOutputter; ...
    (comp.lang.java)
  • Re: JDOM and &qout;
    ... i need to create document object and than transform it to string, ... >> i used JDOM to create XML file. ... >> has someone similiar problem? ...
    (comp.lang.java)
  • Re: Signatur =?ISO-8859-15?Q?zerst=F6rt_bei_Umwandlung_JDO?= =?ISO-8859-15?Q?M_=3C&#
    ... XML Security arbeitet mit dem DOM-Format, ... String spart). ... Warum brauchst du überhaupt DOM und JDOM gleichzeitig? ... mache dir die Signatur in JDOM selbst. ...
    (de.comp.lang.java)
  • Re: Java XML serialize
    ... ich würde eher den JDOM benutzen. ... > Dieses String setzte ich mittels createTextNode. ... Prev by Date: ... Next by Date: ...
    (de.comp.lang.java)
  • Re: trans.transform(xmlSource, htmlResult) fails
    ... I have a byte array I get from the DB then convert it to a string, ... then transform the JDOM dom, so I can call the format method ... and when I left my generated xml encoded via UTF-8, it threw the error, ...
    (comp.text.xml)