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

Re: Passing xml nodes to a function

Subject: Re: Passing xml nodes to a function
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 9 Aug 2006 16:19:27 +0100
Re:  Passing xml nodes to a function
I suspect that ypu don't want to use call-template and named templates
at all here, and just use apply-templates which would simplify your code
greatly.

It's not clear what output you want, you suggested code allways makes
table rows tr containing a single td but you showed an indented output

          teleNumbers 
              telList
                  numbers
		teleType	H
		teleNumber	0145454545


what html do you intend here?


It's not clear how your initial selection .//response/*/response/*" fits
with your input document (the sample you showed didn't have a response
element but I'm assuming that what you showed was teh content of a
typical <response> ?


call-template does not change the current node so  as you recurse along
your $children the current node always stays teh same so
<xsl:value-of select="name()"/> will produce the same text  at each
stage,

I think you want something like
   <table>
    <xsl:apply-templates" select=".//response/*/response/*" mode="table"/>
 </table> 

<xsl:template match="*" mode="table">
<tr>
<td><xsl:value-of select="name()"/></td>
<xsl:if test="not(*)"><td><xsl:value-of select="."/></td></xsl:if>
</tr>
</xsl:template>

David

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.