This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: displaying a xml via a xsl
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 9 Apr 2002 10:18:57 +0100
- Subject: RE: [xsl] displaying a xml via a xsl
- Reply-to: xsl-list at lists dot mulberrytech dot com
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@ntlworld.com
work: Michael.Kay@softwareag.com
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Sébastien
> Tisserant
> Sent: 08 April 2002 12:46
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] 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