[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Generate tab-delimited file

Subject: Re: Generate tab-delimited file
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 5 Jul 2001 15:58:22 +0100
x10
<!-- This will generate row data
<xsl:template match="topic/@*">
	<xsl:value-of select="." />
	<xsl:text>&#x9;</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>&#x9;</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>&#x9;</xsl:text>
</xsl:for-each>
<xsl:text>&#x10;</xsl:text>
<xsl:for-each select="*">
 <xsl:value-of select="." />
 <xsl:text>&#x9;</xsl:text>
<xsl:text>&#x10;</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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.