Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Problem with Saxon breaking up lines in html

Help
2004-09-28
2012-10-08
  • Gregory Pierce
    Gregory Pierce
    2004-09-28

    When trying to transform the following, Saxon is breaking up the lines at a certain number of characters. If you transform the following document you will find that the assignment for javascript variable x gets broken up. Same goes for the generic 'counter string' under the xsl:template match. This goes away when the output method isn't set to html, but it shouldn't be a problem in output method html.

    <?xml version="1.0" encoding="utf-8"?>

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

    <xsl:output method="html" encoding="iso-8859-1" />
    <xsl:template match="/">

    "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"

    <xsl:text disable-output-escaping="yes"><![CDATA[

    <script type="text/javascript" language="JavaScript1.2">
    x = "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
    </script>

    ]]></xsl:text>

    &lt;/xsl:template&gt;
    

    </xsl:stylesheet>

     
    • Michael Kay
      Michael Kay
      2004-09-28

      Which version of Saxon are you using?

      This breaking of lines shouldn't happen in a script section, but you have disguised your script section by writing the <script> tags using disable-output-escaping rather than writing it as a proper element node in the result tree. Why are you doing this?

      If necessary, you can specify indent="no" in xsl:output to suppress this behaviour.

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