Subject: Re: [xsl] Generate tab-delimited file From: David Carlisle <davidc@xxxxxxxxx> Date: Thu, 5 Jul 2001 15:58:22 +0100 |
<!-- This will generate row data <xsl:template match="topic/@*"> <xsl:value-of select="." /> <xsl:text>	</xsl:text> </xsl:template> --> That generates nothing. It matches any attribute of topic, but a) <topic> has no attributes and b) even if it did the template would never be applied as you never use <xsl:apply-templates to apply templates to attributes (or even elements) > 1. it just looks for the immediate nodes who are the children of <topic>. The default template rule recursively applies templates so processes the whole tree, you stopped that by <xsl:template match="topic/*"> <xsl:value-of select="name()" /> <xsl:text>	</xsl:text> </xsl:template> which says that for childeren of topic do not use apply-templates, so do not process their children. Probably you want something like <xsl:template match="topic"> <!-- header --> <xsl:for-each select="*"> <xsl:value-of select="name()" /> <xsl:text>	</xsl:text> </xsl:for-each> <xsl:text></xsl:text> <xsl:for-each select="*"> <xsl:value-of select="." /> <xsl:text>	</xsl:text> <xsl:text></xsl:text> </xsl:for-each> </xsl:template> > 2. but if I have something like this I haven't tried to answer that as it is completely under specified, which elements you need to produce headers and which elements you ignore and process children. David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Generate tab-delimited file, Benoit_Aumars | Thread | RE: [xsl] Generate tab-delimited fi, Benoit_Aumars |
[xsl] fo:table-header, ram ragu | Date | RE: [xsl] How to sort a nodeset ref, Kumar . Shailendra |
Month |