Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] XSLT 2.0 replace()

From: Lou Iorio <lou@------------>
To:
Date: 9/2/2008 1:19:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent