Subject: RE: [xsl] Selection Criteria in XSL From: "Brent Kobayashi" <brent@xxxxxxxxxxxx> Date: Thu, 22 Mar 2001 00:29:01 -0500 |
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: [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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Selection Criteria in XSL, James J Nampalam | Thread | RE: [xsl] Selection Criteria in XSL, Wendell Piez |
[xsl] Generating nodesets?, Gavin Bong | Date | Re: [xsl] How to display XML data p, Davut Karabay |
Month |