match containing variable
Hi
I was wondering if anyone would be kind enough to re-write the following sample text from the PHP4 XML book (nb: there's no separate list for this book hence me posting here) so that it does not require a variable in the match.
Many thanks, have been completely stuck on this now for 4 hours :(
My objective is to delete an event based on an eventID (the example uses product and pid) whilst leaving the others in tact.
Several e-beers to whoever solves this one :)
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" encoding="utf-8" />
<xsl:param name="pid" />
<xsl:template match="/cart/products/product[@pid=$pid]">
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
-Colin
|