You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by bu...@apache.org on 2002/06/26 13:46:56 UTC

DO NOT REPLY [Bug 10242] New: - Text silently dropped

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10242>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10242

Text silently dropped

           Summary: Text silently dropped
           Product: Cocoon 2
           Version: 2.0.3
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: sitemap components
        AssignedTo: cocoon-dev@xml.apache.org
        ReportedBy: j3322ptm@yahoo.de


I have the following pipeline
      <map:match pattern="test/text.txt">
        <map:generate src="text.xml"/>
        <map:transform src="text.xsl"/>
        <map:serialize type="text"/>
      </map:match>
With some simple XML:
  <?xml version="1.0"?>
  <root>
   test text
  </root>
and XSL, which simply copies text through:
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  </xsl:stylesheet>
The browser gets a zero size result, because the text is dropped while being
transported from the transformer to the serializer.
This happens with Saxon 6.5.2, don't know how this is handled by Xalan.

The workaround is to enclose the transformation result in an element:
  <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
      <text>
        <xsl:apply-templates/>
      </text>
    </xsl:template>
   </xsl:stylesheet>
This problem could be rather confusing when proting text producing
transformations from other environments.
If possible, character() SAX events outside any elements should
generate log entries.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org