[XSL-LIST Mailing List Archive Home]
RE: [xsl] questions regd namespaces
Subject: RE: [xsl] questions regd namespaces|
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 9 Jul 2002 09:46:53 +0100
> I have an xml with a namespace declaration
> <all-centres xmlns="http://www.nda-centres.com/namespaces">
> and i want to out put the xmlns attribute..
Namespace declarations are output automatically by the serializer if the
result tree contains a namespace node. The result tree will
automatically contain a namespace node if you output an element with
local name "all-centres" and namesapce URI
"http://www.nda-centres.com/namespaces", though it won't necessarily use
the prefix that you expect. For example, if you write
then a suitable namespace declaration will be output.
> It obviously is not working when i deal with it in the normal
> attribute way.. my questions:
1. Is xmlns treated different from a normal attribute??
Yes, completely differently.
2. In my case how do i output the value of xmlns??
Normally, just be adding an element or attribute to the result tree
whose name is in the relevant namespace.
3. How will someone benifit from using a namespace declaration??
A big question, I'll leave someone else to answer it...
4. In the xsl:stylesheet instruction,
> <xsl:stylesheet version="1.0"
> the above namespace allows some XSL functions where as the
> older version
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> does
> not allow some methods..
> so where are these methods?? how does the processor know that
> the perticular
> namespace doesnt contain the method or does contain the
> method?? where does it
> look for this information?
The old namespace is recognized only by older versions of Microsoft's
processor. It's essentially two different processors for two different
languages bundled into one product, and it uses the namespace to decide
whether to invoke the new XSLT processor or the old WD-xsl processor.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list