Subject: RE: [xsl] recreating elements with attributes From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 11 Feb 2004 11:41:55 -0500 |
<xsl:template match="CDRS/TOLL_CDR">
<TOLL_CDR>
<xsl:for-each select="@*">
<xsl:choose>
<xsl:when test="name()='DIVISION'">
<!-- do special logic here, such as rename an attribute -->
<xsl:attribute name="mydivision">
<xsl:value-of select="." />
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:copy/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each> </TOLL_CDR> </xsl:template>
<xsl:template match="CDRS/TOLL_CDR"> <TOLL_CDR> <xsl:apply-templates select="@*"> </TOLL_CDR> </xsl:template>
<xsl:template match="TOLL_CDR/@DIVISION" priority="2"> <xsl:attribute name="mydivision"> <xsl:value-of select="." /> </xsl:attribute> </xsl:template>
<xsl:template match="TOLL_CDR/@*"> <xsl:copy-of select="."/> </xsl:template>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] recreating elements with , Gruenewald, Terry | Thread | RE: [xsl] recreating elements with , Wendell Piez |
RE: [xsl] Following-Sibling, Schreifels, Mark J. | Date | RE: [xsl] How to filter element val, Josh Canfield |
Month |