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

> replaced by ">", < is not replaced...

Subject: > replaced by ">", < is not replaced...
From: Jethro Borsje <jethro@xxxxxxxxxxxx>
Date: Fri, 13 Jul 2007 11:06:49 +0200
 &gt; replaced by ">"
Hi everybody,

I am trying to transform a HTML page using XSL, the problem is that somehow my "&gt;" signs in the input text are changed to ">" while "&lt;" are not changed. This XSL I am using:
[stylesheet]
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


	<xsl:template match="/">
		<html>
			<head>
				<style>
					body
					{
						font-family:'Courier New', Courier, monospace;
						font-size:11px; color:#333333;
						font-weight:normal;
						line-height: 140%;
						text-align:justify;

					}
					span.rule
					{
						font-weight:bold;
					}
					span.issuer, span.target
					{
						font-weight:bold;
						display:inline;
					}
				</style>
			</head>
			<body>
				<xsl:apply-templates />
			</body>
		</html>
	</xsl:template>

	<xsl:template match="br">
		<xsl:element name="br"></xsl:element>
	</xsl:template>

<!-- Copy all <span> tags together with the attributes. -->
<xsl:template match="span">
<xsl:element name="span">
<xsl:attribute name="id"><xsl:value-of select="@id" /></xsl:attribute>

<xsl:if test="@style">
<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>
</xsl:if>

<xsl:if test="@class">
<xsl:attribute name="class"><xsl:value-of select="@class" /></xsl:attribute>
</xsl:if>

<xsl:value-of select="." />
</xsl:element>
</xsl:template>


</xsl:stylesheet>
[/stylesheet]

This is the text that is being parsed:
[parsed text]
<html>
<body>
<span class="target" id="http://www.owl-ontologies.com/Ontology1182253177.owl#WHITBREAD">&lt;WTB.L&gt;</span> said on Monday it was considering the sal
</body>
</html>
[/parsed text]


This is the text after transformation:
[transformed text]
<html>
<head>
<style>
body
{
font-family:'Courier New', Courier, monospace;
font-size:11px; color:#333333;
font-weight:normal;
line-height: 140%;
text-align:justify;
}
span.rule
{
font-weight:bold;
}
span.issuer, span.target
{
font-weight:bold;
display:inline;
}
</style>
</head>
<body>
<span class="target" id="http://www.owl-ontologies.com/Ontology1182253177.owl#WHITBREAD">&lt;WTB.L></span> said on Monday it was considering the sal
</body>
</html>
[/transformed text]


As you can see the "&gt;" is replaced by ">", however the "&lgt;" is NOT replaced by "<". I do not understand how this is possible. The desired result is that they both do NOT get replaced, so both "&gt;" and "&lt;" should appear in the transformed text.

--
Best regards,
Jethro Borsje

http://www.jborsje.nl

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-2011 All Rights Reserved.