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

Re: Including markup in a replace string

Subject: Re: Including markup in a replace string
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 6 Oct 2016 13:20:35 -0000
Re:  Including markup in a replace string
On 06.10.2016 15:09, Craig Sampson craig.sampson@xxxxxxx wrote:

  I have code examples in some doc that are post processed in AngularJS.
In some cases the code examples include {{ or }} which is
significant to Angular. I have a simple replace that I am using to wrap
a no-process span around the curly braces so the Angular process will
ignore them.



  *<**xsl:value-of **select*=/"replace(.,'(\{\{|\}\})','&lt;span
class=&quot;noProcess&quot;&gt;$1&lt;/span&gt;')"/*/>*



  The only problem is that the character entity is being output as a
character entity instead of less-than and greater-than characters.

replace returns a string, node nodes.



Is there a way to trick replace into outputting the less-than and greater-than characters?

Depending on the XSLT processor and the context using <xsl:value-of disable-output-escaping="yes" select="..."/> is a hack that can help, but


  So unless theres a way to trick replace Ill have to try
analyze-string and see if I can get what I need there.

using analyze-string is certainly a cleaner way in XSLT 2.0 or 3.0.


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.