Re: [xsl] Refactoring parsing code with XSLT 2.0

Subject: Re: [xsl] Refactoring parsing code with XSLT 2.0
From: Micah Dubinko <micah@xxxxxxxxxxxx>
Date: Thu, 12 May 2005 21:51:46 -0700
Thanks,

I've used tokenize, and I like it. But it seems to only work where you can throw away the delimiters.

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