[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: a namespace definitions related question(s)
Thanks for correcting my example with attributes. Bottom line: the XML instance contains an error. Thanks. Shlomo. -----Original Message----- From: Pete Cordell [mailto:petexmldev@t...] Sent: â 20 ôáøåàø 2007 19:46 To: Shlomo Yona Cc: xml-dev@l... Subject: Re: 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] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|