Friday, 9 January 2015

XSLT transformation with loop in XML node



So my XML follows...



<Classes_Per_Term>
<Course>ENC1101</Course>
<Ref_Code>111111</Ref_Code>
<Days_of_Week>M</Days_of_Week>
</Classes_Per_Term>
<Classes_Per_Term>
<Course>ENC1101</Course>
<Ref_Code>111222</Ref_Code>
<Days_of_Week>M W F</Days_of_Week>
</Classes_Per_Term>


I need output to look like this


ENC1101 111111 M

ENC1101 111222 M

ENC1101 111222 W

ENC1101 111222 F


I am calling the course and Ref with a value-of call and using an insert line call to hop to the next row. I am unsure how to set a loop inside the Days of Week node. There are all sorts of Day combinations - I need a row for each day a specific reference meets.


Any help is appreciated. Thanks!


No comments:

Post a Comment