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

Subject: Re: [xsl] Embedding an SSI echo in an XML attribute
From: "tom tom" <tomxsllist@xxxxxxxxxxx>
Date: Wed, 09 May 2007 12:06:35 +0100
I am having trouble generating the quotes inside the attributes from your example. I am using the following XSLT with Saxon 8:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>


<xsl:output method="xhtml" encoding="utf-8" omit-xml-declaration="yes" use-character-maps="ssi"/>

	<xsl:character-map name="ssi">
		<xsl:output-character character="&#xF0001;" string="&lt;!--"/>
		<xsl:output-character character="&#xF0002;" string="--&gt;"/>
		<xsl:output-character character="&#xF0003;" string="&quot;"/>
	</xsl:character-map>

	<xsl:template match="/">
		<a src="&#xF0001; &#xF0003;fff&#xF0003;  &#xF0002; ">d</a>
	</xsl:template>

</xsl:stylesheet>


This generates:


<a src='<!-- "fff" --> '>d</a>

I'd like to preserve the double quotes surrounding the attribute. Is this possible?



From: David Carlisle <davidc@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Embedding an SSI echo in an XML attribute
Date: Wed, 9 May 2007 10:45:29 +0100

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

If you are using plain text ie xsl:output method="text" then you don't
need
<xsl:text disable-output-escaping="yes">
as the text output method never does any escaping anyway.


In XSLT If you want to use the xml output method so you can generate most of the elements as elements then you can do something like

<xsl:output use-character-maps="ssi"/>

  <xsl:character-map name="ssi">
    <xsl:output-character character="&#56192;&#56321;" string="&lt;!--"/>
    <xsl:output-character character="&#56192;&#56322;" string="--&gt;"/>
  </xsl:character-map>


<xsl:template match="jhkhgf">
<a href="&#56192;&#56321;echo var="grar.5.url" encoding="none" "&#56192;&#56322;">link</a>


David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________


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


Current Thread