I’m trying to render the following HTML code using xslt:
<foo:bar href="[MYURL]"/>
I created the following template:
<xsl:template name="displaySomeLink">
<xsl:param name="url"/>
<foo:bar href="{$url}"></foo:bar>
</xsl:template>
Which I’m planning to call like:
<xsl:call-template name="displaySomeLink">
<xsl:with-param name="url" select="[MYURLSELECTIONLOGICS]"/>
</xsl:call-template>
However, my xslt parser indicates justly that the foo prefix is not defined, and as the foo prefix doesn’t signify anything at xslt level, I don’t want to register it. Is there any way I can escape a character in a tagname?
(Of course I can easily do some other workaround, like concatenating a string which will output the same.)
Just define the
foonamespace prefix in the XSLT stylesheet:or
or
You are correct in that the
foonamespace prefix and its namespace have no meaning in XSLT, but neither have the default namespace “” or any other namespace except for thehttp://www.w3.org/1999/XSL/Transformnamespace (usually represented by thexslprefix).The XSLT processor will just spew out elements with whatever namespace they are defined in.