Subject: Re: [xsl] parsing parens in the park From: Syd Bauman <Syd_Bauman@xxxxxxxxx> Date: Sun, 28 Sep 2008 15:29:16 -0400 |
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>]
</xsl:text>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] parsing parens in the par, G. Ken Holman | Thread | Re: [xsl] parsing parens in the par, Dimitre Novatchev |
Re: [xsl] parsing parens in the par, Dimitre Novatchev | Date | Re: [xsl] parsing parens in the par, G. Ken Holman |
Month |