You may be able to achieve the required indentation simply using
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/"><xsl:copy-of select="."/></xsl:template>
If you really want to do the formatting yourself, use an identity template,
and produce the required amount of indentation using something like:
<xsl:for-each select="ancestor::*"><xsl:text> </xsl:text></xsl:for-each>
Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Sébastien
> Tisserant
> Sent: 08 April 2002 12:46
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: displaying a xml via a xsl
>
>
> hello
>
> i have a one-line-displayed xml
>
> and i would like it to displayed in html with indentation and
> and return-to-next-line like this one
>
> <element1 attr1="rir">
> <element2 attr2="fgfg">fdgfdg</element2>
> <element2>fdgfdg</element2>
> <element2>fdgfdg</element2>
> <element3>fdgfdg</element3>
> <element3 attr4="fgdgdg">fdgfdg</element3>
> <element2 attr9="dfssdf">fdgfdg</element2>
> </element1>
>
> could you help me doing this this via XSL ?
> specially how to incremente or decremente the indentation blank
>
> thanks.
>
> Sébastien
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|