[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: xsl:template match problem

Subject: RE: xsl:template match problem
From: "Kenny Akridge" <kenny@xxxxxxxxxxxxxxxxx>
Date: Sat, 17 Apr 2004 12:13:49 -0400
xsl template match problem
Here is one solution:

<!-- pass in all children of ROOT/NODES who do not have 'EXCL' in their
name.
<xsl:template match="/">
	<xsl:apply-templates select="ROOT/NODES/*[not(contains(name(.),
'EXCL'))]"/>
</xsl:template>

-----Original Message-----
From: Sam Saha [mailto:sam_saha1975@xxxxxxxx] 
Sent: Saturday, April 17, 2004 12:00 PM
To: XSL List
Subject:  xsl:template match problem

Hi,
 How do I write an exclusion template that avoids all
the nodes that start with a particular value, in the
output.

I have this XML.

<ROOT>
  <NODES>
     <NODE_1>VALUE</NODE_1>
     <NODE_2>VALUE</NODE_2>
     <NODE_3>VALUE</NODE_3>
     <NODE_4>VALUE</NODE_4>
     <NODE_5>VALUE</NODE_5>
     <NODE_6>VALUE</NODE_6>
     <NODE_7>VALUE</NODE_7>
     <NODE_8>VALUE</NODE_8>
     <EXCL_1>exval</EXCL_1>
     <EXCL_2>exval</EXCL_2>
     <EXCL_3>exval</EXCL_3>
     <EXCL_4>exval</EXCL_4>
     <EXCL_5>exval</EXCL_5>
  </NODES>
</ROOT>

I am doing the the following in the XSLT 

<xsl:apply-templates select="ROOT/NODES/*" />

And I have this template that matches the nodes:

<xsl:template match="node()">
	<!-- Do output -->
</xsl:template>

I am thinking of having an exclusion template that
matches all the nodes that starts with 'EXCL_' and do
nothing.
I am getting stuck with this.

<xsl:template match="How_to_write_this" />


Thanks for your help.

Sam.


______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.