|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to fetch desired data
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








