Subject: Re: [xsl] Multiple Template Matchingm, Attributes & Complex XML From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Fri, 25 Feb 2011 18:43:57 +0100 |
ASP.Net 2008, Linq XmlCompiledTransform, XSLT ver 1.0 I assume?
1. Limited as I am, the Person node/element& attribute is updating correctly; How do I add other node/element? I assume it will be to remove Person as the top level match, but I'm not finding examples for making XML, many for HTML and mutilple tables sometimes nesting, but for some reason that doesn't speak to me.
<xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> <xsl:copy> </xsl:template>
<xsl:template match="foo"> <!-- make this a 'bar' element --> <bar> <xsl:apply-templates select="@* | node()"/> </bar> </xsl:template>
<xsl:template match="baz"> <!-- copy but add new child --> <xsl:copy> <xsl:apply-templates select="@* | node()"/> <new-element>...</new-element> </xsl:copy> </xsl:template>
or for the ones you want to delete e.g. <!-- don't copy 'foobar' --> <xsl:template match="foobar"/>
Martin Honnen http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Multiple Template Matchingm, , Jeffry Proctor | Thread | Re: [xsl] Multiple Template Matchin, Martin Honnen |
[xsl] Multiple Template Matchingm, , Jeffry Proctor | Date | Re: [xsl] Multiple Template Matchin, Martin Honnen |
Month |