XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] [ANNOUNCE] New MicroXML draft available

What is required of a parser handling prefixed and namespaced attributes
in MicroXML?
 
<el1><el2 xmlns:foo="foo-bar" foo:bar="content">content</el2></el1>
 
To me this looks a little challenging because the namespace on the attribute
introduces many possibilities I have to be able to handle. There are so many
valid ways to write this which are all equivalent:
 
1. possibilities for extra whitespace around the namespace declaration:

<el1><el2

xmlns:foo="foo-bar"

foo:bar="content">content</el2></el1>

 
2. multiple namespace declarations:
<el1 xmlns:foo="foo-bar" ><el2 xmlns:foo="foo-bar"     foo:bar="content" >content</el2></el1>
 
 
3. multiple places where the namespace declaration might appear:
 <el1 xmlns:foo="foo-bar" ><el2 foo:bar="content" >content</el2></el1>
 
<el1><el2  xmlns:foo="foo-bar" foo:bar="content" >content</el2></el1>
 
<el1><el2 foo:bar="content" xmlns:foo="foo-bar">content</el2></el1>
 
 
to name just a few variations, all valid.
 
----
Stephen D Green



On 13 July 2011 15:24, John Cowan <cowan@mercury.ccil.org> wrote:
Stephen D Green scripsit:

> If you want to allow attributes with namespace prefixes in MicroXML,
> won't that mean the complexity of namespaces sneaks back in, e.g.
> then having to provide an XML-compatible way to bind the prefix to
> its namespace (with complexity over where the binding declaration can
> be made - at head of document and/or on the element, etc)? Or would
> it be that the prefix, though allowed in the attribute name, is just
> treated as a special part of the name without any explicit binding to
> a namespace?

No, there are explicit bindings, though they are not required for
well-formedness.  But that doesn't add much complexity, because the
binding is not represented in the data model, so it is up to the
application to interpret it.  The consequence of this is that if you
move an element with prefixed attributes from one part of a document
model to another (or one document to another), the meaning of the
attributes may change.  But this is the same as what happens if you cut
and paste in the textual version, too.

Namespaces are just fiddly and annoying, not complex.  It's namespace
fixup in order to maintain the pretense that the namespace of an element
or attribute is an immutable part of it rather than context dependent,
that's complex.

--
John Cowan   cowan@ccil.org    http://ccil.org/~cowan
You cannot enter here.  Go back to the abyss prepared for you!  Go back!
Fall into the nothingness that awaits you and your Master.  Go! --Gandalf



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS