This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Selection Criteria in XSL
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Selection Criteria in XSL
- From: "Brent Kobayashi" <brent at kobayashi dot ca>
- Date: Thu, 22 Mar 2001 00:29:01 -0500
- Reply-To: xsl-list at lists dot mulberrytech dot com
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@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of James J
> Nampalam
> Sent: March 21, 2001 11:06 PM
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] 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