RE: [xsl] Element value

Subject: RE: [xsl] Element value
From: Jarno.Elovirta@xxxxxxxxx
Date: Thu, 21 Nov 2002 10:48:14 +0200
Hi,

> 	I need to tranform an element value to an attribute value:
> 
> input:
> <element>
> <element.name>hello</element.name>
> </element>
> 
> output:
> <element name="hello"/>
> 
> 
> I have no idea ho to refer the element's value in an xsl:template

E.g.

<xsl:template match="*">
  <xsl:copy>
    <xsl:for-each select="*[contains(local-name(), '.')]">
      <xsl:attribute name="{substring-after(local-name(), '.')}">
        <xsl:value-of select="." />
      </xsl:attribute>
    </xsl:for-each>
  </xsl:copy>
</xsl:template>

Jarno - Xorcist: Xorcist (Bleeding mix)

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread