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

RE: getting the node position in source xml in a varia

Subject: RE: getting the node position in source xml in a variable
From: Gurvinder Singh <GurvinderS@xxxxxxxxxx>
Date: Wed, 27 Feb 2002 16:10:59 +0200
how to display in xsl
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@xxxxxxxxxxxxxxxx]
Sent: Wednesday, February 27, 2002 3:55
To: Gurvinder Singh
Cc: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: Re:  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


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.