Re: Urgent !!! '&' being replaced by '&'

Subject: Re: Urgent !!! '&' being replaced by '&'
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 07 Aug 2000 19:15:16 +0100
Mahesh,

>The code snippet I posted was a right one.
>I indeed need the &apos; . It's part of the title attribute of 
>the card element from WML 1.1.
>Can u please suggest me some work around , so that I get &apos; in the
title attribute?

I can't replicate your problem.  With the following:

---- test.xml ----
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test.xsl" ?>
<XML-MSG>
	<SERVICE-INFO>
		<OUTPUT>
			<Result>
				<headline>Nothing&apos;s wrong!</headline>
			</Result>
		</OUTPUT>
	</SERVICE-INFO>
</XML-MSG>
----

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

<xsl:output method="xml"/>

<xsl:template match="/">
	<xsl:variable name="cardTitle"
select="XML-MSG/SERVICE-INFO/OUTPUT/Result/headline" />
	<card id="News" title="{$cardTitle}" />
</xsl:template>

</xsl:stylesheet>
----

I get the output (using SAXON) of:

---- out.xml ----
<?xml version="1.0" encoding="utf-8"?>
<card id="News" title="Nothing's wrong!"/>
----

The apostrophe in the output will always have exactly the same effect as if
it had been escaped as &apos;, but from what you were saying I don't think
that was your problem.  Certainly, there is no &amp; in the output.

As Mike said, posting the XML source that you're using and a bit more of
the context of the stylesheet might help us give a better clue about what's
going wrong for you.

Cheers,

Jeni

Dr Jeni Tennison
Epistemics Ltd * Strelley Hall * Nottingham * NG8 6PE
tel: 0115 906 1301 * fax: 0115 906 1304 * email: jeni.tennison@xxxxxxxxxxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread