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

Re: Regex in @select Escaping Puzzle

Subject: Re: Regex in @select Escaping Puzzle
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 16 Aug 2020 16:15:37 -0000
Re:  Regex in @select Escaping Puzzle
Am 16.08.2020 um 18:06 schrieb Martin Honnen martin.honnen@xxxxxx:

Part of the problem I think is that the "regexp" attribute of
"xsl:analyze-string" allows attribute value templates so you either have
to double curly braces or better declare your pattern as a parameter or
variable before the element e.g. using Michael's suggestion

 B  <xsl:param name="pattern"
as="xs:string">\{\{image_[^}]+\}\}([^{]+)\{\{/image\}\}</xsl:param>

And to be safe in XSLT 3 in any context you probably want


<xsl:param name="pattern"
as="xs:string"
expand-text="no">\{\{image_[^}]+\}\}([^{]+)\{\{/image\}\}</xsl:param>


otherwise the use of expand-text="yes" higher up the tree causes the same problem you run in with using the regular expression in the attribute.

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.