I Have a XML that i need to split it by 50 or 100 rows the XML looks like this.
<?xml version = "1.0" encoding = "utf-8" standalone = "yes"?>
<DOCUMENT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<A>
<B>
<C>
<D>
<ROW>
<SNo>1</SNo>
<Date>06/JUN/2014</Date>
<Time>12:31:49</Time>
</ROW>
<ROW>
<SNo>2</SNo>
<Date>07/JUN/2014</Date>
<Time>11:50:42</Time>
</ROW>
</D>
<D>
<ROW>
<SNo>3</SNo>
<Date>08/JUN/2014</Date>
<Time>19:43:09</Time>
</ROW>
<ROW>
<SNo>4</SNo>
<Date>10/JUN/2014</Date>
<Time>08:26:07</Time>
</ROW>
</D>
</C>
</B>
</A>
</DOCUMENT>
I Have tried using the position() mod like below
ROW[ position() mod 50 =1 ]
following-sibling::ROW[ position() < 50 ]
I need a output like below
<?xml version = "1.0" encoding = "utf-8" standalone = "yes"?>
<DOCUMENT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<A>
<B>
<C>
<D>
<ROW>
<SNo>1</SNo>
<Date>06/JUN/2014</Date>
<Time>12:31:49</Time>
</ROW>
<ROW>
<SNo>2</SNo>
<Date>07/JUN/2014</Date>
<Time>11:50:42</Time>
</ROW>
<ROW>
<SNo>3</SNo>
<Date>08/JUN/2014</Date>
<Time>19:43:09</Time>
</ROW>
<ROW>
<SNo>4</SNo>
<Date>10/JUN/2014</Date>
<Time>08:26:07</Time>
</ROW>
.
.
.
.
.
<ROW>
<SNo>50</SNo>
<Date>08/JUN/2014</Date>
<Time>19:43:09</Time>
</ROW>
</D>
<D>
<ROW>
<SNo>1</SNo>
<Date>08/JUN/2014</Date>
<Time>19:43:09</Time>
</ROW>
<ROW>
<SNo>2</SNo>
<Date>10/JUN/2014</Date>
<Time>08:26:07</Time>
</ROW>
.
.
.
.
.
<ROW>
<SNo>50</SNo>
<Date>10/JUN/2014</Date>
<Time>08:26:07</Time>
</ROW>
</D>
</C>
</B>
</A>
</DOCUMENT>
But it does not seem to work. Can anyone have a check on this and help me...
As you use XSLT 2.0, you can simply use for-each-group e.g.