[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] xsl:output method="xhtml", indent, linefeeds problem


Subject: Re: [xsl] xsl:output method="xhtml", indent, linefeeds problem
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Aug 2013 10:26:59 -0400

At 2013-08-15 16:17 +0200, Raimund Kammering wrote:
An example:

XML
<root>
  ...
  <text></text>

</root>

XSL

...
  <xsl:template match="text">
    <textarea name="text" style="width: 100%" rows="14" cols="100">
        <xsl:value-of select="."/>
    </textarea>
  </xsl:template>


leads to the 'textarea' tag not being closed
properly and therefor the rest of the produced
output appears in the textarea! Adding an
artificial empty space solves this but gives in
this case a predefined space in the textarea, which is not nice!

I had this kind of "bleed" beyond the end of an empty element with coloured text that coloured the text through to the end of the page.

I forced an end tag by adding innocuous comment inside of the element.

Have you tried the following?

    <textarea name="text" style="width: 100%" rows="14" cols="100">
        <xsl:value-of select="."/>
        <xsl:comment/>
    </textarea>

Hopefully the comment will be ignored by the
browser, but the comment will force there to be an end tag.

I hope this helps.

. . . . . . . Ken

--
Public XSLT, XSL-FO, and UBL classes in the Netherlands     Oct 2013 |
Public XSLT, XSL-FO, UBL and code list classes in Australia Oct 2013 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |


Current Thread
Keywords