XSL output and/or encoding question..

B

Beowulf

Hi,

I have an XML file generated by a third party (and therefore
unchangable) program.

1st line in it is <?xml version="1.0" encoding="us-ascii"?> and down
in the depths of the xml I have a element
<FirstName>Françoise</FirstName>

I have an xsl file I've created to attempt to export this xml to CSV.
It starts

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:eek:utput method="text" version="1.0"/>
<xsl:preserve-space elements="*"/>


I'm using Instant Saxon to parse my XML and export to CSV. If I open
the CSV file in excel I get the above element displayed as

Françoise

if open the file in notepad (windows 2000) I see the entry as
Françoise

Which is the desired output I need. Currently I have to open up the
csv file in word (as a UTF-8) then save as plain text.. THEN I can
open it in excel and get the correct formatting.

I'm sure I've missed soemthing. I have read about encoding and output
and am now totally confused. Can my make my csv file contain the
correct data in one step without having to resort to resaving it in
word?

Thanks for any and all assistance
 
M

Martin Honnen

Beowulf said:
I have an XML file generated by a third party (and therefore
unchangable) program.

1st line in it is <?xml version="1.0" encoding="us-ascii"?> and down
in the depths of the xml I have a element
<FirstName>Françoise</FirstName>

I have an xsl file I've created to attempt to export this xml to CSV.
It starts

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:eek:utput method="text" version="1.0"/>
<xsl:preserve-space elements="*"/>


I'm using Instant Saxon to parse my XML and export to CSV. If I open
the CSV file in excel I get the above element displayed as

Françoise

if open the file in notepad (windows 2000) I see the entry as
Françoise

Which is the desired output I need. Currently I have to open up the
csv file in word (as a UTF-8) then save as plain text.. THEN I can
open it in excel and get the correct formatting.

I'm sure I've missed soemthing. I have read about encoding and output
and am now totally confused. Can my make my csv file contain the
correct data in one step without having to resort to resaving it in
word?

I don't know which encodings Excel can deal with but of course XSLT
allows you to specify an output encoding with
<xsl:eek:utput encoding="..."
so try
<xsl:eek:utput encoding="iso-8859-1"
and maybe Excel is happy with that output.
 
F

FC

Beowulf said:
Hi,

I have an XML file generated by a third party (and therefore
unchangable) program.

1st line in it is <?xml version="1.0" encoding="us-ascii"?> and down
in the depths of the xml I have a element
<FirstName>Françoise</FirstName>

I have an xsl file I've created to attempt to export this xml to CSV.
It starts

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:eek:utput method="text" version="1.0"/>
<xsl:preserve-space elements="*"/>


I'm using Instant Saxon to parse my XML and export to CSV. If I open
the CSV file in excel I get the above element displayed as

Françoise

if open the file in notepad (windows 2000) I see the entry as
Françoise

Which is the desired output I need. Currently I have to open up the
csv file in word (as a UTF-8) then save as plain text.. THEN I can
open it in excel and get the correct formatting.

I'm sure I've missed soemthing. I have read about encoding and output
and am now totally confused. Can my make my csv file contain the
correct data in one step without having to resort to resaving it in
word?

Thanks for any and all assistance


I think you need to add

encoding="iso-8859-1"

or something alike that suits your needs in the <output> element of your
transformation.

Bye,
Flavio
 
B

Beowulf

I think you need to add
encoding="iso-8859-1"

or something alike that suits your needs in the <output> element of your
transformation.

Bye,
Flavio


Guys! Thanks.. that's solved my problem. Superb ! Thanks to both of you!
 

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
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top