This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: getting the node position in source xml in a variable
- From: Gurvinder Singh <GurvinderS at amdocs dot com>
- To: "'Jeni Tennison'" <jeni at jenitennison dot com>
- Cc: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 27 Feb 2002 16:10:59 +0200
- Subject: RE: [xsl] getting the node position in source xml in a variable
- Reply-to: xsl-list at lists dot mulberrytech dot com
That excatly is the problem...
all the nodes in the $displaynodes are not siblings...
coz i have something like this
<test>
<nodes>
<level2>
<data>3</data>
<display>C</display>
<someotherdata>abc</someotherdata>
</level2>
<level2>
<data>2</data>
<display>B</display>
<someotherdata>abc</someotherdata>
</level2>
<level2>
<data>1</data>
<display>A</display>
<someotherdata>abc</someotherdata>
</level2>
</nodes>
</test>
and i m calling using
<xsl:call-template name="lookup">
<xsl:with-param name="name" select="'test'" />
<xsl:with-param name="datanodes"
select="/test/nodes/level2/data" />
<xsl:with-param name="displaynodes"
select="/test/nodes/level2/display" />
</xsl:call-template>
Thanks & Regards
Gurvinder
Amdocs Limited , Cyprus
-----Original Message-----
From: Jeni Tennison [mailto:jeni@jenitennison.com]
Sent: Wednesday, February 27, 2002 3:55
To: Gurvinder Singh
Cc: 'xsl-list@lists.mulberrytech.com'
Subject: Re: [xsl] getting the node position in source xml in a variable
Hi Gurvinder,
I'm afraid that I can't tell what's going wrong without you supplying
some more information, specifically about how you're calling the
template. I tried using this source XML:
<test>
<datanodes>
<data>3</data>
<data>2</data>
<data>1</data>
</datanodes>
<displaynodes>
<display>C</display>
<display>B</display>
<display>A</display>
</displaynodes>
</test>
With this call to the template:
<xsl:call-template name="lookup">
<xsl:with-param name="name" select="'test'" />
<xsl:with-param name="datanodes"
select="/test/datanodes/data" />
<xsl:with-param name="displaynodes"
select="/test/displaynodes/display" />
</xsl:call-template>
And I got this result:
<select name="test">
<option id="1" value="1">1-A</option>
<option id="2" value="2">2-B</option>
<option id="3" value="3">3-C</option>
</select>
One problem that could be occurring is if the $displaynodes aren't
actually siblings of each other. But without seeing how you're
actually calling the template and what the source of your stylesheet
looks like, I can't tell.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list