473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Transforming an XML with XSL. Encoding problems

OKI
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:output method="xml" />
<xsl:template match="/">
<CiscoIPPhoneText>
<Text>
<xsl:choose>
<xsl:when test="Datos == ''">
<xsl:value-of select="Descripcion"/>
</xsl:when>

<xsl:otherwise>
<xsl:value-of select="Datos"/>
</xsl:otherwise>
</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
Jul 20 '05 #1
1 4072
OKI wrote:
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:output method="xml" />
<xsl:template match="/">
<CiscoIPPhoneText>
<Text>
<xsl:choose>
<xsl:when test="Datos == ''">
<xsl:value-of select="Descripcion"/>
</xsl:when>

<xsl:otherwise>
<xsl:value-of select="Datos"/>
</xsl:otherwise>
</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>

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matthew Rees-George | last post by:
I want this example xml:- <xxx>text before <yyy att="value"/> text in the middle <zzz>ignored but transformed</zzz> text after</xxx> To be transformed to this:- text before value text in the...
0
by: Tor Hovland | last post by:
I'm trying to transform the document element of incoming xml files, however, I'm having trouble with namespace references not appearing correctly. Here's an example input file: <?xml...
2
by: Mirjana Rakuljic | last post by:
Hi, I need help with transforming XML document. I generate xml document from query using Oracle XSU (DBMS_XMLQUERY) and the document I get is like this: <?xml version = '1.0' encoding =...
0
by: Bernd Fuhrmann | last post by:
Hi! I have two (or more) templates for one certain tag: The first one: tobeimported.xsl: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0"
0
by: OKI | last post by:
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/>
4
by: mikeyjudkins | last post by:
I have an XML file containing localized strings in 9 languages, encoded in Unicode (UTF-8). Im trying to parse this XML document via XSLT (Apache Xalan) to selectively render localized strings...
5
by: Jiho Han | last post by:
I do a transform of an xml document into another xml using XslTransform. In my xsl file, I specify using <xsl:output encoding="utf-8"/>. However, when my transform is done, the resulting xml is in...
1
by: Matthew Baskey | last post by:
Hello, I need to reorder a Typed DataSet in memory using an Xsl Transform. Most of the examples use stream which write to the hard disk or xml file. I want to do this in memory and then write...
0
by: mannem | last post by:
I have a problem in accessing the values while transforming an XML using XSLT BODY { FONT: x-small 'Verdana'; MARGIN-RIGHT: 1.5em } .c { CURSOR: hand } .b { FONT-WEIGHT: bold; COLOR: red;...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.