[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] a namespace definitions related question(s)
- From: "Shlomo Yona" <S.Yona@F5.com>
- To: "Pete Cordell" <petexmldev@tech-know-ware.com>
- Date: Tue, 20 Feb 2007 11:02:29 -0800
Thanks for correcting my example with attributes.
Bottom line: the XML instance contains an error.
Thanks.
Shlomo.
-----Original Message-----
From: Pete Cordell [mailto:petexmldev@tech-know-ware.com]
Sent: ג 20 פברואר 2007 19:46
To: Shlomo Yona
Cc: xml-dev@lists.xml.org
Subject: 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]