RE: [xsl] Passing xml nodes to a function

Subject: RE: [xsl] Passing xml nodes to a function
From: "Bansal, Rabinder" <RBansal@xxxxxxxxxxxxxxx>
Date: Thu, 10 Aug 2006 16:15:41 +0100
Hi David

  This is the complete XML. It appears that the output that I am getting is
from this part of the code:

	<table style="position:relative; left:30px;">

    		    <xsl:apply-templates select=".//response/*/response/*"

  I Have tried running it with and without the following part of the code and
appears to make no difference to the output.

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

  So where is it going wrong? it looks like the above code is having no impact
on the output results.

Here is the full xml.

- <getClientDetails_Res xmlns:xsi="";
- <header>
- <source>
- <error>
- <request>
- <response>
- <client>
- <name>
- <teleNumbers>
- <telList>
- <numbers>

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: 10 August 2006 15:48
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Passing xml nodes to a function

   		    <xsl:apply-templates select=".//response/*/response/*"

> What I am getting at the moment is the following:-
your posted xml didn't have response as a grandchild of response so I'll
have to guess that's OK, * selects client and then

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

should put all the data in a table, but i expect that the output you are
seeing is from the default template (ie, it's the same as as the output
from a stylesheet that has no templates). Without seeing what your
input looks like I can't suggest whet match pattern should be on your
initial template.
If the xml posted is the complete xml document, then you want something
<xsl:template match="/response"
    		    <xsl:apply-templates select="*" mode="table"/>


********************** N O T I C E *********************************

This message and any attachments is intended only for the individual or
company to which it is addressed and may contain
information which is privileged, confidential or prohibited from disclosure or
unauthorised use. If the recipient of this
transmission is not the intended recipient, or the employee or agent
responsible for delivering such materials to the
intended recipient, you are hereby notified that any use, any form of
reproduction, dissemination, copying, disclosure,
modification, distribution and/or publication of this e-mail message or its
attachments other than by it's intended
recipient is strictly prohibited by the sender. If you have received it in
error, please notify us immediately by
telephone on the number above and destroy the message and all copies in your

International Financial Data Services (UK) Ltd is authorised and regulated by
the Financial Services Authority.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


Current Thread