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

RE: Selection Criteria in XSL

Subject: RE: Selection Criteria in XSL
From: "Brent Kobayashi" <brent@xxxxxxxxxxxx>
Date: Thu, 22 Mar 2001 00:29:01 -0500
free selection criteria templates
OK,

I tried this and it seems to work:
(Warning - I'm totally new to this, and my presentation is just as much a
question as it MIGHT be a solution):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<xsl:template
match="viewentries/viewentry[entrydata[@columnnumber='1']='Autobiography']">
 <xsl:for-each select="entrydata">
  <h3><xsl:value-of select="."/></h3>
 </xsl:for-each>
</xsl:template>


So my understanding is this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> <xsl:template match="viewentries/viewentry">
> <xsl:for-each
> select="./entrydata[@columnnumber='1']/text='Autobiography'">

You are trying to select the specific viewentry node, therefore you would
have:  viewentries/viewentry[some criteria]

Note:  With your's, after you piece together the match & the for-each, you
get:  viewentries/viewentry/entrydata ...
	>> This selects the actual entrydata node.
	 Also the /text isn't a node, or anything.  Maybe if the XML was formed
<entrydata><text></text></entrydata>?

Actually, I tried to do this selection in two parts, like yours, ie;
	> <xsl:template match="viewentries/viewentry">
	> <xsl:for-each select=".[entrydata[@columnnumber='1']='Autobiography']">

but it definitely did not like this.  Maybe someone can offer an
explanation?



I'm using XML Spy v3.5 with MXSML 3.0



Cheers,

Brent
http://www.kobayashi.ca/
http://www.medusacreative.com/


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of James J
> Nampalam
> Sent: March 21, 2001 11:06 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Selection Criteria in XSL
>
>
> Hi every one,
> I have a problem which must be a simple one but  I am not sure
> how to crack
> it.
> To give a background of the scenario, we are working on Domino environment
> and are using XML and XSL to populate data into a page.
>
> The XML file is like:
>
> <viewentries>
> <viewentry>
> <entrydata>..</entrydata>
> <entrydata>..</entrydata>
> <entrydata>..</entrydata>
> </viewentry>
> <viewentry>
> <entrydata>..</entrydata>
> <entrydata>..</entrydata>
> <entrydata>..</entrydata>
> </viewentry>
> </viewentries>
>
> the entry data element has an attribute - columnnumber which defines the
> position of the entrydata in the viewentry element.
>
> MY problem is I need to select only those viewentry elements whose 1st
> entrydata elements match a specific value..
>
> I wrote something like this.
>
> <xsl:template match="viewentries/viewentry">
> <xsl:for-each
> select="./entrydata[@columnnumber='1']/text='Autobiography'">
> populate the other values in the viewentry element...
> </xsl:for-each>
> </xsl:template>
>
> I am rookie in XSL. So please help me out..
>
> Thanks in Advance,
>
> James
>
>  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.