Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Namespace validation bug

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Dan Pollitt <dan.s.pollitt AT gmail.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Namespace validation bug
  • Date: Mon, 21 May 2012 07:56:08 +0100

Hi,

I understand this to be a valid namespace URI:
"urn://schemas-microsoft-com:office:office"

However parsing an XML document containing this fragment:

...
<comment>
<div:div xmlns:div="http://www.w3.org/1999/xhtml";
xmlns="http://www.w3.org/1999/xhtml";>
<div xmlns:o="urn://schemas-microsoft-com:office:office"
xmlns:st1="urn://schemas-microsoft-com:office:smarttags"
xmlns:v="urn://schemas-microsoft-com:vml"
xmlns:w="urn://schemas-microsoft-com:office:word">Stated criteria is
too ambiguous. We need clear direction on how to validate.</div>
</div:div>
</comment>
...

yields the following error:

Caused by: nu.xom.MalformedURIException: Bad port: office:office
at nu.xom.Verifier.checkPort(Verifier.java:610)
at nu.xom.Verifier.checkAuthority(Verifier.java:453)
at nu.xom.Verifier.checkAbsoluteURIReference(Verifier.java:906)
at nu.xom.Element.addNamespaceDeclaration(Element.java:1164)
at
nu.xom.NonVerifyingHandler.startElement(NonVerifyingHandler.java:103)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNamespaceBinder.startElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at nu.xom.Builder.build(Builder.java:1127)
... 11 more

I am using XOM 1.1 however looking at the source for 1.2.8 I think
this bug is still present?

Thanks,
Dan




Archive powered by MHonArc 2.6.24.

Top of Page