Subject: [xsl] Multi-part search XPath expressions. From: David Adams <dpadams@xxxxxxxxx> Date: Sat, 11 Sep 2004 10:36:37 +1000 |
I'm fairly new to XSLT and am currently working my way though the excellent "XSLT Programmer's Reference", various on-line tutorials and FAQs. I'm really struggling to write the XPath expressions I want and suspect the problem is I'm not thinking right. I'm coming to XPath with a database background, oriented, and goals. As an example, here is a fragment of an XML file I'm working with: <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> </Australian_Birds> (The orginal file has over 800 birds and comes in at around 200K of text.) I want to do searches, such as select species where the Extinct="True" and Genus_Name="Alectura" The best I've been able to come up with is an expression like the one below: /Australian_Birds/Species[Extinct!="True"]/self::Species[Genus_Name="Alectura"] Is this actually correct? It seems a bit cumbersome. I've got a lot of related questions having to do with how to, more-or-less, "search" XML documents using XSLT. I've been trying to find a tutorial with explicit example expressions but haven't found one yet. If I've missed something in Kay or on-line, please feel free to point me in the right direction. Much appreciated, -- --------------------------------------------- David Adams dpadams@xxxxxxxxx Bermagui 2546 NSW --------------------------------------------- --+------------------------------------------------------------------ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> --+--
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT, XHTML, and default , Joseph Dane | Thread | Re: [xsl] Multi-part search XPath e, Bruce D'Arcus |
RE: [xsl] Namespace problem, Xia Li | Date | Re: [xsl] Multi-part search XPath e, Bruce D'Arcus |
Month |