[Home] [By Thread] [By Date] [Recent Entries]
Martin Gudgin wrote: > From: "Simon St.Laurent" <simonstl@s...> > > > > > Unfortunately, I think the way you're going about using namespaces makes > > a lot of potentially unfounded assumptions about how the document will > > be processed. In an environment you completely control, that's fine, > > but if your documents ever leak out to the rest of the world, you may > > well find that no one else shares your assumptions and that therefore > > the document is interpreted quite differently. > > [MJG] > I think whichever way you use namespaces you are making assumptions about > the people who will see and process your XML. People use local scoping in > programming languages because it was recognised that putting everything in > global variables was a bad idea. I suspect that over time a similar > observation may apply to XML. First a major purpose of namespaces is to prevent element name clashes, so I don't see how you can equate local scoping in programming languages with local scoping of element declarations. Regardless, I think you are conflating "variables" with "elements" and "types" together. Scoping an element declaration to a type, is not the same as scoping an element declaration to a parent element. Elements remain first class entities in XML regardless. see the XML Schema Formal Description if this remains in doubt. Secondly I'm not entirely (well... at all) happy with your use of the "urn:example.org.people" pseudo-URI reference as a namespace name. The idea that you can stick a "urn:" before whatever string you like and call it a URI is wrong and far to common. There is a defined IETF mechanism for registering namespaces under the "urn" scheme and when "urn:"s are to be used, this really must be followed. Thirdly, though you are not by any means required, it would be _nice_ to use a resolvable*** URI as a namespace name, one that might contain some documentation about what the "person" "family" and "given" elements mean and how they are to be used. This is what I hope will come into standard practice over time. ***Note that Michael Mealing et al. are have done lots of work to provide resolution for "urn"s so these URIs really should be constructed in a proper fashion. -Jonathan
|

Cart



