[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] wildcards in xpath?
Subject: Re: [xsl] wildcards in xpath? From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Wed, 24 Jul 2002 14:33:05 +0100 |
Hi Markus, > I have a short question to xpath. Is it possible to select all nodes > which begin with "dino"? I want to do something like this: > <xsl:for-each select="dino*"> You can select all nodes that are children of the current node with: node() Then you can filter them with a predicate, which is a boolean expression held in square brackets -- if the expression evaluates as true for the node then the node is retained, if it evaluates as false, then the node is ignored: node()[...] Then you can test whether the context node's value starts with a particular string using the starts-with() function, which takes two arguments -- the string that you want to test, and the string that it should start with. You can use the shorthand . to indicate "the value of the node I'm looking at". So try: node()[starts-with(., 'dino')] Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] wildcards in xpath?, Joerg Heinicke | Thread | [xsl] special formating (one full l, inchi2000 |
Re: [xsl] wildcards in xpath?, Joerg Heinicke | Date | [xsl] calling javascript during tra, Dan Diebolt |
Month |