|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Merge 2 files and sort output
Sascha Slabschi wrote:
I have 2 input files - files with articles in different xml structure - and i want to merge them to one file and sort the output file by the date values.
and the releant XSLT snippet:
<xsl:template match="files">
<xsl:apply-templates select="document(file)/document/article">
<xsl:sort select="date"/>
</xsl:apply-templates>
</xsl:template>The problem is that this wouldn't work because you two files
use different date representations, and neither is amenable
to simple comparision.
If you have control over the input format, use ISO 8601 date
format consistently, for example
<date>20020521</date>
instead of
<date>21-05/2002</date>So far i have made a xsl file where i have set a variable to my file2 and then i run through a for-each for file1 and a for-each for file2. So i get an output file where all articles of file1 are first and then those of file2 are following.
J.Pietschmann XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








