On 7/15/2012 10:32 AM, David Lee wrote:
>> Namespaces are 'part' of XDM but they can be empty. So in theory MicroXML with no namespaces might fit in an XDM Model.
>>
>> From the reading of the evolving commentary I am not sure if a 'real' XML parser could actually read MicroXML ...
>> if it ran across namespacy like things like <foo:bar/> without an associated namespace declaration.
>> However ... a MicroXML Parser could read such a thing and possibly construct an XDM model with it.
>> But what would the localname be ? "foo:bar" ? Not a valid NCName ... "bar" ? but no namespace node ?
>>
You can do all sorts of rational things here if you're willing to give
up interoperability with XDM delivered from namespace-aware XML
parsers. In my personal view, I like the idea of making the localname
"bar" and the namespace "foo". Then you can keep the NCName/QName types
in the data model, you don't lose any information, but you just ignore
all the problems with namespace fixup, the need to carry around in-scope
namespace prefixes and so on, and the context-dependence of the prefixes.
There's a kind of downgrading model for interoperating with older
parsers. If you know you're getting XDM coming in from an old parser,
you simply run a utility over it sets each QName's namespace to be its
prefix.
Then as long as your prefixes are globally unique, you're happy. or you
just redefine your expectations such that the significant piece of
information is the prefix. It would be interesting to see what that
breaks. But it means pushing this knowledge about new namespace
handling into layers beyond the parser: you have to own the whole stack,
I think, so it's not really a tenable stance for tool vendors?
-Mike