471,338 Members | 915 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,338 software developers and data experts.

XSL LookUp for Identical Value List

Hello!

I need to perform the following operation on an XML document: I have a
first element containing a list of team (<Teams>). A name is assigned
to all teams, as well as a list of their members.
In a second element, I have a list of tables, and the people sitting on
those tables. The people sitting on the tables are always teams, but
the team's names are not stored in the element <Table>. Notice that the
names could not always be in the same order.

How can I perform a transformation using xslt/xpath to retrieve the
team's names assigned to the table?
The results should be like:
Table 1: Team Tiger-Lillys
Table 2: Team Brooklyn
Table 3: Team Queens

Here is an XML Sample.

<Lunch>
<Teams>
<Team name="Tiger-Lillys">
<Members>
<Member name="John"/>
<Member name="Mike"/>
<Member name="Joe"/>
<Member name="Mani"/>
</Members>
</Team>
<Team name="Brooklyn">
<Members>
<Member name="David"/>
<Member name="Isaac"/>
<Member name="Daniel"/>
</Members>
</Team>
<Team name="Queens">
<Members>
<Member name="Daniela"/>
<Member name="George"/>
<Member name="Kevin"/>
</Members>
</Team>
</Teams>
<Tables>
<Table number=1>
<Members>
<Member name="John"/>
<Member name="Mike"/>
<Member name="Joe"/>
<Member name="Mani"/>
</Members>
</Table>
<Table number=2>
<Members>
<Member name="David"/>
<Member name="Isaac"/>
<Member name="Daniel"/>
</Members>
</Table>
<Table number=3>
<Members>
<Member name="Daniela"/>
<Member name="George"/>
<Member name="Kevin"/>
</Members>
</Table>
</Tables>
</Lunch>

Aug 16 '05 #1
0 1133

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by John Mudd | last post: by
3 posts views Thread by my-wings | last post: by
1 post views Thread by Paul H | last post: by
1 post views Thread by James | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.