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

XSLT 2.0 replace()

Subject: XSLT 2.0 replace()
From: Lou Iorio <lou@xxxxxxxxxxxx>
Date: Tue, 2 Sep 2008 09:18:47 -0400
 XSLT 2.0 replace()
Just learning XSLT 2.0 (and regex), and I'm stumped on the replace() function.

I have XML that looks like this:

<toc>
<category title="Structure">
<item title="&amp;lt;attribute&amp;gt;" href="tag.attribute.html" />
<item title="&amp;lt;handler&amp;gt;" href="LzDelegate.html" />
<item title="&amp;lt;event&amp;gt;" href="LzEvent.html" />
.
.
.


And I want to replace the &amp; with just &, so the HTML that looks like this:

 <body>
     <h1>nav toc</h1>
     <ol>
        <li>Structure</li>
        <ol>
           <li>&lt;lattribute&gt;</li>
           <li>&lt;handler&gt;</li>
           <li>&lt;event&gt;</li>

The closed I've been able to get is this:

  <body>
     <h1>nav toc</h1>
     <ol>
        <li>Structure</li>
        <ol>
           <li>&lt;attribute&amp;gt;</li>
           <li>&lt;handler&amp;gt;</li>
           <li>&lt;event&amp;gt;</li>

So I can change the first &amp;, but not the second. Any ideas? I feel like I
must be missing a fundamental concept here.


Here's a fragment of my XSLT:

<ol>
<xsl:for-each select="category">
<li>
<xsl:value-of select="@title"/>
</li>
<ol>
<xsl:for-each select="item">
<li>
<xsl:value-of select="replace(@title, '&amp;lt;', '&lt;')"/>
</li>
</xsl:for-each>
</ol>
</xsl:for-each>
</ol>


thanks,

Lou

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.