Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2007, 11:36 AM
Authorized User
 
Join Date: Mar 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT and Namspace Query.

I have a small query regarding namespaces which is confusing me.

A namespace is a "virtual container" for the elements.Even though a namespace looks like an URL,
it is not.

I have a namespace called in my XSL called

<someElement xmlns:pfx:"http://www.foo.com />

and this namespace contains a few XSL documents.

Where are these XSL documents exactly stored?
If I create a new XSL document and would like to store this at the above URL,how do I do it?

Please no offence meant as I am learning XSLT.

Thanks,




 
Old April 10th, 2007, 11:57 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>A namespace is a "virtual container" for the elements.

No, I don't think that's a particularly good description of the concept.

Think of the namespace as an implicit part of the element name, in the same way that "USA" (or some other country) is an implicit part of your postal address.

James Clark's tutorial at http://www.jclark.com/xml/xmlns.htm is quite old, but it's as good as anything.

>Even though a namespace looks like an URL, it is not.

It *is* a URI (and it may be a URL). But it isn't used to fetch anything. It's a name, not a location. I can identify you by your email address, but that doesn't mean I have to send you any email.

>this namespace contains a few XSL documents

no, namespaces don't "contain" documents. They merely form part of the name of elements and attributes.

>Where are these XSL documents exactly stored?

Anywhere you like. The namespaces used in a document and the location of the document are completely independent of each other.

>If I create a new XSL document and would like to store this at the above URL, how do I do it?

You go to a domain name registrar, buy the domain foo.com, then go to a web hosting company and tell them you want them to host the domain foo.com; they give you the details of how to transfer documents to their servers using FTP or some other protocol, and you can then create documents that are accessible using a URL such as http://www.foo.com/doc.xml

But this, as I said, has nothing to do with namespaces. Anyone can use the namespace "http://www.foo.com/" in their documents. It's considered bad form to use a domain that you don't own, but no-one can stop you doing it (as far as I know - I'm not a lawyer!)

Take SVG as an example. SVG is an XML vocabulary defined by W3C. So it uses a namespace URI of the form http://www.w3.org/... But anyone can create SVG documents and they can store them anywhere they like.



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
One query in xslt pasupathy.b XSLT 7 May 30th, 2007 05:53 PM
Query About XSLT-Urgent harshalchoksi XSLT 6 February 23rd, 2007 06:43 AM
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
How to Query XML Data from XSLT Form kwilliams XSLT 1 December 3rd, 2005 06:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.