[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Was: mode and moved to Namespaces

Subject: Re: Was: mode and moved to Namespaces
From: Liam R E Quin <liam@xxxxxx>
Date: Sun, 17 Apr 2011 21:24:03 -0400
Re: Was:  mode and moved to Namespaces
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...

> 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?
Namespaces are 100% unrelated to content language.

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".

> 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?

There's no limit of 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

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://www.fromoldbooks.org/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.