Project

Profile

Help

Unparsed-

Added by Anonymous over 15 years ago

Legacy ID: #6021111 Legacy Poster: Michiel van Praat (chielos24)

I;ve got the following XSLT: <xsl:variable name="encoding" select="'iso-8859-1'"/> <xsl:variable name="src"> <xsl:value-of select="unparsed-text(concat($SrcBaseInput,$FileNameInput), $encoding)"/> </xsl:variable>


Replies (3)

Please register to reply

unparsed-text and encoding - Added by Anonymous over 15 years ago

Legacy ID: #6021152 Legacy Poster: Michiel van Praat (chielos24)

I'm sorry i posted the last thing without making it complete. I've got the following XSLT: <xsl:variable name="encoding" select="'iso-8859-1'"/> <xsl:variable name="src"> <xsl:value-of select="unparsed-text(<filename>, $encoding)"/> </xsl:variable> And i'm trying to read a file with the following content: month,geographic_unit,channel_unit,product_unit,BRAND_UNIT,MFR_S_Q,MFR_S_GV_UNITS,2MFR_S_GV 2007M09,DE,TOTAL,PAD COFFEE MAKERS ,CAFÉ DIRETTO,3,EUR,90 It gives me the following error message: Failed to read input file <filename> (java.nio.charset.MalformedInputException) When i try to remove the character "É" hexcode C9. The file is processed ok. Can anybody help me how to read this file?

RE: Unparsed- - Added by Anonymous over 15 years ago

Legacy ID: #6108404 Legacy Poster: Michiel van Praat (chielos24)

I've solved, at least i found out that i've made a problem. I had 2 unparsed-text statements in my xslt file and i've only changed 1 of them. So that's the reason.

RE: unparsed-text and encoding - Added by Anonymous over 15 years ago

Legacy ID: #6124189 Legacy Poster: Michael Kay (mhkay)

I can't reproduce this problem. The only explanation I can think of is that the input file is not actually in iso-8859-1 encoding. But even that seems a little implausible because I don't see how any file can be malformed under iso-8859-1. Are you reading the file via HTTP? In that case, the encoding in the HTTP header takes precedence over the encoding specified in the stylesheet. You could get this error if the HTTP header specifies the encoding as UTF-8.

    (1-3/3)

    Please register to reply