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

RE: Refactoring parsing code with XSLT 2.0

Subject: RE: Refactoring parsing code with XSLT 2.0
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 13 May 2005 09:17:46 +0100
parsing code
> I've used tokenize, and I like it. But it seems to only work 
> where you 
> can throw away the delimiters.

Yes, xsl:analyze-string is much more powerful for this kind of thing.

Michael Kay
http://www.saxonica.com/ 

> 
> Ex.  "a b c" --> "a", "b", "c" (with the spaces gone)
> 
> In this case, what I need is
> 
> "3.04in" --> "3.04", "in"
> 
> So I'd need a regex that hits in the right spot, but matches zero 
> characters. I don't think lookaheads are in the spec. At 
> least I haven't 
> found them. Neither are subexpressions that I can tell.
> 
> I still have a feeling that XSLT2 offers some elegant way to 
> do this, at 
> least more elegant than my current 11-line <xsl:choose> 
> construction. Am 
> I off-key?
> 
> .micah
> 
> M. David Peterson wrote:
> 
> >Micah,
> >
> >Do you want to potentially keep track of what goes with what... in
> >other words do you want to walk away with a set of elements that have
> >the value, unit short name, and unit long name for example...
> >
> >Actually, no matter what your desired output is in 2.0 this type of
> >functionality is serviced via the tokenize() function
> >  
> >
> 
> -- 
>   Available for consulting. XForms, web forms, information overload.
>   Micah Dubinko                           mailto:micah@xxxxxxxxxxxx
>   Brain Attic, L.L.C.                        http://brainattic.info
>   Yahoo IM: mdubinko                                +1 623 298 5172
>   Learn XForms today: http://xformsinstitute.com

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.