the following it the input ,I want to merge and sort the elements without using xsl:sort!!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE lists SYSTEM "number.dtd">
<numbers>
<number>
<num val="7"/>
<num val="2"/>
<num val="9"/>
<num val="16"/>
<num val="12"/>
<num val="15"/>
<number/>
<number>
<num val="29"/>
<num val="18"/>
<num val="30"/>
<num val="32"/>
</number>
</numbers>
the out put should be::
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE lists SYSTEM "number.dtd">
<numbers>
<number>
<num val="2"/>
<num val="7"/>
<num val="9"/>
<num val="12"/>
<num val="15"/>
<num val="16"/>
<num val="18"/>
<num val="29"/>
<num val="30"/>
<num val="32"/>
</number>
</numbers>
in the xsl ,please do not use xsl:sort… ∩_∩
Without using xsl:sort, you could do something like the following, but if your numbers are much higher, negative, non-whole, or not actually numbers, then you will either have to adjust things, or it may just not work (I tried bumping up the last value from 32 to 3200 and xsltproc not only required I give a higher –maxdepth value but also took 52x as long!):