Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: need help from xsl guru [Thread Next] Re: need help from xsl guruTo: NULL Date: 11/1/2004 9:58:00 PM > How can we have something like:
>
> p1 1000
> c1 1001
> c2 1002
> p2 2000
> c3 2001
> p3 3000
>
here you go:
<?xml version="1.0" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" indent="yes"/>
<xsl:template match="parents">
<html>
<head>
<style type="text/css">
p {margin:0px}
</style>
</head>
<body>
<xsl:apply-templates mode="2html"/>
</body>
</html>
</xsl:template>
<xsl:template match="*" mode="2html">
<p style="padding-left:{count(ancestor::*)}em"><xsl:value-of select="name"/> <xsl:value-of select="id"/></p>
<xsl:apply-templates select="child" mode="2html"/>
</xsl:template>
</xsl:stylesheet>
regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Ceterum censeo XML omnibus esse utendum
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
