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

Testing/searching for several elements using xsl

Subject: Testing/searching for several elements using xsl
From: Thomas Weholt <u970130@xxxxxxxxxxxxx>
Date: Wed, 14 Apr 1999 11:08:11
xsl match several elements
Hello,

Note! This mail is related to the "Searching huge xml-documents" question I
posted earlier, but it`s intereseting by itself too.

I want to locate several "entries"-elements in a xml-document using a
entry-elements "no"-attribute.

Sample xml-doc :

<cd_doc>
	... info about the cd ...
	<entries>
	  <entry no="1" path="/cdrom/stugg/long path/more
text/python_stuff.tar.gz" ... more info .../>
	  ... lots of more entries
	</entries>
</cd_doc>

I tried with a stylesheet like this :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

	<xsl:template match="cd_doc">
	  <HTML>
	    <BODY>
		<h2>Result of search</h2>
  	      	  <xsl:apply-templates select="entry"/>
	   </BODY>
	  </HTML>
	</xsl:template>

	<xsl:template match="entry">
	  <xsl:choose>
		<xsl:when test='.[@no="1"|@no="21"|@no="1432"]'>
		   <xsl:apply-templates select=""/>
		</xsl:when>
	  </xsl:choose> 
	</xsl:template>

</xsl:stylesheet>

But it didn`t work. I want to process entries with attribute numbers equal
to 1, 21 and 1432. Used Xt to generate HTML with these documents.

----------------------------------------------
              Thomas Weholt
       eMail : weholt@xxxxxxxxxxxxxx
     HTTP://www.linuxfreak.com/~weholt
        Phone : +47 - 92 09 59 68
----------------------------------------------



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.