FabricioItaly
Technical User
Hi everybody
Hope someone can help me.
I have to sort the output for this xml file
this xml is built run-time, so the numbers of the documents and the tags can be different.
I made a simple xsl:
which make this output.
but I want my output is:
- documents with more occurences tag=1 printed in the middle of the page
-documents with more occurences tag=0 printed in the top and in the bottom of the page
-documente with all tag=0 not printed
someone can help me??
Thanks
Hope someone can help me.
I have to sort the output for this xml file
Code:
<?xml version='1.0' encoding='ISO-8859-1' standalone='no' ?>
<ricerca>
<documento dnome='doc1'>
<tag tname='t1'>
<match>1</match>
</tag>
<tag tname='t2'>
<match>1</match>
</tag>
<tag tname='t3'>
<match>1</match>
</tag>
</documento>
<documento dnome='doc2'>
<tag tname='t1'>
<match>0</match>
</tag>
<tag tname='t2'>
<match>1</match>
</tag>
<tag tname='t3'>
<match>0</match>
</tag>
</documento>
<documento dnome='doc3'>
<tag tname='t1'>
<match>1</match>
</tag>
<tag tname='t2'>
<match>0</match>
</tag>
<tag tname='t3'>
<match>1</match>
</tag>
</documento>
<documento dnome='doc4'>
<tag tname='t1'>
<match>0</match>
</tag>
<tag tname='t2'>
<match>0</match>
</tag>
<tag tname='t3'>
<match>0</match>
</tag>
</documento>
<documento dnome='doc5'>
<tag tname='t1'>
<match>1</match>
</tag>
<tag tname='t2'>
<match>1</match>
</tag>
<tag tname='t3'>
<match>0</match>
</tag>
</documento>
<documento dnome='doc6'>
<tag tname='t1'>
<match>0</match>
</tag>
<tag tname='t2'>
<match>0</match>
</tag>
<tag tname='t3'>
<match>1</match>
</tag>
</documento>
<documento dnome='doc7'>
<tag tname='t1'>
<match>1</match>
</tag>
<tag tname='t2'>
<match>1</match>
</tag>
<tag tname='t3'>
<match>1</match>
</tag>
</documento>
</ricerca>
I made a simple xsl:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="ricerca/documento"/>
</body>
</html>
</xsl:template>
<xsl:template match="documento">
<h1>
<xsl:value-of select="."/>
<xsl:value-of select="@dnome"/>
</h1>
</xsl:template>
</xsl:stylesheet>
which make this output.
Code:
1 1 1 doc1
0 1 0 doc2
1 0 1 doc3
0 0 0 doc4
1 1 0 doc5
0 0 1 doc6
1 1 1 doc7
but I want my output is:
Code:
0 1 0 doc2
1 1 0 doc5
1 1 1 doc1
1 1 1 doc7
1 0 1 doc3
0 0 1 doc6
-documents with more occurences tag=0 printed in the top and in the bottom of the page
-documente with all tag=0 not printed
someone can help me??
Thanks