Given the following XML:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="results.xsl"?>
<results group="A">
<match>
<date>1998-06-10</date>
<team score="2">Brazil<remark>1970 World Cup champion</remark></team>
<team score="1">Scotland</team>
</match>
<match>
<date>1998-06-10</date>
<team score="2">Morocco</team>
<team score="2">Norway</team>
</match>
<match>
<date>1998-06-23</date>
<team score="0">Scotland</team>
<team score="3">Morocco</team>
</match>
<match>
<date>1990-06-23</date>
<team score="0">Chili<remark>Disqualified for fake injury</remark></team>
<team score="3">Brazil</team>
</match>
</results>
And the given XSL:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
<xsl:output method="xml" indent="yes" media-type=""/>
<xsl:template match="/">
<xsl:element name="results_new">
<xsl:for-each select="results/match">
<xsl:element name="match">
<xsl:copy-of select="team"/>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
How can I use xsl:copy-of function to exclude the attribute 'score', but keep the additional elements attached to the team element, such as <remark> statements?
I'm willing to walk through the team node, but I want to copy over any additional mark-up found in the text.
Here's the results I'm expecting:
Code:
<results_new>
<match>
<team>Brazil<remark>1970 World Cup champion</remark></team>
<team>Scotland</team>
</match>
<match>
<team>Morocco</team>
<team>Norway</team>
</match>
<match>
<team>Scotland</team>
<team>Morocco</team>
</match>
<match>
<team>Chili<remark>Disqualified for fake injury</remark></team>
<team>Brazil</team>
</match>
</results_new>