This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Contitional statement
- To: "Earl Spencer" <eapencer74 at hotmail dot com>
- Subject: Re: [xsl] Contitional statement
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Wed, 13 Jun 2001 22:27:59 +0100
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <F46wFutJLtosJ3Ih7jt00008f7f@hotmail.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Earl,
> i want to get an output like this
>
> <ROOT>
> <id idn=1>
> <a> appears only once for one id
> <b> appears only once for one id
> <c>c one</c>
> <c>ctow</c>
> <c>cs</c>
> <c>css</c>
> <id>
Is that supposed to be XML or are you actually after output that looks
exactly like that? I think given your source XML that perhaps that you
want XML that looks like:
<ROOT>
<id idn="1">
<a>texta</a>
<b>textb</b>
<c>c one</c>
<c>ctow</c>
<c>cs</c>
<c>css</c>
</id>
<id idn="2">
<a>texta</a>
<b>textb</b>
<c>c one</c>
<c>ctow</c>
</id>
<id idn="3">
<a>texta</a>
<b>textb</b>
<c>c one</c>
<c>ctow</c>
</id>
</ROOT>
In other words, that you want to group the content of the root2
elements in your source into id elements, according to their ids, and
within the new id elements, you want only the unique values of the
child elements.
In that case, it's a grouping problem, and you might be able to figure
out an answer if you have a look at
http://www.jenitennison.com/xslt/grouping/muenchian.html. If that's
not what you were after, or if you can't figure it out, then please
give the XML that you want generated from the sample XML that you
gave, and describe the mapping in more detail.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list