[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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


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 :

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

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">
		<h2>Result of search</h2>
  	      	  <xsl:apply-templates select="entry"/>

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


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
        Phone : +47 - 92 09 59 68

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

Current Thread