Reputation: 127
Is there any way to define (namespace with prefix) in child node of xml using xslt. so that my namespace apply to its decendents also, i have use
<xsl:element name="abc" namespace="{$prmPafNamespace}">
but it create default namespace.
when i use it like below
<xsl:element name="paf:abc" namespace="{$prmPafNamespace}">
<xsl:element name="paf:child_abc"/>
</xsl:element>
then it gives error that 'paf' is not defined, how to solve this issue...
Upvotes: 0
Views: 317
Reputation: 167726
You need to define the namespace on each element e.g.
<xsl:element name="paf:abc" namespace="{$prmPafNamespace}">
<xsl:element name="paf:child_abc" namespace="{$prmPafNamespace}"/>
</xsl:element>
Upvotes: 1
Reputation: 20780
You can try adding an xmlns:paf="{$prmPafNamespace}"
attribute to your document/element, but I'm not sure whether it will work with a dynamic namespace URI.
Upvotes: 0