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

RE: Reading the values of elements in a complex parame

Subject: RE: Reading the values of elements in a complex parameter
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Thu, 23 Sep 2004 07:52:33 +0300
lisa lashes mixes
Hi,

> I'm struggling to understand how to read complex external parameters.
> Simple parameters are easy enough to work with, but I'm not clear on
> the mechanics of extracting value from complex parameters for value-of
> or within XPath expressions (select.) As in my post of last week, I'm
> trying to feed in a list of values for matching and processing. As an
> example, a very reduced sample of a source XML file with the birds of
> Australia:
>
> <Australian_Birds>
>        <Species>
>                <Sequence>1</Sequence>
>                <Family_Name>Struthionidae</Family_Name>
>                <Genus_Name>Struthio</Genus_Name>
>                <Species_Name>camelus</Species_Name>
>                <Common_Name>Ostrich</Common_Name>
>                <Extinct>False</Extinct>
>        </Species>
>        <Species>
>                <Sequence>2</Sequence>
>                <Family_Name>Casuariidae</Family_Name>
>                <Genus_Name>Casuarius</Genus_Name>
>                <Species_Name>casuarius</Species_Name>
>                <Common_Name>Southern Cassowary</Common_Name>
>                <Extinct>False</Extinct>
>        </Species>
> ...
>
> The parameter  could look like this:
>
> <genera>
>  <genus>Dromaius</genus>
>  <genus>Coturnix</genus>
>  <genus>Philemon</genus>
> </genera>

Let's call this $param

> I want to figure out the syntax for two tasks:
> 1) Reading and using the value of the subelements:
>      Dromaius

$param/genera/genus[1]

>      Coturnix

$param/genera/genus[2]

>      Philemon

$param/genera/genus[3]

> 2) Using each subelement value as part of a match condition.

You can't use them in match patterns. Do you mean in xsl:if expressions or in
predicates? e.g. /Australian_Birds/Species[Genus_name =
$param/genera/genus[1]]

If I answered the wrong questions, please give an example of what you want as
a result.

Cheers,

Jarno - Lisa Lashes: Hard Mix

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.