xsl-list
[Top] [All Lists]

Reading the values of elements in a complex parameter

2004-09-22 15:56:19
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>

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

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

I've looked through the XSLT Cookbook, the XSLT Programmers Ref, the
FAQ and on various sites I've hit with Google. Someone, the lightbulb
hasn't gone off.

Thanks very much for any help. All of the help I've been offered to
date has been greatly apprecaited.

      

-- 
---------------------------------------------
 David Adams
  dpadams(_at_)gmail(_dot_)com
 Bermagui 2546 NSW
---------------------------------------------