Transforming an XML with XSL. Encoding problems

OKI

Usenet Archive
Joined
Feb 19, 2004
Messages
2
Reaction score
0
Hi.

I have this XML and XSL:

SALDO.XML
<?xml-stylesheet type="text/xsl" href="saldo.xsl"
encoding="iso-8859-1" ?>
<Operacion tipo="Saldo Tarjetas" res="ERROR">
<Datos/>
<CodError>2</CodError>
<Descripcion>El número de dígitos de la tarjeta ha de ser 4</Descripcion> </Operacion>

SALDO.XSL
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:eek:utput method="xml" /> <xsl:template match="/"> <CiscoIPPhoneText> <Text> <xsl:choose> <xsl:when test="Datos == ''"> <xsl:value-of select="Descripcion"/> </xsl:when>

<xsl:eek:therwise>
<xsl:value-of select="Datos"/>
</xsl:eek:therwise>
</xsl:choose>
</Text>
</CiscoIPPhoneText>
</xsl:template>
</xsl:stylesheet>

My problem is that when I´ve tried to open SALDO.XML in Internet Explorer, all I have is a parser error in "<Descripcion>El nú"

How can I do for making the transformation? I´ve tried different encoding but I hadn´t have any result

thanks
 

Rolf Magnus

Usenet Archive
Joined
Jun 25, 2003
Messages
3,487
Reaction score
0
OKI said:
Hi.

I have this XML and XSL:

SALDO.XML
<?xml-stylesheet type="text/xsl" href="saldo.xsl"
encoding="iso-8859-1" ?>
<Operacion tipo="Saldo Tarjetas" res="ERROR">
<Datos/>
<CodError>2</CodError>
<Descripcion>El número de dígitos de la tarjeta ha de ser 4</Descripcion> </Operacion>

SALDO.XSL
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:eek:utput method="xml" /> <xsl:template match="/"> <CiscoIPPhoneText> <Text> <xsl:choose> <xsl:when test="Datos == ''"> <xsl:value-of select="Descripcion"/> </xsl:when>

<xsl:eek:therwise>
<xsl:value-of select="Datos"/>
</xsl:eek:therwise>
</xsl:choose>
</Text>
</CiscoIPPhoneText>
</xsl:template>
</xsl:stylesheet>

My problem is that when I?ve tried to open SALDO.XML in Internet Explorer, all I have is a parser error in "<Descripcion>El nú"

You need to put the encoding attribute into an xml declaration:

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="saldo.xsl"?>
<Operacion tipo="Saldo Tarjetas" res="ERROR">
<Datos/>
<CodError>2</CodError>
<Descripcion>El número de dígitos de la tarjeta ha de ser 4</Descripcion> </Operacion>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top