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

transform childnodes from second XML file based on nod

Subject: transform childnodes from second XML file based on node name match
From: Kamal Kumar <kamalk@xxxxxxxxxxxx>
Date: Mon, 29 Jan 2001 18:43:09 +0400
kamal kumar
Hello,

I have a requirement to transform a particular XML file ( SETS.XML) and for
certain nodes (set*)  use data from a second file ( CHANNELS.XML)  for the
transformation. I use document() function to load the second file and
retrieve the required nodes. For a typical case ( month of Jan) the
transformation would look like..

<xsl:template name="channels">

	<TR><TD><xsl:value-of select="name"></TD>><TD><xsl:value-of
select="set1"></TD>><TD><xsl:value-of select="set3"></TD><TR>

</xsl:template>

My problem is that the sets vary with month and I need the template above to
change dynamically. I tried passing the node names using with-param but it
returns the value of the node name when it processes the xsl:value-of.  

Is there something I can do within xsl to handle this. The xml files are
given below. Currently I do a two step transformation using asp scripts
replacing the text within the above template as the sets change.


File SETS.XML has the structure given below.
......
<lostsOfinfo></lotsOfinfo>
<month>Jan
   <sets>
	<set1>1<set1>
	<set3>3</set3>
   </sets>
</month>
<month>Feb
  <sets>
	<set1>1<set1>
	<set5>4</set5>
   </sets>
</month>
.....

File CHANNELS.XML is as below
<CHANNELS>
.....
   <CHANNEL>
	<NAME>Movies</NAME>
	<SET1>BraveHeart</SET1>
	<SET2>aaaa</SET2>
	<SET3>bbbbb</SET3>
	<SET4>ccccc</SET4>
   </CHANNEL>
   <CHANNEL>
	<NAME>Sports</NAME>
	<SET1>dddd</SET1>
	<SET2>aaaa</SET2>
	<SET3>bbbbb</SET3>
	<SET4>ccccc</SET4>
   </CHANNEL>
....
</CHANNELS>

thanks
Kamal Kumar

 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.