[Schematron] How to find the inscope default namespace
David Carlisle
d.p.carlisle at googlemail.com
Tue Aug 4 07:24:42 EDT 2009
> Furthermore, I don't want to use namespace nodes, since that is
> implementation dependent.
in xpath1/xslt1 there is nothing implementation dependent about the
following expression
<xsl:value-of select="namespace::*[name()='']"/>
and that is the only access there is to namespace information.
In xpath 2 there are alternatives to the namespace axis, which is
unfortunately implementation dependendent in native mode, so you can use
namespace-uri-for-prefix
<xsl:stylesheet version="2.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns="dd">
<xsl:template match="*">
1 default ns is {<xsl:value-of select="namespace::*[name()='']"/>}
2 default ns is {<xsl:value-of select="namespace-uri-for-prefix('',.)"/>}
</xsl:template>
</xsl:stylesheet>
David
--
http://dpcarlisle.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.eccnet.com/pipermail/schematron/attachments/20090804/0292da0b/attachment.html
More information about the Schematron
mailing list