Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sablotron - using xsl to delete xml, pattern matching

Status
Not open for further replies.

csbdeady

Programmer
May 18, 2002
119
GB
Hi

I have read chapter 10 of PHP4 XML by Wrox and it states I should use:


Code:
<?xml version="1.0" encoding="utf-8"?> 
<xsl:stylesheet xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL] version="1.0">
<xsl:output method="xml" encoding="utf-8" />
<xsl:param name="delevent" />
  <xsl:template match="/eventlising/events/event[@eventID=$delevent]">
  </xsl:template>
  
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>
[/code[

to delete some xml. However I get the following error:

Warning:  Sablotron error on line 5: match pattern contains a variable reference

I am therefore assuming that something is wrong;)

Please can anyone let me know how to accomplish this. I need to be able to specify the eventID (passed in as a variable called delevent in the above).

Many thanks
-Colin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top