merging 2 xml files using xslt

Hello,

I got two xml files. I have to use a xslt file to merge the two xml files.

My XML files:

verkooporder.xml

<dataroot>

<tbl_V_Verkooporder>

<Bestelnummer>2005000</Bestelnummer>

<Bestelnummerklant>12002</Bestelnummerklant>

<Besteldatum>2006-10-23</Besteldatum>

<Klantnummer>3</Klantnummer>

<Verkocht_x0020_door>2</Verkocht_x0020_door>

</tbl_V_Verkooporder>

</dataroot>

verkooporderregel.xml:

<dataroot>

<tbl_V_Verkooporderregel>

<Bestelnummer>2005000</Bestelnummer>

<Artikelnummer>1</Artikelnummer>

<Aantal_x0020_besteld>12</Aantal_x0020_besteld>

<Aantal_x0020_geleverd>12</Aantal_x0020_geleverd>

</tbl_V_Verkooporderregel>

<tbl_V_Verkooporderregel>

<Bestelnummer>2005000</Bestelnummer>

<Artikelnummer>5</Artikelnummer>

<Aantal_x0020_besteld>16</Aantal_x0020_besteld>

<Aantal_x0020_geleverd>16</Aantal_x0020_geleverd>

</tbl_V_Verkooporderregel>

The xslt I made:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"doctype-system="dtd.dtd"/>

<xsl:strip-space elements="*" />

<xsl:template match="/">

<xsl:text>

</xsl:text>

<xsl:comment>Orders</xsl:comment>

<orderbevestiging>

<xsl:apply-templates select="dataroot/tbl_V_Verkooporder"/>

</orderbevestiging>

</xsl:template>

<xsl:template match="tbl_V_Verkooporder">

<uworder>

<uwordernummer><xsl:value-of select="Bestelnummerklant"/></uwordernummer>

<onsordernummer><xsl:value-of select="Bestelnummer"/></onsordernummer>

<verwachteleverdatum><xsl:value-of select="Besteldatum"/></verwachteleverdatum>

<besteldartikel>

<artikelnummer>

<xsl:value-of select="document('Verkooporderregel.xml')//Artikelnummer"/>

</artikelnummer>

<aantal>

</aantal>

</besteldartikel>

</uworder>

</xsl:template>

</xsl:stylesheet>

</dataroot>

it only shows the articlenumber of the first article in verkooporderregel.xml

I hope you can translate is since it is Dutch

[3129 byte] By [Robertoooa] at [2007-10-3 9:47:56]
# 1
thats not the puropose of xslt... but you could do it using the document() method , check the documentationwhere's your process? if it's in a batch or an ant process, their are far cleaner ways to do that
alban.maillerea at 2007-7-15 5:05:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Thank you for your reply,Im totally new to xsl/xslt can you give me advice or an url?
Robertoooa at 2007-7-15 5:05:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
sure, here are my utlimate resources for xsl : http://www.dpawson.co.uk/xsl/sect2/sect21.html http://www.zvon.org/HTMLonly/XSLTutorial/General/keywordsInOne.html
alban.maillerea at 2007-7-15 5:05:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...