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] a namespace definitions related question(s)

Original Message From: "Shlomo Yona"

> If my XML processor is not only parsing but also validating and namespace
> aware, it seems natural to expect it to allow/tolerate examples such as
> the one I gave.

There's a lot of 'if's there :-)

Conceptually parsing of an XML file will happen in (software) layers.

In the first layer the various start tags, end tags, attributes and so on 
will be read and checked for well formedness.  In particular, end tags will 
be matched to their start tags using a basic text match operation.

At the next layer the namespace information will be extracted, and the data 
model updated accordingly.

After that, if appropriate and available, validation will be assessed 
according to any specified schema.

> What I'm asking is, is there a downside to "semantically" matching
> start/end tags by using namespace information?

The current situation is that most (if not all) parsers will not be able to 
read your XML, and I doubt this will change.

> Another questions is: what happens with attributes:
>
> <foo:bar xmlns:foo="foobar" foo:a="b" a="c"/>
>
> Is there a "collision" between foo:a and a?

foo:a and a are completely different attributes.  This is really what 
namespaces enable.

Conversely, in:

<foo:bar xmlns:foo="foobar" xmlns:bar="foobar" foo:a="b" bar:a="c"/>

foo:a and bar:a would be the same attribute and this should be reported as 
an error.

HTH,

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx
(or http://www.xml2cpp.com)
=============================================




[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