Re: [xsl] Embedding an SSI echo in an XML attribute

Subject: Re: [xsl] Embedding an SSI echo in an XML attribute
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Wed, 09 May 2007 12:23:12 +0300
Hi,

That is not anymore an XML attribute as what you generate as output is not XML. The simplest thing is to switch to text output method and generate what you want:

<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="text"/>
<xsl:template match="/">
<![CDATA[<a href="<!--#echo var="grar.5.url" encoding="none" -->">link</a>]]>
</xsl:template>
</xsl:transform>


Regards,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


tom tom wrote:
I need to generate an apache .sssi file that contains the following kind of code:

<a href="<!--#echo var="grar.5.url" encoding="none" -->">link</a>

To acheive this in XSLT 1 we generated the code as CDATA in a plain text file:

<xsl:text disable-output-escaping="yes">&lt;a href="</xsl:text>
<xsl:comment>#echo var='grar.5.url' encoding='none'</xsl:comment>
<xsl:text disable-output-escaping="yes">"&gt;link&lt;/a&gt;</xsl:text>

Can anyone advise on a cleaner way to do this using XSLT 2?

_________________________________________________________________
Txt a lot? Get Messenger FREE on your mobile. https://livemessenger.mobile.uk.msn.com/

Current Thread