cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conal Tuohy <con...@paradise.net.nz>
Subject RE: Control the formatting of seriazlied xhtml?
Date Sun, 25 Jan 2004 19:41:53 GMT
Hi Steve

Why not use an XSLT to introduce some blank lines, and use regular xml
serialization?

e.g something like:

<xsl:template match="*[not(text())]">
	<xsl:copy>
		<xsl:copy-of select="@*"/>
		<xsl:text>
</xsl:text>
		<xsl:apply-templates/>
		<xsl:text>
</xsl:text>
	</xsl:copy>
</xsl:template>

<xsl:template match="*">
	<xsl:copy>
		<xsl:copy-of select="@*"/>
		<xsl:apply-templates/>
	</xsl:copy>
</xsl:template>

<xsl:template match="a">
	<xsl:copy>
		<xsl:copy-of select="@*"/>
		<xsl:apply-templates/>
	</xsl:copy>
</xsl:template>

That way you can customise the white-space rules for each XHTML type.

Cheers

Con


> -----Original Message-----
> From: Steve Krulewitz [mailto:shooz@mm.st]
> Sent: Monday, 26 January 2004 08:11
> To: users@cocoon.apache.org
> Subject: Re: Control the formatting of seriazlied xhtml?
>
>
> J.Pietschmann wrote:
> > That's no surprise. The XSLT processor strips all whitespace only
> > text nodes from the stylesheet, therefore the space between the
> > "</i18n:text>" tag and "<span" goes away.
>
> The problem I'm trying to solve isn't this, it is the fact
> that when I
> use indenting with the XMLSerializer, the closing tag for the anchor
> element is on a different line than the opening tag.  This
> produces the
> "underline longer than text" artifact on the rendered page.
>
> > Indenting may insert significant whitespace on its own and
> should never
> > be used for producing XHTML.
>
> I'm not after fully indented pages, just something that
> produces legible
> code.  Setting the XMLSerializer to indent does a pretty good job,
> except for the case I described above.
>
> -steve
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


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


Mime
View raw message