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

RE: Dynamical work with child nodes

Subject: RE: Dynamical work with child nodes
From: Roland Juergens <roland_juergens@xxxxxxxxxxxx>
Date: Wed, 7 Apr 2004 10:30:18 +0200
roland j rgens
Thanks a lot. That was exactly what I wanted (and it works, too).

-----Original Message-----
From: Mukul Gandhi [mailto:mukulgandhi2003@xxxxxxxxxxx]
Sent: Dienstag, 6. April 2004 17:49
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Dynamical work with child nodes


Hi Roland,
  Something like the following might be ok. The
structure just illustrates the concept.

<xsl:template match="/">
   <xsl:for-each select="root/rowset/row">
     <xsl:for-each select="*">
        <xsl:value-of select="name(.)" /> -
<xsl:value-of select="." />
     </xsl:for-each>
   </xsl:for-each>
</xsl:template>

Regards,
Mukul

 --- Roland Juergens <roland_juergens@xxxxxxxxxxxx>
wrote: > Hi,
> 
> I have an XML file like this which contains results
> from a database query.
> Is there a way to go dynamically through the
> subelements of my "row"
> elements, because I want to use it for different
> queries.
> So the subelements like "id" or "name" might change.
> 
> <root>
> 	<rowset>
> 		<row>
> 			<id>1</id>
> 			<name>bla</name>
> 		</row>
> 		<row>
> 			<id>2</id>
> 			<name>blabla</name>
> 		</row>
> 
> 		...(more <row> elements)...
> 
> 	</rowset>
> </root>
> 
> 
> This is how the xsl-file looks like now
> 
> ...
> <xsl:for-each select="root/rowset/row">
> ...
> 	<xsl:value-of select="id"/>
> ...
> 	<xsl:value-of select="name"/>
> ...
> </xsl:for-each>
> ...
> 
> 
> 
> What I imagine is the following :
> I want to get the number of subelements of a "row"
> element, then iterate
> over it to get the names, and then building it
> dynamical.
> Is something like that possible ?
> 
> 
> Roland Juergens
>  

________________________________________________________________________
Yahoo! India Insurance Special: Be informed on the best policies, services,
tools and more. 
Go to: http://in.insurance.yahoo.com/licspecial/index.html

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.