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

Relationships in for-each statement

Subject: Relationships in for-each statement
From: "Bob Portnell" <simply.bobp@xxxxxxxxx>
Date: Thu, 7 Sep 2006 13:21:14 -0700
surname matcher
Last one for the week, I promise. :-)

Here's the data structure

<productionCrew>
   <crew @program= "">
       <member>
           <role> ... </role>
           <givenname> ... </givenname>
           <surname> ... </surname>
           ...
        </member>
   </crew>
   <crew>
   ...
   </crew>
</productionCrew>

I have my test to see if it's finding my target person's name (and
that person is acting) anyplace...

<xsl:if test="//member[(role='Actor') or (role='Guest Star') or
(role='Host')][concat(tv:givenname, ' ', tv:surname) = $matcher]">

Which works fine. Once I know the person is in the data, I go looking
in detail, and my current solution for that is...

<!-- Loop on every crew listed -->
<xsl:for-each select="//member[(role='Actor') or (role='Guest Star')
or (role='Host')][concat(tv:givenname, ' ', tv:surname) = $matcher]" >
       <!-- Get //crew @program and do stuff -->
	<xsl:variable name="progID" select="../@program" />
	<!-- And stuff -->

... which works. But I have similar loops elsewhere where I can
successfully get those two operations combined into a single for-each.
The simplest one is...

<xsl:for-each select="//program[tv:title = $matcher]/@id">

How would I go about getting to where my for-each would be operating
from the @program of (the assorted met conditions)?

Thanks, again, for your patience.

Bob Portnell
simply.bobp@xxxxxxxxx

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.