XSLT throwing Illegal HTML character exception

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

XSLT throwing Illegal HTML character exception

Jayarajan, Divya
Hi ,
We have currently upgraded to a product that internally uses Saxon8.9.Earlier version used Saxon 8.4. One of the XSLT files is throwing an exception 'net.sf.saxon.trans.DynamicError: Illegal HTML character: decimal 137 ' with Saxon8.9 but it worked fine with Saxon8.4.
The xml that is being used is:
<ORIGINALMESSAGE>ST[28]RUSROSLH[29]TranType[28]01[29]CallType[28]2[29]CallerPhone[28]495-363 02 90[29]CallerName[28]avis ÷ôÃ&#137;ôýÃ&#128;û Ã&#132;òðÃ&#131;[29]AssetID[28]S1ATM003[29]CallRef[28]ROAV031703[29]ProblemDesc[28]Ã&#132;Ã&#131;÷Ã&#137;ûôóÃ&#132;Ã&#139;òúÃ&#131;ÿüÃ&#129;òÃ&#132;ðÑ&#131; øÃ&#132;ðòúÑ&#131; Ã&#132;òÃ&#139;úÃ&#134;÷Ñ&#137; ôûôÑ&#137; ÷Ã&#137;ôûóþûò[29]Text[28]Additional Problem Description Ã&#131;Ã&#139;Ã&#132;òú ÷Ã&#137;ôÃ&#136;û[29]Priority[28]2[29]StatusBytes[28]D12*000**G0*2*0002000000*2111[29]SE[28]RUSROSLH[29]</ORIGINALMESSAGE>
The XSLT code is :
<xsl:variable name="ORIGINALMESSAGE" select="//ORIGINALMESSAGE"/>
<TRANSACTION_MSG type="CLOB" dir="IN">
        <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
                <xsl:copy-of select="$ORIGINALMESSAGE"/>
        <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</TRANSACTION_MSG>
 
Please let me know what is done wrong here.
Thanks,
Divya
 
 
 
 
 
 
 

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: XSLT throwing Illegal HTML character exception

Marvin Reimer
Just an idea, do not know if it works:

Use this at the beginning of the stylesheet

<xsl:output method="xml" cdata-section-elements="TRANSACTION_MSG"/>

and remove the CDATA xsl:text part.

2011/6/8 Jayarajan, Divya <[hidden email]>
Hi ,
We have currently upgraded to a product that internally uses Saxon8.9.Earlier version used Saxon 8.4. One of the XSLT files is throwing an exception 'net.sf.saxon.trans.DynamicError: Illegal HTML character: decimal 137 ' with Saxon8.9 but it worked fine with Saxon8.4.
The xml that is being used is:
<ORIGINALMESSAGE>ST[28]RUSROSLH[29]TranType[28]01[29]CallType[28]2[29]CallerPhone[28]495-363 02 90[29]CallerName[28]avis ÷ôÃ&#137;ôýÃ&#128;û Ã&#132;òðÃ&#131;[29]AssetID[28]S1ATM003[29]CallRef[28]ROAV031703[29]ProblemDesc[28]Ã&#132;Ã&#131;÷Ã&#137;ûôóÃ&#132;Ã&#139;òúÃ&#131;ÿüÃ&#129;òÃ&#132;ðÑ&#131; øÃ&#132;ðòúÑ&#131; Ã&#132;òÃ&#139;úÃ&#134;÷Ñ&#137; ôûôÑ&#137; ÷Ã&#137;ôûóþûò[29]Text[28]Additional Problem Description Ã&#131;Ã&#139;Ã&#132;òú ÷Ã&#137;ôÃ&#136;û[29]Priority[28]2[29]StatusBytes[28]D12*000**G0*2*0002000000*2111[29]SE[28]RUSROSLH[29]</ORIGINALMESSAGE>
The XSLT code is :
<xsl:variable name="ORIGINALMESSAGE" select="//ORIGINALMESSAGE"/>
<TRANSACTION_MSG type="CLOB" dir="IN">
        <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
                <xsl:copy-of select="$ORIGINALMESSAGE"/>
        <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</TRANSACTION_MSG>
 
Please let me know what is done wrong here.
Thanks,
Divya
 
 
 
 
 
 
 

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: XSLT throwing Illegal HTML character exception

Michael Kay
In reply to this post by Jayarajan, Divya
On 08/06/2011 11:51, Jayarajan, Divya wrote:

Your XML source explicitly includes   &#137;  which as the error message says is not a legal character in HTML. A rather controversal decision in the W3C XSLT 2.0 specification was that the HTML serializer is required to report an error if an attempt is made to output an illegal HTML character; at some time between 8.4 and 8.9, this decision was implemented in Saxon.

The reason for the error, and the reason your code is failing, is that use of a character such as #137 is nearly always a mistaken attempt to use a Windows CP1252 code point in place of a Unicode code point. 137 in CP1252 is a per-mille sign, which is x2030 in Unicode. Numeric character references in XML should always be Unicode code points, not CP1252 code points. Use of a code such as #137 (which has no meaning in Unicode) is therefore almost certainly incorrect, and the intent of disallowing it in HTML serialization is to enable you to discover and correct the error. It's a bit draconian, I know, and I wasn't in favour of this change to the spec, but I don't allow my own views to get in the way when W3C makes a decision on such a point.

(There appears to be a lot of other garbage in this message that probably arises from incorrect character code conversions somewhere in the history of the data.)

Michael Kay
Saxonica


Hi ,
We have currently upgraded to a product that internally uses Saxon8.9.Earlier version used Saxon 8.4. One of the XSLT files is throwing an exception 'net.sf.saxon.trans.DynamicError: Illegal HTML character: decimal 137 ' with Saxon8.9 but it worked fine with Saxon8.4.
The xml that is being used is:
<ORIGINALMESSAGE>ST[28]RUSROSLH[29]TranType[28]01[29]CallType[28]2[29]CallerPhone[28]495-363 02 90[29]CallerName[28]avis ÷ôÃ&#137;ôýÃ&#128;û Ã&#132;òðÃ&#131;[29]AssetID[28]S1ATM003[29]CallRef[28]ROAV031703[29]ProblemDesc[28]Ã&#132;Ã&#131;÷Ã&#137;ûôóÃ&#132;Ã&#139;òúÃ&#131;ÿüÃ&#129;òÃ&#132;ðÑ&#131; øÃ&#132;ðòúÑ&#131; Ã&#132;òÃ&#139;úÃ&#134;÷Ñ&#137; ôûôÑ&#137; ÷Ã&#137;ôûóþûò[29]Text[28]Additional Problem Description Ã&#131;Ã&#139;Ã&#132;òú ÷Ã&#137;ôÃ&#136;û[29]Priority[28]2[29]StatusBytes[28]D12*000**G0*2*0002000000*2111[29]SE[28]RUSROSLH[29]</ORIGINALMESSAGE>
The XSLT code is :
<xsl:variable name="ORIGINALMESSAGE" select="//ORIGINALMESSAGE"/>
<TRANSACTION_MSG type="CLOB" dir="IN">
        <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
                <xsl:copy-of select="$ORIGINALMESSAGE"/>
        <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</TRANSACTION_MSG>
 
Please let me know what is done wrong here.
Thanks,
Divya
 
 
 
 
 
 
 
------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ [hidden email] https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: XSLT throwing Illegal HTML character exception

Jayarajan, Divya
In reply to this post by Marvin Reimer
Thanks Marvin.
The issue got resolved by changing to xsl:output method="xml" which was initially xsl:output method="html".But I still wonder  how it worked with Saxon8.4.
 
Thanks,
Divya
 

From: Marvin Reimer [mailto:[hidden email]]
Sent: Wednesday, June 08, 2011 4:36 PM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] XSLT throwing Illegal HTML character exception

Just an idea, do not know if it works:

Use this at the beginning of the stylesheet

<xsl:output method="xml" cdata-section-elements="TRANSACTION_MSG"/>

and remove the CDATA xsl:text part.

2011/6/8 Jayarajan, Divya <[hidden email]>
Hi ,
We have currently upgraded to a product that internally uses Saxon8.9.Earlier version used Saxon 8.4. One of the XSLT files is throwing an exception 'net.sf.saxon.trans.DynamicError: Illegal HTML character: decimal 137 ' with Saxon8.9 but it worked fine with Saxon8.4.
The xml that is being used is:
<ORIGINALMESSAGE>ST[28]RUSROSLH[29]TranType[28]01[29]CallType[28]2[29]CallerPhone[28]495-363 02 90[29]CallerName[28]avis ÷ôÑ&#137;ôýÑ&#128;û Ñ&#132;òðÑ&#131;[29]AssetID[28]S1ATM003[29]CallRef[28]ROAV031703[29]ProblemDesc[28]Ñ&#132;Ñ&#131;÷Ñ&#137;ûôóÑ&#132;Ñ&#139;òúÑ&#131;ÿüÑ&#129;òÑ&#132;ðÑ&#131; øÑ&#132;ðòúÑ&#131; Ñ&#132;òÑ&#139;úÑ&#134;÷Ñ&#137; ôûôÑ&#137; ÷Ñ&#137;ôûóþûò[29]Text[28]Additional Problem Description Ñ&#131;Ñ&#139;Ñ&#132;òú ÷Ñ&#137;ôÑ&#136;û[29]Priority[28]2[29]StatusBytes[28]D12*000**G0*2*0002000000*2111[29]SE[28]RUSROSLH[29]</ORIGINALMESSAGE>
The XSLT code is :
<xsl:variable name="ORIGINALMESSAGE" select="//ORIGINALMESSAGE"/>
<TRANSACTION_MSG type="CLOB" dir="IN">
        <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
                <xsl:copy-of select="$ORIGINALMESSAGE"/>
        <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</TRANSACTION_MSG>
 
Please let me know what is done wrong here.
Thanks,
Divya
 
 
 
 
 
 
 

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: XSLT throwing Illegal HTML character exception

Michael Kay

The issue got resolved by changing to xsl:output method="xml" which was initially xsl:output method="html".But I still wonder  how it worked with Saxon8.4.

As I explained, this was a change made in Saxon to implement a W3C decision. Saxon 8.4 came out long before the XSLT 2.0 specification was finalized, and there were many changes made to the product as the W3C specification evolved.

Michael Kay
Saxonica

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: XSLT throwing Illegal HTML character exception

Jayarajan, Divya
In reply to this post by Michael Kay
Thanks Mike.
As per what you have suggested, the illegal character has to be removed from XML before transforming it.Am I correct ?
One surprising thing is xsl:output method in my XSLT was "html" initially and when I changed it to "xml" it worked.So does it mean it solved the issue by making such a change ? Or how it behaved when we changed it that way.
 
Thanks,
Divya


From: Michael Kay [mailto:[hidden email]]
Sent: Wednesday, June 08, 2011 4:49 PM
To: [hidden email]
Subject: Re: [saxon] XSLT throwing Illegal HTML character exception

On 08/06/2011 11:51, Jayarajan, Divya wrote:

Your XML source explicitly includes   &#137;  which as the error message says is not a legal character in HTML. A rather controversal decision in the W3C XSLT 2.0 specification was that the HTML serializer is required to report an error if an attempt is made to output an illegal HTML character; at some time between 8.4 and 8.9, this decision was implemented in Saxon.

The reason for the error, and the reason your code is failing, is that use of a character such as #137 is nearly always a mistaken attempt to use a Windows CP1252 code point in place of a Unicode code point. 137 in CP1252 is a per-mille sign, which is x2030 in Unicode. Numeric character references in XML should always be Unicode code points, not CP1252 code points. Use of a code such as #137 (which has no meaning in Unicode) is therefore almost certainly incorrect, and the intent of disallowing it in HTML serialization is to enable you to discover and correct the error. It's a bit draconian, I know, and I wasn't in favour of this change to the spec, but I don't allow my own views to get in the way when W3C makes a decision on such a point.

(There appears to be a lot of other garbage in this message that probably arises from incorrect character code conversions somewhere in the history of the data.)

Michael Kay
Saxonica


Hi ,
We have currently upgraded to a product that internally uses Saxon8.9.Earlier version used Saxon 8.4. One of the XSLT files is throwing an exception 'net.sf.saxon.trans.DynamicError: Illegal HTML character: decimal 137 ' with Saxon8.9 but it worked fine with Saxon8.4.
The xml that is being used is:
<ORIGINALMESSAGE>ST[28]RUSROSLH[29]TranType[28]01[29]CallType[28]2[29]CallerPhone[28]495-363 02 90[29]CallerName[28]avis ÷ôÑ&#137;ôýÑ&#128;û Ñ&#132;òðÑ&#131;[29]AssetID[28]S1ATM003[29]CallRef[28]ROAV031703[29]ProblemDesc[28]Ñ&#132;Ñ&#131;÷Ñ&#137;ûôóÑ&#132;Ñ&#139;òúÑ&#131;ÿüÑ&#129;òÑ&#132;ðÑ&#131; øÑ&#132;ðòúÑ&#131; Ñ&#132;òÑ&#139;úÑ&#134;÷Ñ&#137; ôûôÑ&#137; ÷Ñ&#137;ôûóþûò[29]Text[28]Additional Problem Description Ñ&#131;Ñ&#139;Ñ&#132;òú ÷Ñ&#137;ôÑ&#136;û[29]Priority[28]2[29]StatusBytes[28]D12*000**G0*2*0002000000*2111[29]SE[28]RUSROSLH[29]</ORIGINALMESSAGE>
The XSLT code is :
<xsl:variable name="ORIGINALMESSAGE" select="//ORIGINALMESSAGE"/>
<TRANSACTION_MSG type="CLOB" dir="IN">
        <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
                <xsl:copy-of select="$ORIGINALMESSAGE"/>
        <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</TRANSACTION_MSG>
 
Please let me know what is done wrong here.
Thanks,
Divya
 
 
 
 
 
 
 
------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ [hidden email] https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: XSLT throwing Illegal HTML character exception

Michael Kay
On 08/06/2011 12:39, Jayarajan, Divya wrote:
Thanks Mike.
As per what you have suggested, the illegal character has to be removed from XML before transforming it.Am I correct ?
One surprising thing is xsl:output method in my XSLT was "html" initially and when I changed it to "xml" it worked.So does it mean it solved the issue by making such a change ? Or how it behaved when we changed it that way.
 
XML allows the character #137, HTML does not. As I explained, this rule applies to the HTML serializer. So it is not invoked when you specify xsl:output method="xml". Of course, the character is wrong either way, but HTML will reject it and XML won't.

Michael Kay
Saxonica
Thanks,
Divya


From: Michael Kay [[hidden email]]
Sent: Wednesday, June 08, 2011 4:49 PM
To: [hidden email]
Subject: Re: [saxon] XSLT throwing Illegal HTML character exception

On 08/06/2011 11:51, Jayarajan, Divya wrote:

Your XML source explicitly includes   &#137;  which as the error message says is not a legal character in HTML. A rather controversal decision in the W3C XSLT 2.0 specification was that the HTML serializer is required to report an error if an attempt is made to output an illegal HTML character; at some time between 8.4 and 8.9, this decision was implemented in Saxon.

The reason for the error, and the reason your code is failing, is that use of a character such as #137 is nearly always a mistaken attempt to use a Windows CP1252 code point in place of a Unicode code point. 137 in CP1252 is a per-mille sign, which is x2030 in Unicode. Numeric character references in XML should always be Unicode code points, not CP1252 code points. Use of a code such as #137 (which has no meaning in Unicode) is therefore almost certainly incorrect, and the intent of disallowing it in HTML serialization is to enable you to discover and correct the error. It's a bit draconian, I know, and I wasn't in favour of this change to the spec, but I don't allow my own views to get in the way when W3C makes a decision on such a point.

(There appears to be a lot of other garbage in this message that probably arises from incorrect character code conversions somewhere in the history of the data.)

Michael Kay
Saxonica


Hi ,
We have currently upgraded to a product that internally uses Saxon8.9.Earlier version used Saxon 8.4. One of the XSLT files is throwing an exception 'net.sf.saxon.trans.DynamicError: Illegal HTML character: decimal 137 ' with Saxon8.9 but it worked fine with Saxon8.4.
The xml that is being used is:
<ORIGINALMESSAGE>ST[28]RUSROSLH[29]TranType[28]01[29]CallType[28]2[29]CallerPhone[28]495-363 02 90[29]CallerName[28]avis ÷ôÃ&#137;ôýÃ&#128;û Ã&#132;òðÃ&#131;[29]AssetID[28]S1ATM003[29]CallRef[28]ROAV031703[29]ProblemDesc[28]Ã&#132;Ã&#131;÷Ã&#137;ûôóÃ&#132;Ã&#139;òúÃ&#131;ÿüÃ&#129;òÃ&#132;ðÑ&#131; øÃ&#132;ðòúÑ&#131; Ã&#132;òÃ&#139;úÃ&#134;÷Ñ&#137; ôûôÑ&#137; ÷Ã&#137;ôûóþûò[29]Text[28]Additional Problem Description Ã&#131;Ã&#139;Ã&#132;òú ÷Ã&#137;ôÃ&#136;û[29]Priority[28]2[29]StatusBytes[28]D12*000**G0*2*0002000000*2111[29]SE[28]RUSROSLH[29]</ORIGINALMESSAGE>
The XSLT code is :
<xsl:variable name="ORIGINALMESSAGE" select="//ORIGINALMESSAGE"/>
<TRANSACTION_MSG type="CLOB" dir="IN">
        <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
                <xsl:copy-of select="$ORIGINALMESSAGE"/>
        <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</TRANSACTION_MSG>
 
Please let me know what is done wrong here.
Thanks,
Divya
 
 
 
 
 
 
 
------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ [hidden email] https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ [hidden email] https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: XSLT throwing Illegal HTML character exception

Jayarajan, Divya
Thanks Mike.


From: Michael Kay [mailto:[hidden email]]
Sent: Wednesday, June 08, 2011 6:41 PM
To: [hidden email]
Subject: Re: [saxon] XSLT throwing Illegal HTML character exception

On 08/06/2011 12:39, Jayarajan, Divya wrote:
Thanks Mike.
As per what you have suggested, the illegal character has to be removed from XML before transforming it.Am I correct ?
One surprising thing is xsl:output method in my XSLT was "html" initially and when I changed it to "xml" it worked.So does it mean it solved the issue by making such a change ? Or how it behaved when we changed it that way.
 
XML allows the character #137, HTML does not. As I explained, this rule applies to the HTML serializer. So it is not invoked when you specify xsl:output method="xml". Of course, the character is wrong either way, but HTML will reject it and XML won't.

Michael Kay
Saxonica
Thanks,
Divya


From: Michael Kay [[hidden email]]
Sent: Wednesday, June 08, 2011 4:49 PM
To: [hidden email]
Subject: Re: [saxon] XSLT throwing Illegal HTML character exception

On 08/06/2011 11:51, Jayarajan, Divya wrote:

Your XML source explicitly includes   &#137;  which as the error message says is not a legal character in HTML. A rather controversal decision in the W3C XSLT 2.0 specification was that the HTML serializer is required to report an error if an attempt is made to output an illegal HTML character; at some time between 8.4 and 8.9, this decision was implemented in Saxon.

The reason for the error, and the reason your code is failing, is that use of a character such as #137 is nearly always a mistaken attempt to use a Windows CP1252 code point in place of a Unicode code point. 137 in CP1252 is a per-mille sign, which is x2030 in Unicode. Numeric character references in XML should always be Unicode code points, not CP1252 code points. Use of a code such as #137 (which has no meaning in Unicode) is therefore almost certainly incorrect, and the intent of disallowing it in HTML serialization is to enable you to discover and correct the error. It's a bit draconian, I know, and I wasn't in favour of this change to the spec, but I don't allow my own views to get in the way when W3C makes a decision on such a point.

(There appears to be a lot of other garbage in this message that probably arises from incorrect character code conversions somewhere in the history of the data.)

Michael Kay
Saxonica


Hi ,
We have currently upgraded to a product that internally uses Saxon8.9.Earlier version used Saxon 8.4. One of the XSLT files is throwing an exception 'net.sf.saxon.trans.DynamicError: Illegal HTML character: decimal 137 ' with Saxon8.9 but it worked fine with Saxon8.4.
The xml that is being used is:
<ORIGINALMESSAGE>ST[28]RUSROSLH[29]TranType[28]01[29]CallType[28]2[29]CallerPhone[28]495-363 02 90[29]CallerName[28]avis ÷ôÑ&#137;ôýÑ&#128;û Ñ&#132;òðÑ&#131;[29]AssetID[28]S1ATM003[29]CallRef[28]ROAV031703[29]ProblemDesc[28]Ñ&#132;Ñ&#131;÷Ñ&#137;ûôóÑ&#132;Ñ&#139;òúÑ&#131;ÿüÑ&#129;òÑ&#132;ðÑ&#131; øÑ&#132;ðòúÑ&#131; Ñ&#132;òÑ&#139;úÑ&#134;÷Ñ&#137; ôûôÑ&#137; ÷Ñ&#137;ôûóþûò[29]Text[28]Additional Problem Description Ñ&#131;Ñ&#139;Ñ&#132;òú ÷Ñ&#137;ôÑ&#136;û[29]Priority[28]2[29]StatusBytes[28]D12*000**G0*2*0002000000*2111[29]SE[28]RUSROSLH[29]</ORIGINALMESSAGE>
The XSLT code is :
<xsl:variable name="ORIGINALMESSAGE" select="//ORIGINALMESSAGE"/>
<TRANSACTION_MSG type="CLOB" dir="IN">
        <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
                <xsl:copy-of select="$ORIGINALMESSAGE"/>
        <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</TRANSACTION_MSG>
 
Please let me know what is done wrong here.
Thanks,
Divya
 
 
 
 
 
 
 
------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ [hidden email] https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ [hidden email] https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help