[jdom-interest] exception with xml:lang

Clark, Stacie sclark at e-numerate.com
Tue Aug 15 10:33:11 PDT 2000


On July 3,  Gabor Grief wrote that he was still getting an exception thrown
when using the xml:space namespace. I looked further in the archive but
could find no resolution (of course I didn't read the entire archive, either
:-)  I am getting a related exception with xml:lang using a checkout from
today and the xerces parser.

C:\Java\jdom\samples>java -classpath
.;c:\Java\XML4J_3_0_1\xerces.jar;c:\Java\jdom\build\jdom.jar SAXBuilderDemo
d:\Dev\xmlFiles\Xbrl\GreatPlainsInstance.xml
org.jdom.IllegalNameException: The name "xml" is not legal for JDOM/XML
Namespace prefixs: Namespace prefixes cannot begin with "xml" in any
combination of case
.
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1225)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:258)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:332)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:313)
        at SAXBuilderDemo.testBuilder(SAXBuilderDemo.java:99)
        at SAXBuilderDemo.main(SAXBuilderDemo.java:136)

The xerces parser is able to parse the document with no problem.

If I remove the offending lines, which look something like:
<label href="xpointer(//item[@type='gpsi:computation.netIncome'])"
xml:lang="en">Net income</label>

Then jdom can parse the document.

Stacie





More information about the jdom-interest mailing list