[ *g* Man was I still tired two days back in the morning; not
  noticing that there is a dom4j-USER list as well...         ]

...unfortunately, nobody answered to it so far, which is why I am
reposting this here...



Hi there,

  *g* before this seems too negative... ;-)  Dom4j is GREAT... ;-)



  I seem to have a problem with dom4j-1.3; I'm generating an XML
document from within a javacc-Parser. That part works nicely.

But I noticed, that *sometimes* (rarely, though), some of the
literals, that the parser puts into XML attributes can contain a
0-byte.

When dom4j writes this to a file, and later tries to read that
file, I'm getting

        org.dom4j.DocumentException: Error on line 198 of document  : An invalid XML 
character (Unicode: 0x{2}) was found in the value of attribute "{1}". Nested 
exception: An invalid XML character (Unicode: 0x{2}) was found in the value of 
attribute "{1}".
                at org.dom4j.io.SAXReader.read(SAXReader.java:339)
                at org.dom4j.io.SAXReader.read(SAXReader.java:256)
                at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:215)
                at org.yinyap.frame.JMSReceiver.next(JMSReceiver.java:125)
                ... 2 more

(the only special character in there is a \0 byte right in an
attribute value)

The xml had been written using a normal dom4j XMLWriter, without any
special options...

      StringWriter sw=new StringWriter();
      XMLWriter writer = new XMLWriter(sw);
      writer.write(d);
      writer.flush();

Shouldn't dom4j escape the \0-bytes?  (or did I just forget the
neccessary options to the XMLWriter to make it do so?)
The fact, that dom4j writes xml-Files, that it can't read back
itself, doesn't look all that smart, does it?




        Benedikt

  BEAUTY, n.  The power by which a woman charms a lover and terrifies a
    husband.
                        (Ambrose Bierce, The Devil's Dictionary)


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to