|
Subject: [xsl] joining nodes From: mailinglist@xxxxxxxxx Date: Thu, 16 Feb 2006 16:12:12 +0100 (CET) |
I'm about new to XSLT and would like to ask you for help before I pay
another unsuccessful weekend.
I would like to join nodes. Can you point me to some words of how to
achieve that?
I'll describe the task in two examples. The perfect answer to my question
would be a stylesheet, but a hint can do as well.
Input:
<join1>
<aaa>
<a>
<name>n1</name>
<value1>v11</value1>
</a>
<a>
<name>n2</name>
<value1>v12</value1>
</a>
</aaa>
<bbb>
<a>
<name>n1</name>
<value2>v21</value2>
</a>
<a>
<name>n2</name>
<value2>v22</value2>
</a>
</bbb>
</join1>
should be transformed to the (text) output:
n1
v11
v21
n2
v21
v22
because n1 is associated to v11 and v21 and n2 is associated to v21 and
v22 in <aaa/> and <bbb/> respectively.
<join2>
<aaa>
<ident>id1</ident>
<ident>id3</ident>
</aaa>
<bbb>
<ccc>
<ident>id1</ident>
<subject>sb1</subject>
</ccc>
<ccc>
<ident>id2</ident>
<subject>sb2</subject>
</ccc>
<ccc>
<ident>id3</ident>
<subject>sb3</subject>
</ccc>
</bbb>
</join2>
should be transformed to the (text) output:
id1 sb1
id3 sb3
because id2 is missing in <aaa/>
I tried nested for-each but didn't succeed. I had no clue how to address
this task with template rules.
Thanks in advance
rolf
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Returning an element's po, Cindy Hunt | Thread | Re: [xsl] joining nodes, David Carlisle |
| [xsl] Returning an element's positi, Cindy Hunt | Date | Re: [xsl] Returning an element's po, David Carlisle |
| Month |