[jdom-interest] Re: attribute name "dt:dt"

Alex Greif alex.greif at wwl.de
Wed Jun 14 08:52:21 PDT 2000

Element elem = new Element( "catalog", Namespace.getNamespace( "xmlns:dt",
"myURI") );
throws an jdom exception: Namespace prefixes cannot contain colons

Element elem = new Element( "catalog", Namespace.getNamespace( "dt", "myURI") );
throws the same exception as at the beginning.


"Simon St.Laurent" schrieb:

> At 04:29 PM 6/14/00 +0200, Alex Greif wrote:
> >Hi,
> >jdom b4 doesn't allow attribute names that contain ":"
> >
> >Is there a way to deactivate namespace checking and allow ":" in the
> >name of an attribute.
> >
> >I use jdom for creating xml-files for Intershop/Enfinity that contains
> >the following:
> >
> ><custom-attribute name="Tax-rate" dt:dt =
> >"float">16.00</custom-attribute>
> I'd personally like to see attribute names permitted to use colons (even
> multiple colons) per the XML 1.0 spec, though there is a warning in the
> spec that such usage is experimental.
> The '2nd Edition' of XML 1.0 that's been discussed on XML-Dev may remove
> the use of colons for all but namespace usages, however.
> There's a simple way to get dt: past a namespace checker, though - add a
> namespace declaration for it someplace (same element, root element, whatever):
> xmlns:dt="myURI"
> I think JDOM supports the use of namespaces on attribute names in general,
> though - XLink requires them, and so do some other upcoming specs.  (Then
> there's the use in attribute values, which gets ugly...)
> Simon St.Laurent
> XML Elements of Style / XML: A Primer, 2nd Ed.
> http://www.simonstl.com - XML essays and books

More information about the jdom-interest mailing list