[jdom-interest] xml:lang Attribute problem

Perry Hoekstra dutchman at uswest.net
Wed Oct 11 06:59:57 PDT 2000


Greet the sun all:

I don't if this is how I implemented it or a bug but when I execute the
following code:

StringBuffer t_xml = new StringBuffer("<?xml version = \"1.0\"?>");

t_xml.append("<Foo xml:lang=\"en-US\">  ");
t_xml.append("</Foo");

org.jdom.input.SAXBuilder t_saxBuilder = new
org.jdom.input.SAXBuilder("org.apache.xerces.parsers.SAXParser");

org.jdom.Document t_jdomDocument = t_saxBuilder.build(new
java.io.StringReader(t_xml.toString()));

I receive the following exception:

org.jdom.JDOMException: The name "" is not legal for JDOM/XML
namespaces: Namespace URIs must be non-null and non-empty Strings..)

Now, looking at page 297 of the XML Bible, it states that xml:lang is a
valid attribute.  I refresh my code with a fresh extract through CVS
this morning. Ideas on what I am doing wrong?

-- 
Perry Hoekstra
E-Commerce Architect
Talent Software Services
dutchman at mn.uswest.net



More information about the jdom-interest mailing list