Help with XSL, xsl:for-each ...

wxdqz

New Member
Hi

Below is a sample of an XML file that I have. In every <Entity>, 3 tags always appear exactly once, which are <Name>, <Date> and <Speed>.
The other two tags, <Setting> and <Label> are a pair and they may appear any number of times. For instance, an <Entity> could contain 3 <Setting> and <Label> and another may contain 5.

<Entity>
<Name> a </Name>
<Date> b </Date>
<Speed>
<Setting> c </Setting>
<Label> d </Label>

<Setting> e </Setting>
<Label> f </Label>

<Setting> g </Setting>
<Label> h </Label>

</Speed>
</Entity>

I am trying to produce a XSL for give output something like

Name Date Setting Label
a
b
c
d
a b e f
a b g h

Each time there is a <Setting> and <Label>, a new row gets output with the same <Name>, <Date> but with new <Setting> and <Label>.

Please can someone give me some sample code of a XSL to achieve this.

Many thanks
 
Back
Top