character maps and html output script element

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

character maps and html output script element

David Carlisle

using saxon B 8.6.1, I get null bytes seeping out if I use character
maps in combination with the script element in html output.


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

<xsl:output method = "html" indent="no" use-character-maps="eol"/>

<xsl:character-map name="eol">
  <xsl:output-character character="&#10;" string="&#13;&#10;"/>
</xsl:character-map>

<xsl:template name="main">
<html>
<head>
<script>
1
2
3
</script>

<title>
1
2
3
</title>
</head>
<body/>
</html>
</xsl:template>


</xsl:stylesheet>





 saxon8 -it main -o  script.html script.xsl

produces



<html><head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"><script>^@^M
^@1^@^M
^@2^@^M
^@3^@^M
^@</script><title>^M
1^M
2^M
3^M
</title></head><body></body></html>

Where ^M is #13 (which is what I wanted) and ^@  is #0 which isn't :-)
I changed them to ^M and ^@  to make sure they get through mail OK.
Note that things work fine in <title> but fail in <script> presumably
interaction with script's CDATA handling in html mode?

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: character maps and html output script element

Michael Kay
 

Thanks, this is now fixed. See bug

https://sourceforge.net/tracker/index.php?func=detail&aid=1387986&group_id=2
9872&atid=397617

Michael Kay
http://www.saxonica.com/



> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> David Carlisle
> Sent: 21 December 2005 17:21
> To: [hidden email]
> Subject: [Norton AntiSpam] [saxon] character maps and html
> output script element
>
>
> using saxon B 8.6.1, I get null bytes seeping out if I use character
> maps in combination with the script element in html output.
>
>
> <xsl:stylesheet version="2.0"
>               xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:output method = "html" indent="no" use-character-maps="eol"/>
>
> <xsl:character-map name="eol">
>   <xsl:output-character character="&#10;" string="&#13;&#10;"/>
> </xsl:character-map>
>
> <xsl:template name="main">
> <html>
> <head>
> <script>
> 1
> 2
> 3
> </script>
>
> <title>
> 1
> 2
> 3
> </title>
> </head>
> <body/>
> </html>
> </xsl:template>
>
>
> </xsl:stylesheet>
>
>
>
>
>
>  saxon8 -it main -o  script.html script.xsl
>
> produces
>
>
>
> <html><head><meta http-equiv="Content-Type" content="text/html;
> charset=UTF-8"><script>^@^M
> ^@1^@^M
> ^@2^@^M
> ^@3^@^M
> ^@</script><title>^M
> 1^M
> 2^M
> 3^M
> </title></head><body></body></html>
>
> Where ^M is #13 (which is what I wanted) and ^@  is #0 which isn't :-)
> I changed them to ^M and ^@  to make sure they get through mail OK.
> Note that things work fine in <title> but fail in <script> presumably
> interaction with script's CDATA handling in html mode?
>
> David
>
>
> ______________________________________________________________
> __________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ______________________________________________________________
> __________
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep
> through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  
> DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: character maps and html output script element

David Carlisle

thanks

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help