Re: [xsl] Analyze-string Regex to Match Content within Curly Braces

Subject: Re: [xsl] Analyze-string Regex to Match Content within Curly Braces
From: "Eliot Kimber ekimber@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 17 Nov 2020 14:26:30 -0000
Too quirky.

Cheers,

E.
--
Eliot Kimber
http://contrext.com


o;?On 11/17/20, 8:04 AM, "Michael Kay mike@xxxxxxxxxxxx"
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

    A suggestion that I've thought about from time to time:
    If an attribute in XSLT expects an expression or an AVT, then a leading
undoubled "}" in the attribute value indicates that is to be treated as a
plain string.

    So for an expression

    <xsl:param name="x" select="}O'Reilly"/>

    indicates that the default value is the string "O'Reilly"

    and in an AVT

    regex="}[a-z]{4}"

    indicates that the regex is [a-z]{4}

    This relies on the fact that neither an AVT nor an expression can legally
begin with an undoubled "}", nor is it ever likely to. And you can think of
"}" as meaning "exit expression mode, here is plain text".

    Nice idea, or just too quirky?

    Michael Kay
    Saxonica
    XSL-List info and archive
<http://www.mulberrytech.com/xsl/xsl-list>EasyUnsubscribe
<http://lists.mulberrytech.com/unsub/xsl-list/1278982>
    (by email <>)

Current Thread