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

Re: How to fetch desired data

Subject: Re: How to fetch desired data
From: James Fuller <jim.fuller@xxxxxxxxxxxxxx>
Date: Fri, 30 Dec 2005 09:48:27 +0100
fetch data from xml
rob Jackson wrote:

>Hi All,
>
>
>I am converting a source xml into target xml using XSLT.
>
>My source xml has a field like
><xsl:address>Charles Army Street; Boston, Ma 01779</xsl:address>
>  
>

there is no such thing as an xsl:address instruction in any version of 
XSLT, would suggest u use a different element name (or more precisely a
different namespace).

>I have to display it by breaking it into different fields assuming
>there will be comma
>between city and state and space between state and zip.
>
>Target xml should be like this:
><xsl:city>Charles Army Street; Boston</xsl:city>
><xsl:state>Ma</xsl:state>
><xsl:zip>01779</xsl:zip>
>  
>

once again, u seem to want to put everything in the xsl namespace (using
xsl: prefix).....no need for this.

As for how you would crack/split apart the <address/> element, I would
suggest to use a combination of

string-before() or string-after()

(info here
http://www.zvon.org/xxl/XSLTreference/Output/function_substring-after.html)

or

regex approach with EXSLT at http://www.exslt.org/regexp/index.html

or

if u are using XSLT v2.0 then use its native regex processing capability.

gl, Jim Fuller

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.