[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
I would like to select (apply templates) those <res> elements which have <text> tag (1 level down from <entrydata columnnumber="0">) containing a specific string. I am not sure how to go about selecting 2 children down from the res element as a predicate (which would go in the select statement of apply-templates).
e.g. I would like to select a <res> element which has a <text> element containing "main title" in it. The example above includes this string in one of the res tags.
_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection http://www.msn.co.uk/specials/btbroadband
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
[xsl] apply templates which have a child node containing specific text
Subject: [xsl] apply templates which have a child node containing specific text From: "james walker" <jameswalkerandy@xxxxxxxxxxx> Date: Wed, 01 Oct 2003 15:31:42 +0100 |
Given this xml: <t> <res position="1"> <entrydata columnnumber="0"> <text>main title</text> </entrydata> <rol position="1.1"> <entrydata columnnumber="1"> <text>some more text here</text> </entrydata> <prod position="1.1.1"> <entrydata columnnumber="2"> <text>text here</text> </entrydata> <entrydata columnnumber="3"> <text>more text here</text> </entrydata> <entrydata columnnumber="4"> <text>more text here</text> </entrydata> <entrydata columnnumber="5"> <text>more text here</text> </entrydata> <entrydata columnnumber="6"> <text>more text here</text> </entrydata> <entrydata columnnumber="7"> <text>more text here</text> </entrydata> <entrydata columnnumber="8"> <text>more text here</text> </entrydata> <entrydata columnnumber="9"> <text/> </entrydata> </prod> <prod position="1.1.2"> <entrydata columnnumber="2"> <text>text here</text> </entrydata> <entrydata columnnumber="3"> <text>more text here</text> </entrydata> <entrydata columnnumber="4"> <text>more text here</text> </entrydata> <entrydata columnnumber="5"> <text>more text here</text> </entrydata> <entrydata columnnumber="6"> <text>more text here</text> </entrydata> <entrydata columnnumber="7"> <text>more text here</text> </entrydata> <entrydata columnnumber="8"> <text>more text here</text> </entrydata> <entrydata columnnumber="9"> <text/> </entrydata> </prod> </rol> </res> <res position="2"> <entrydata columnnumber="0"> <text>some more text here</text> </entrydata> <rol position="2.1"> <entrydata columnnumber="1"> <text>some more text here</text> </entrydata> <prod position="2.1.1"> <entrydata columnnumber="2"> <text>text here</text> </entrydata> <entrydata columnnumber="3"> <text>more text here</text> </entrydata> <entrydata columnnumber="4"> <text>more text here</text> </entrydata> <entrydata columnnumber="5"> <text>more text here</text> </entrydata> <entrydata columnnumber="6"> <text>more text here</text> </entrydata> <entrydata columnnumber="7"> <text>more text here</text> </entrydata> <entrydata columnnumber="8"> <text>more text here</text> </entrydata> <entrydata columnnumber="9"> <text/> </entrydata> </prod> </rol> </res> </t>
I would like to select (apply templates) those <res> elements which have <text> tag (1 level down from <entrydata columnnumber="0">) containing a specific string. I am not sure how to go about selecting 2 children down from the res element as a predicate (which would go in the select statement of apply-templates).
e.g. I would like to select a <res> element which has a <text> element containing "main title" in it. The example above includes this string in one of the res tags.
_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection http://www.msn.co.uk/specials/btbroadband
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] A way to use Single quote, SANWAL, ABHISHEK (HP | Thread | RE: [xsl] apply templates which hav, Michael Kay |
[xsl] A way to use Single quote or , SANWAL, ABHISHEK (HP | Date | RE: [xsl] apply templates which hav, cknell |
Month |