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

RE: Question about "for-each select"

Subject: RE: Question about "for-each select"
From: "Bert" <arm@xxxxxxxxx>
Date: Thu, 22 Jan 2004 20:53:52 +0100
for each select
Hi,

Thanks for the help.
Now it works just fine.

Kind regards,
Bert



-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of George
Cristian Bina
Sent: donderdag 22 januari 2004 20:40
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Question about "for-each select"


Hi Bert,

<xsl:for-each select="root/person[gender = 'male' and age='41']">

Best Regards,
 George
-------------------------------------------------------
George Cristian Bina mailto:george@xxxxxxxxxxxxx
<oXygen/> XML Editor - http://www.oxygenxml.com/


----- Original Message -----
From: "Bert" <arm@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, January 22, 2004 9:21 PM
Subject:  Question about "for-each select"


> Hi,
>
> I need some help/advice on the following subject.
>
> >From the xml-file below I want to get the information of all the males
who
> are 41.
>
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="persons.xsl"?>
> <root>
>  <person>
>   <name>Bert</name>
>   <gender>male</gender>
>   <age>41</age>
>  </person>
>  <person>
>   <name>Elisa</name>
>   <gender>female</gender>
>   <age>41</age>
>  </person>
>  <person>
>   <name>Carl</name>
>   <gender>male</gender>
>   <age>40</age>
>  </person>
> </root>
>
> I use the following template to do that (at least I try to do that):
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>  <xsl:output method="xml" indent="no"/>
>  <xsl:template match="/">
>   <document>
>    <xsl:for-each select="root/person[gender = 'male']">
>     <xsl:sort select="name" order="ascending"/>
>     <xsl:value-of select="name"/>
>     <xsl:value-of select="' - '"/>
>     <xsl:value-of select="age"/>
>     <br/>
>    </xsl:for-each>
>   </document>
>  </xsl:template>
> </xsl:stylesheet>
>
> Actually I need a 'for-each'-statement like this:
> <xsl:for-each select="root/person[gender = 'male']" AND "root/person[age =
> '41']">
>
> This obviously doesn't work. Can it be done this way and if not, how can I
> achieve my goal?
> As you can see help is welcome!
>
> Kind regards,
> Bert
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.