[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: wildcards in xpath?

Subject: Re: wildcards in xpath?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 24 Jul 2002 14:33:05 +0100
using wildcards in xpath
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.