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

How to construct an XPath expression for this node-set

Subject: How to construct an XPath expression for this node-set?
From: Tim Meals <tmeals@xxxxxxxxx>
Date: Wed, 6 Aug 2003 15:16:27 -0700
xpath expression howto
I'm working with a problem I'd like to solve with a single XPath
expression.  Yes, this is slightly off-topic, but I've seen some of the
mind-boggling XPath expressions pass through this list and can't figure
out how to do this one myself.

The XML file excerpt is something like this:
...
<Address addressID="100">
    <Name xml:lang="en">90 - Test Name</Name>
    ...
</Address>
...
<Address addressID="100">
    <Name xml:lang="en">91 - Another Name</Name>
    ...
</Address>

By definition, there are more than one Address element per XML file.
Normally, there will be exactly two, but the spec allows the number to
be open-ended.

I would like to receive back a nodeset from the XPath expression, but
concatenating the addressID with the substring-before(Name, ' ').  If I
evaluate:
    concat( //Address/@addressID, '-',
            substring-before( //Address/Name, ' ' ) )
I get back a String with one value ("100-90", in this case).  What I
want is a nodeset containing elements with "100-90", "100-91".  Does
anyone have any ideas on how to procede?  I'm running Xalan 2.4.1, but
could upgrade to 2.5.1 if there is functionality there that's not
present in 2.4.1.

Thanks,
Tim

-- 
e-mail: tmeals@xxxxxxxxx

"Recommend to your children virtue; that alone can make them
 happy, not gold."
    -- Ludwig van Beethoven

 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.