Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Re: Selecting multiple fields, out of order, in a single Java XPathexpression

Reply
Thread Tools

Re: Selecting multiple fields, out of order, in a single Java XPathexpression

 
 
Martin Honnen
Guest
Posts: n/a
 
      07-18-2008
A. W. Dunstan wrote:

> <top>
> <date>
> <year>2008</year>
> <month>07</month>
> <day>18</day>
> <date>
> </top>
>
> I'd like to do something like this (in Java):
>
> String date = anXPathObject.evaluate("/top/date/[day,month,year]", doc);
>
> and wind up with date having a value of "18072008". The "[day,month,year]"
> (or whatever the syntax is) would tell XPath 'I
> want /top/date/day, /top/date/month and /top/date/year extracted and
> concatenated'.


The XPath expression is
concat(/top/date/day, /top/date/month, /top/date/year)

--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
resolve single line with multiple items into mutliple lines, single items ela Perl Misc 12 04-06-2009 06:47 PM
catching errors with XPathExpression darrel ASP .Net 0 09-28-2005 04:44 PM
XSLT: selecting a single sub-element to print Tristan Miller XML 5 02-09-2005 01:16 AM
Selecting a single record from a dataset...help a newbie =?Utf-8?B?RCBMZWU=?= ASP .Net 2 11-19-2004 09:45 PM
Selecting multiple checkboxes with a single checkbox. Eric Javascript 1 10-24-2003 07:33 PM



Advertisments