|
Subject: Re: [xsl] saxon xmlspy discrepancy in whitespace handling From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Wed, 17 Jan 2007 11:46:44 +0100 |
xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
<xsl:output method="text" version="1.0" encoding="iso-8859-1" />
<xsl:variable name="newline"><xsl:text> </xsl:text></xsl:variable>
This can also be written as follows, but that is a matter of taste: <xsl:variable name="newline"> </xsl:variable> or <xsl:variable name="newline" select=" ' ' " />
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="/"> <xsl:apply-templates select="top/section" /> <xsl:template>
<xsl:template match="//section" >
<xsl:call-template name="section-header" />
</xsl:template>
<xsl:template match="section" > .....
<xsl:template name="section-header" >
<xsl:value-of select="@name"/>
<xsl:value-of select="$newline"/>
</xsl:template>
<xsl:template match="section" > <xsl:value-of select="@name" /> <xsl:value-of select="$newline"/> </xsl:template>
<xsl:template match="section" >
<xsl:call-template name="section-header">
<xsl:with-param select="current()" />
</xsl:call-template>
</xsl:template><xsl:template name="section-header" > <xsl:param name="current-node" /> <xsl:value-of select="$current-node/@name"/> <xsl:value-of select="$newline"/> </xsl:template>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<xsl:apply-templates select="top/section" />
</xsl:template>
<xsl:template match="section" > <xsl:value-of select="@name" /> <xsl:value-of select="$newline"/> </xsl:template>
Cheers, -- Abel Braaksma http://www.nuntia.nl
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] saxon xmlspy discrepancy , George Cristian Bina | Thread | Re: [xsl] saxon xmlspy discrepancy , Colin Adams |
| Re: [xsl] saxon xmlspy discrepancy , George Cristian Bina | Date | [xsl] Applying template with a vari, Harry Liljeström |
| Month |