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

parameters or ancestor attributes ?!?!?!

Subject: parameters or ancestor attributes ?!?!?!
From: Dan Diodati <dan@xxxxxxxxxxxxx>
Date: Tue, 03 Aug 1999 16:44:52 -0700
dan diodati
I need to use a value of an upper node, but it doesn't seem to work.

I have tried to use ancestor to access upper templates, pass the
section's name attribute through a parameter from
one template to another, and set variables to use in other templates. So
far I have had no luck, the processor
keeps telling me that the variable is not defined, etc. I am using
lotusxsl_1_1_17 to process my xsl.
Here is some of the code I've tried, any suggestions, better ways??

I have some XML code which looks like:

<SECTION name=test1>
   <FIELD><NAME>subtest1</NAME></FIELD>
   <FIELD><NAME>subtest2</NAME></FIELD>
   <FIELD><NAME>subtest3</NAME></FIELD>
</SECTION>

<SECTION name=test2>
   <FIELD><NAME>subtest1</NAME></FIELD>
   <FIELD><NAME>subtest2</NAME></FIELD>
   <FIELD><NAME>subtest3</NAME></FIELD>
</SECTION>


I am trying to get an out put which has the value of the ancestor node.
I want an out put to look like:

test1.subtest1
test1.subtest2
test1.subtest3
test2.subtest1
test2.subtest2
test2.subtest3


XSL code that I tried:

<xsl:template match="SECTION">
<xsl:call-template name="FIELD">
   <xsl:with-param name="x">
     <xsl:value-of select="@name"/>
   </xsl:with-param>
</xsl:call-template>
</xsl:template>

<xsl:template match="FIELD" name="FIELD">
<xsl:param name="x" select="default value"/>
 <xsl:value-of  select="$x"/>             <!--    I have also tried
<xsl:copy-of select="$x"/>  here    -->
  <xsl:text>.</xsl:text>
<xsl:value-of select="NAME"/>
</xsl:template>



begin:vcard 
n:Diodati;Dan
x-mozilla-html:FALSE
org:Nightfire Software
adr:;;;;;;
version:2.1
email;internet:dan@xxxxxxxxxxxxx
title:Software Engineer
fn:Dan Diodati
end:vcard
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.