[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
----- Original Message ----- From: "Karl Stubsjoen" <kstubs@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, June 07, 2007 6:58 PM
Subject: [xsl] Long Namespaces
You appear to be confusing the namespace URI or name with its prefix. The idea is that namespace URIs are globally unique, they are often similar to URLs because that way you can use your domain and assure uniqueness, although there's nothing to stop you creating a namespace such as http://www.microsoft.com if you wish, it's a "gentlemen's agreement".
The prefix is a way to save writing the long URI and just holds for the lifetime of the document, maybe even less than that if you re-define the prefix mappings. So you can say that "ns" actually represents http:///www.myDomain.com/namespaces/myNamespace and use that prefix in a number of situations, e.g.. in an XPath expression. You often this mapping with xmlns:ns="http:///www.myDomain.com/namespaces/myNamespace" but this only holds until the URI is mapped to a different prefix or the process finishes. So in an XML document you could map "ns1" to the URI whereas in an XSLT you use to transform it you could map to "ns2" instead.
Re: [xsl] Long Namespaces
Subject: Re: [xsl] Long Namespaces From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx> Date: Thu, 7 Jun 2007 19:29:43 +0100 |
----- Original Message ----- From: "Karl Stubsjoen" <kstubs@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, June 07, 2007 6:58 PM
Subject: [xsl] Long Namespaces
I presume you mean "declarations" :)Is there any creed that suggests that namespace decelerations are either bad or shunned upon? It seems that 3 letter namespaces are the norm. Is anyone using verbose namespace declarations regularly?
Karl..
You appear to be confusing the namespace URI or name with its prefix. The idea is that namespace URIs are globally unique, they are often similar to URLs because that way you can use your domain and assure uniqueness, although there's nothing to stop you creating a namespace such as http://www.microsoft.com if you wish, it's a "gentlemen's agreement".
The prefix is a way to save writing the long URI and just holds for the lifetime of the document, maybe even less than that if you re-define the prefix mappings. So you can say that "ns" actually represents http:///www.myDomain.com/namespaces/myNamespace and use that prefix in a number of situations, e.g.. in an XPath expression. You often this mapping with xmlns:ns="http:///www.myDomain.com/namespaces/myNamespace" but this only holds until the URI is mapped to a different prefix or the process finishes. So in an XML document you could map "ns1" to the URI whereas in an XSLT you use to transform it you could map to "ns2" instead.
Joe http://joe.fawcett.name
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Long Namespaces, Karl Stubsjoen | Thread | Re: [xsl] Long Namespaces, Karl Stubsjoen |
[xsl] Long Namespaces, Karl Stubsjoen | Date | Re: [xsl] Long Namespaces, Karl Stubsjoen |
Month |