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

Re: XPath expression to convert a list of (string) in

Subject: Re: XPath expression to convert a list of (string) integers into a sequence of (genuine) integers
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 26 Dec 2012 09:06:38 -0800
Re:  XPath expression to convert a list of (string)  in
This can also be used with XPath 3.0:

  map(codepoints-to-string#1, map(xs:integer#1,tokenize(., '\s+')))

and produces:

"T h e   s e c r e t   a g e n t   i s   . . ."


Cheers,
Dimitre

On Wed, Dec 26, 2012 at 5:44 AM, Costello, Roger L. <costello@xxxxxxxxx> wrote:
> Hi Folks,
>
> I want an XPath expression to convert the codepoints in this element
>
> <Numbers>84 104 101 32 115 101 99 114 101 116 32 97 103 101 110 116 32 105 115 32 46 46 46</Numbers>
>
> into a string.
>
> Here is one way to do it
>
>     codepoints-to-string(for $i in tokenize(., '\s+') return xs:integer($i))
>
> Is there a better XPath expression?
>
> By "better" I mean simpler.
>
> /Roger

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.