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

Recursion (I think)

Subject: Recursion (I think)
From: Nicholas Orr <nick@xxxxxxxxxxx>
Date: Mon, 26 Sep 2005 09:04:13 +1000
nicholas orr
I'm very new to XSL and learning by doing, so thanks in advance for responding. I've got some xml which has come out of a filemaker database where you can have a layoutobject that contains either field objects or other layoutobjects in a recursive style list :

<FMPReport link="Summary.xml" type="Report" creationDate="25/09/2005" creationTime="9:28:42 PM">
<File name="DDR Sample.fp7" path="/Volumes/BIGHD/Projects/DDR">
<LayoutCatalog>
<Layout id="2" name="Layout #2" includeInMenu="True">
<Object type="GroupButton" flags="0" portal="-1" rotation="0">
<GroupButtonObj numOfObjs="14">
<Object type="GroupButton" flags="0" portal="-1" rotation="0">
<GroupButtonObj numOfObjs="6">
<Object type="Field" flags="0" portal="-1" rotation="0">
</Object>
</GroupButtonObj>
</Object>
</GroupButtonObj>
</Object>
<Object type="GroupButton" flags="0" portal="-1" rotation="0">
<GroupButtonObj numOfObjs="6">
<Object type="Field" flags="0" portal="-1" rotation="0">
</Object>
</GroupButtonObj>
</Object>
<Object type="Field" flags="0" portal="-1" rotation="0">
</Object>
</Layout>
</LayoutCatalog>
</File>
</FMPReport>


I'm trying to run a for-each loop on all of the field objects that does :

<xsl:value-of select="./@type"/>

and I can do this fine for any field object at the lowest point in the tree by referring to it explicity:

/FMPReport/File/LayoutCatalog/Layout/Object[@type='Field']

which means I can also then reference the parent "Layout" node using :

<xsl:value-of select="../../@id"/>

the problem I have is how do I reference every possible Object [@type='Field'] in the tree and still be able to reference the parent Layout node?

Thanks,
Nick

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.