[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: selecting with text nodes
Hi Ian, >Hi, > >I am having a problems trying to select elements based on the text contents >of child nodes. For example how would I convert [...] What kind of problems are you having? In theory it should be as simple as selecting elements on their attributes, which you say you can do fine. Instead of testing for an attribute value in your predicate eg element[@attribute='myValue'] you test for the value of the child element: element[childElement = 'myValue'] This is because the childElement element is converted into a string for the purpose of the comparison. I suppose you could also do child/text() = 'myValue' or even normalize-space(child/text()), but start simple :) nb once you start doing comparisons on a node's 'value' like this, be aware that this value will depend on what it's being compared with. There's a detailed section on this in Mike Kay's book. regards, Tom Weissmann XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|