Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Illegal character in W3CDOM passed to XOM

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Peter Murray-Rust <pm286 AT cam.ac.uk>
  • To: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] Illegal character in W3CDOM passed to XOM
  • Date: Thu, 17 May 2012 23:42:46 +0100

I am using the XOM DOMConverter to try to convert a W3CDOM.

public static nu.xom.Element convertW3CDocument(org.w3c.dom.Element
w3cElement) {
return nu.xom.converters.DOMConverter.convert(w3cElement);
}
and getting an illegal character exception:

... 4 more
Caused by: nu.xom.IllegalCharacterDataException: 0x14 is not allowed in XML
content
at nu.xom.Verifier.throwIllegalCharacterDataException(Verifier.java:154)
at nu.xom.Verifier.checkPCDATA(Verifier.java:205)
at nu.xom.Text._setValue(Text.java:126)
at nu.xom.Text.<init>(Text.java:62)
at nu.xom.converters.DOMConverter.convert(DOMConverter.java:217)
at nu.xom.converters.DOMConverter.convert(DOMConverter.java:166)
at nu.xom.converters.DOMConverter.convert(DOMConverter.java:354)

I am sure this is not XOM's fault/problem but It am wondering how the
W3CDOM comes to output illegal XML

This comes at the end of a long chain (PDFBox converts PDF to Java
Graphics2D which is then converted by Batik to W3C DOM. I'm not surprised
that there are problems with encoding (or lack of it).

It would appear that the W3C DOM has illegal characters in the Text
elements. I assume there is no check on doing this so that it is possible
to construct invalid XML. I'm simply wondering if anyone has had similar
experiences and whether there are quick fixes or whether the characters/
encoding in Batik's DOM has to be fixed.

P.

--
Peter Murray-Rust
Reader in Molecular Informatics
Unilever Centre, Dep. Of Chemistry
University of Cambridge
CB2 1EW, UK
+44-1223-763069




Archive powered by MHonArc 2.6.24.

Top of Page