Subject: Re: Was: [xsl] mode and moved to Namespaces From: ac <ac@xxxxxxxxxxxxx> Date: Mon, 18 Apr 2011 01:16:36 -0400 |
Regards, Andre
On Sun, 2011-04-17 at 19:30 -0400, ac wrote:
I am surprised that, with all these XML and XSLT gurus around the table, using more than 8 namespaces in a stylesheet or application, seems like such a strange, "out of bounds", thing.There's no hard limit, but in general the more you use, the harder life will get. It's up to you to remember them all... declare them... debug errors when an XSLT template doesn't match because of a typo in a prefix or URI...
Namespaces are 100% unrelated to content language.Don't natural languages at least each have their own "natural" namespace? If an application supports i18n and localization, should it use less namespaces than the number of locale it supports?
Use xml:lang to indicate language. You don't need a different namespace for different content.
Should one not use RDF when using StratML, or XSD, or Atom?Well, it's unfortunate that the RDF people were farly clueless about XML when they insisted on the namespace deign we have today. RDF/XML confuses the syntactic and the semantic, the envelope and the contents. But then, RDF/XML confused a lot of things (if Jonathan is reading, "Mona lisa is a jpeg, and she is 700 pixels wide and hangs in the Louvre" or one of my books had similarly crazy examples based on the not-even-well-formed vcard examples in the rdf spec.)
<triple><r>resource 1</r><rel>relation</re><r>resource 2</r></triple> would have done just fine, with, if needed, <triple><r>resource 1</r><rel auth="MESH">relation</re><r>resource 2</r></triple> to identify a naming authority.
But it's not that common for a single document to be using all those different things. And just because the RDF community thinks everything is a URI is no reason to start thinking everything is a namespace.
To answer your question, though, yes, people often do mix vocabularies. Sometimes it's better to map to and from other vocabularies only at the boundaries of your system, and to have a single, simpler language you use internally.
Should names like "position" be in the same namespace whether it is referring to time, or space, or both?I don't see why not. All the namespace does is disambiguate elements from *DIFFERENT* organizations or maintainers. If it's you that's writing the vocabularies, you're not likely to need namespaces to avoid conflicts with your own names. Namespaces in XML are purely syntactic. For that matter, <staff><position><name>Director</name><duties.... is fine too, in context.
For XSLT you can have match="staff/position" as easily (more easily) than you can have match="staff:position".
There's no limit of 8 namespaces.What kind of XML data should stylesheets transform, and to what XML data should they transform it to, so that stylesheets do not use more than 8 namespaces?
For that matter there's no 8 megabyte limit on the length of an element name in XML. Nor 8 gigabytes.
Sure, you can do pretty neat things with stuff that's syntactically XML but that's out well beyond the norm... sometimes if you do, though, you'll end up fighting both tools and people. There's no hard cut-off, and if what you're doing catches on, maybe the XML community will change over time in this direction. So I won't say it's bad, or it's good, but only, it's not commonly done today to have 80 or more namespaces in one document. Once you get over half a dozen they are going to get pretty hard for most people to remember!
Liam
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Was: [xsl] mode and moved to Na, Liam R E Quin | Thread | Re: Was: [xsl] mode and moved to Na, Michael Müller-Hille |
Re: Was: [xsl] mode and moved to Na, Liam R E Quin | Date | Re: Was: [xsl] mode and moved to Na, Michael Müller-Hille |
Month |