Use XSLT to parse multiple attribute values and output them interleaved



I need to transform something like this:



<IndexField NAME="Field1" VALUE="1;2;3" />
<IndexField NAME="Field2" VALUE="4;5;6" />
<IndexField NAME="Field3" VALUE="7;8;9" />


Into something like this:



<Document>
<Field1>1</Field1>
<Field2>4</Field2>
<Field3>7</Field3>
</Document>
<Document>
<Field1>2</Field1>
<Field2>5</Field2>
<Field3>8</Field3>
</Document>
<Document>
<Field1>3</Field1>
<Field2>6</Field2>
<Field3>9</Field3>
</Document>


This post (Using XSLT 2.0 to parse the values of multiple attributes into an array-like structure) was helpful, but doesn't quite get me all the way there, as interleaving the output makes this much more complex.


Thanks in advance!


No comments:

Post a Comment