xsl-list
[Top] [All Lists]

RE: dynamically generated XSL that needs to include namespace for extension functions

2004-05-14 05:43:28

I am using a stylesheet to generate XSL within an 
xsl:document command.

Not sure what you mean by the xsl:document "command" - do you mean the XSLT
1.1 instruction of that name?

The problem I have is that I want to include the xmlns:str 
namespace to my
generated stylesheet so that I can use the EXSLT string function
uri-decode().

XSLT 2.0 has an xsl:namespace instruction for this purpose. In 1.0 there is
a workaround: copy the namespace from a source document. E.g.

<xsl:variable name="dummy">
  <str:dummy xmlns:str="the namespace"/>
</xsl:variable>

<xsl:copy-of select="xx:node-set($dummy)//namespace::str"/>

Michael Kay

(XQuery, incidentally, decided not to provide this capability. I think I
will start pointing out all the things you can do with XSLT 2.0 and not with
XQuery 1.0, just in case anyone believes that Microsoft have got it
right...)



<Prev in Thread] Current Thread [Next in Thread>