[jdom-interest] Default Namespace vs No-Namespace.

Jason Hunter jhunter at servlets.com
Thu Jul 3 18:08:52 PDT 2003


John Jefferson wrote:
> Thanks for all the dialog!!, I think I have a good
> unstanding of the situation now.
> 
> Basicially the design decision that all elements know
> which namespace they belong to at all times prevents
> you from using some features of namespace inheritance?

Not exactly.  Think of JDOM like the Infoset, as an XML document model, 
where an XML file is one possible (serialized) form.  Using some 
terminology I've been picking up from XQuery, JDOM isn't modeling XML's 
lexical space, it's modeling XML's value space.  What the document 
means, not how you happen to serialize it out.  When you're using JDOM 
you're manipulating the XML data, not strings or bytes.

Example:  Is 50 different than 5.0e1?  Yes in the lexical space, no in 
the value space for decimals.  What this means is you shouldn't count on 
concatenating a "0" to the end as multiplying by 10.  If you want to 
make a value change, change the value in the value space.  It's the same 
for JDOM.  If you want to change an element's namespace, change the 
element's namespace.  Don't assume that the object model for XML (where 
elements each have a namespace on their own) will operate based on the 
serialized form of XML (where for brevity -- if not simplicity -- prefix 
aliases are used).

One could model things that way, but we've decided here it's not an 
appropriate model for the value space.

-jh-




More information about the jdom-interest mailing list