Altova Mailing List Archives


Re: Creating a batch file or shell script / Inserting line breaks

From: Paul Tchistopolskii <paul@------->
To:
Date: 7/9/2000 9:56:00 AM
> Paul Tchistopolskii wrote:
> > Something is already wrong with Xalan (  or with the bugreport  ), 
> > because bugreport  says that 
> > 
> > >> Funnily enough, if I switch the output method to "html" I get separated lines, 
> > >> but I get an extra blank line before and after every element, which
> > >> causes two blank lines between the elements
> > 
> > That means Xalan's outputHandler for text is very different from 
> > html. This is strange.
> 
> If he said
> 
>  <xsl:output method="html" indent="yes"/>

If he *does not* provide indent="yes".  I was of course 
assuming that there is no 'indent'.
 
> then you're right, this is strange. One would assume that without
> indent="yes", no whitespace should be added, and we already know that the
> non-xsl:text whitespace is stripped from the stylesheet, so the elements
> should run right up against each other.
> 
> Here's something interesting, though.. an oversight in the XSLT spec:
> 
> "If the semantics of an attribute are not described for an output method,
> then it is not applicable to that output method."
> 
> and guess what, the semantics of indent are not described for the html
> output method; only the xml output method. That said, the spec also says:

> "If an XSLT processor outputs the result tree, it should do so as
> specified by the xsl:output element; however, it is not required to do
> so."
> 
> So Xalan, XT, Saxon, etc. are not overstepping any bounds by making up
> their own behavior for particular output methods.

... when indent is specified. If indent is *not* specified there should be 
no difference in outputing 

<xsl:text>
</xsl:text>

by HTML handler or Text handler or XML handler.
 
Rgds.Paul.

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

<xsl:output method="text"/>

<xsl:template match="/">
<xsl:value-of select="'AAA'"/>
<xsl:text>&#10;</xsl:text> <!-- try removing this -->
<xsl:value-of select="'BBB'"/>
</xsl:template>

</xsl:stylesheet>

BTW - if specifying 
<xsl:output method="txt"/>

XT silently  assumes it was 'xml'. ;-)



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.