Subject: Re: [xsl] Copying nodes From: Joerg Heinicke <joerg.heinicke@xxxxxx> Date: Tue, 10 Dec 2002 23:16:13 +0100 |
I'm transforming on the server, using MSXML 3.0.
This is my stylesheet:
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="html"/>
<xsl:template match="/"> <xsl:apply-templates select="/Products/npc"/> </xsl:template>
<xsl:template match="npc">
<xsl:copy>
<xsl:apply-templates select="@*"/> <xsl:copy-of select="*"/>
</xsl:copy> </xsl:template>
<xsl:template match="@*"> <xsl:copy-of select="."/> </xsl:template>
<xsl:template match="@URL"> <xsl:attribute name="URL">http://www.mydomain.com</xsl:attribute> <!-- or <xsl:copy>http://www.mydomain.com</xsl:copy> --> </xsl:template>
</xsl:stylesheet>
Source file:
<Products>
<npc CatId="01" Descr="Accessories">
<p Price="5.61" Sku="C45-4022" ManfPartNo="4502"
URL="http://www.xxx.com/item.asp?sku=C45-4022" />
<p Price="9.99" Sku="I30-1032" ManfPartNo="6333"
URL="http://www.xxx.com/item.asp?sku=I30-1032"/> </npc>
</Products>
I just want to replace once I copy the content of the URL attribute.
Thanks again.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Copying nodes, Juan Carlos Gonzalez | Thread | Re: [xsl] Copying nodes, Juan Carlos Gonzalez |
RE: [xsl] Copying nodes, Juan Carlos Gonzalez | Date | Re: [xsl] Problem on: Cascading xsl, J.Pietschmann |
Month |