xslt: string concatenation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cinimod
    New Member
    • Sep 2008
    • 1

    xslt: string concatenation

    Hi,

    after running the transformation I want the following output:

    <p:elementNam e/>

    therefore I run my xslt as the following:

    <xsl:variable name="prefix">< xsl:text>p</xsl:text></xsl:variable>
    ...
    <xsl:template match="currentN ode">
    <xsl:variable name="nodeName" ><xsl:value-of select="name()"/> </xsl:variable>
    <xsl:element name="{$prefix} :{$nodeName}" /> -> here is the problem
    ...

    the problem is, that I write {$prefix}:{$nam e} and the compiler says that no namespace is declared for the prefix "p".

    Thanks for help in advance!
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    xslt: string concatenation

    that's correct, you have to declare every namespace you use.

    regards

    Comment

    Working...