XSL LookUp for Identical Value List

P

picander77

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,001
Messages
2,570,251
Members
46,850
Latest member
Brightrs

Latest Threads

Top