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

RE: if not match "match"

Subject: RE: if not match "match"
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Thu, 14 Jun 2001 18:15:52 +0100
xsl if not
You really shouldn't be using the obsolete WD-xsl dialect, and if you do,
I'm afraid you won't get much help on it from this list, which is
pretty-well 100% XSLT 1.0.

If you don't know the difference, see the MSXML FAQ at
http://www.netcrucible.com/

Mike Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
> pcaspian@xxxxxxxxxxx
> Sent: 14 June 2001 16:58
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  if not match "match"
>
>
> error is "Attribute 'match' is invalid on 'xsl:if'. "
>
> Could someone please explain to me the relationship between
> the template
> match and the if: match= relationship ??
>
> I have managed to successfully used  this when its a simple
> example, eg
>
> <?xml version="1.0" encoding="ISO8859-1" ?>
> <CATALOG>
>   <CD>
>     <TITLE>Empire Burlesque</TITLE>
>     <ARTIST>Bob Dylan</ARTIST>
>     <COUNTRY>USA</COUNTRY>
>     <COMPANY>Columbia</COMPANY>
>     <PRICE>10.90</PRICE>
>     <YEAR>1985</YEAR>
>   </CD>
> </CATALOGUE>
>
> <?xml version='1.0'?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
> <xsl:template match="/">
>   <html>
>   <body>
>     <table border="2" bgcolor="yellow">
>       <tr>
>         <th>Title</th>
>         <th>Artist</th>
>       </tr>
>       <xsl:for-each select="CATALOG/CD">
>       	<xsl:if match=".[ARTIST='Bob Dylan']">
>       	  <tr>
>           <td><xsl:value-of select="TITLE"/></td>
>           <td><xsl:value-of select="ARTIST"/></td>
> 	  </tr>
>         </xsl:if>
>       </xsl:for-each>
> .
> .
> .
>
> According to this example the if is placed after the
> <xsl:for-each select> tag
>
> In my example (too long to paste), I am using various for loops inside
> different elements.
> Why would this make a difference ?
>
> ALso another, perhaps simpler question
>
> <CATALOG>
>   <CD>
>     <TITLE>Empire Burlesque</TITLE>
>     <TITLE>Empire Burlesque2</TITLE>
>     <YEAR>1984</YEAR>
>     <YEAR>1985</YEAR>
>     <TITLE>Empire Burlesque3</TITLE>
>   </CD>
> </CATALOGUE>
>
>
> In the above example, if I have a <For-each TITLE>, and thereafter a
> <For-each YEAR> statement, would the list first be searched on all the
> titles..ie go up and down the list and display all the titles
> and THEN go
> up and down the list for all the YEARS ?
>
> I had a problem with a similar example earlier, thus I ask.
>
> THanks
>
> Karlo
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.