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

Re: parsing parens in the park

Subject: Re: parsing parens in the park
From: Syd Bauman <Syd_Bauman@xxxxxxxxx>
Date: Sun, 28 Sep 2008 15:29:16 -0400
Re:  parsing parens in the park
Thank you very much for your speedy response. (Relativistic, I
daresay, as your response was sent over 3 hours before I posted. :-)


> True, but a key table always contains tree nodes and is indexed by
> values ... you cannot load up a key table with strings.

Check, thanks for the explanation.


> I would have used analyze-string, as below, except that I haven't
> got the time right now to figure out how to check for and preserve
> a value that contains nested parentheses. So the answer below is
> incomplete.
> I hope this helps.

Yes and no. While you've saved me a bunch of time in hammering out
the details of analyze-string, (non-)matching-substring, and
regex-group() usage, it is the regexp for parsing over matched parens
that seems to be the hard part, at least to me.

I am probably going to start messing with expressions like
   \(([^)]|\([^)]*\))*\)
in a bit.

Meanwhile, thank you very much, Ken, for posting this. Such efforts
always have positive side effects. In this case, I had not realized
that in XSLT 2 one can use
    <xsl:value-of select="'[Got',regex-group(1), 'with',regex-group(2),']'"/>
where I would have steadfastly stuck with 
    <xsl:text>[Got </xsl:text>
    <xsl:value-of select="regex-group(1)"/>
    <xsl:text> with </xsl:text>
    <xsl:value-of select="regex-group(2)"/>
    <xsl:text>]&#x0A;</xsl:text>

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.