RE: save me from the name spaces confusion

Subject: RE: save me from the name spaces confusion
From: Ben Robb <Ben@xxxxxxxxxx>
Date: Wed, 3 May 2000 12:21:12 +0100
I'm tempted to say: go and read the XSL specification from start to end, and
then come back with questions. Your questions are very confused as to the
nature of XSL - what it does and how it is used in the real world.
This is how I understand it. Mike Kay et al will no doubt pick up any
problems with my understanding of the mechanics of namespaces, which I will
blame on a stinking hangover... *grin*
Namespaces are a way of seperating different types of tags in xml; in the
case of the XSL namespace, it tells the parser deal with the tree using its
XSL engine.
In a stylesheet, the XSL namespace follows a rigidly defined DTD which
describes that namespace implicitly. You tell the parser what version you
are using by the following command:
<xsl:stylesheet xmlns:xsl="";
<!-- templates go here -->
Now, the parser does not actually go to this URL to get the namespace DTD -
it is inbuilt into the parser, and so (at least at the moment) unless you
use the correct namespace declaration, the parser will throw you back an
error. The namespace declaration you have used implies that you are still
using the old IE5 parser. Unless there is a good reason why you are using
this (like you are processing your stylesheets on the client side), upgrade
immediately to one of the more compliant parsers such as XT or, if you are
not experienced with Java, try the latest MS parser, MSXML3. IE5 was
released in December 1998; the specification has changed almost beyond
recognition since then, and XSL you write for that parser will not work on
anything else (including MSXML3).
That should answer the first question.
You can create your own namespaces by simply declaring a namespace path to
your schema or DTD in the first occurrence of that namespace. This will be
fetched by the parser and all of the elements within that node with the
declared namespace will be validated against the DTD/Schema.
For example:
<bk:book xmlns:bk="">
    <bk:title>War and Peace</bk:title>
    <bk:author>Leo Tolstoy</bk:author>
In this example, the <price> tag will not be validated against the
namespace; the others will.
Is <xsl:stylesheet xmlns:xsl="..." version="1.0"> a method for including
stylesheets? No. It is the declaration of the type of stylesheet you are
using. If you want to include a stylesheet into another stylesheet, you must
use the <xsl:include> tag.
See question 2
See question 2
Hope this helps - but you really should go and read the XML and XSL

 XSL-List info and archive:

Current Thread