Xslt 1 convert non-unique elements to attributes for grid



I have an XML file with this structure





<levels>
<level id="0" qd="NE">
<gate>99</gate>
<zone>2</zone>
<laydown>4</laydown>
</level>
<level id="0" qd="SE">
<gate>1</gate>
<zone>6</zone>
<laydown>1</laydown>
<laydown>2</laydown>
<zone>5</zone>
<laydown>3</laydown>
</level>
</levels>



And I need to convert it to something like this to display in a grid





<level id="0" qd="NE" gate="99" zone="2" laydown="4">
<level id="0" qd="SE" gate="1" zone="6,5" laydown="1,2,3">



The order of the comma separated list is not important for me. I am an xsl/xslt newbie so any annotation will be helpful. I work with VS2013 which I gather only supports XSLT 1. Previously asked in the title for XSLT 2 so thought it best for this to be a separate question.


No comments:

Post a Comment