Multiple input xml / get data from other xml file
Hi,
I am unable to get the Date value. I have multiple input xml file, i am unable to load other xml inbetween such as
<getdata from file1, getdata from file2, again getdata from file1>
[u]Command:</u> $xalan Input.xml fileXSL.xsl
[u]Actual Output: </u> FORMHDR|1.85|Mr.|????????||
[u]Expected Output:</u> FORMHDR|1.85|Mr.|20080428||
Please find the xml and xsl file as follows,
[u]Input.xml:</u>
<?xml version="1.0" encoding="UTF-8"?>
<Envelope>
<Part File='INV24.2302.xml' LinkType='REL' DocType='INV' Format='XML'/>
<Part File='ADDR24.2302.xml' LinkType='REL' DocType='ADD' Format='XML'/>
</Envelope>
[u]INV24.2302.xml:</u>
<?xml version='1.0' encoding="UTF-8"?>
<Document>
<Invoice>
<Date Type="INV" Date="20080428"/>
<Date Type="START" Date="20060101" />
<Date Type="END" Date="20080427" HH="23" MM="59" SS="59" />
</Invoice>
</Document>
[u]ADDR24.2302.xml:</u>
<?xml version='1.0' encoding="UTF-8"?>
<Document Sender="Eureka Communications" Id="080428BA00000000910" BAId="BA0000000091">
<AddressPage xml:lang="EN">
<BillAcc Desc="Nm_24" PayMeth="1Cash" BillMedium="L1PDF" CopyNo="1" State="">
<Customer Id="1.85" SocSecNo="" DrivLicNo=""/>
<Addr Name="" City="Frankfurt" Zip="96745" Country="Germany" Line1="Mr." Line2="Jim Collins" Line3="" Line4="Herriot Street 1" Line5="96745 Frankfurt" Line6="Germany" SortCrit="0000000000000000000000000000000000000000 " />
</BillAcc>
</AddressPage>
</Document>
[u]fileXSL.xsl:</u>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE stylesheet [
<!ENTITY space "<xsl:text> </xsl:text>">
<!ENTITY tab "<xsl:text>#9;</xsl:text>">
<!ENTITY sep "<xsl:text>|</xsl:text>">
<!ENTITY cr "<xsl:text>
</xsl:text>">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:for-each select="/Envelope/Part">
<xsl:apply-templates select="document(@File)/Document/AddressPage/BillAcc" mode="FORMHDR"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="/Document/AddressPage/BillAcc" mode="FORMHDR">
<xsl:param name="Sheet"/>
<xsl:text>FORMHDR</xsl:text>&sep;
<xsl:value-of select="Customer/@Id"/>&sep;
<xsl:value-of select="Addr/@Line1"/>&sep;
<xsl:value-of select="document(@File)/Document/Invoice/Date[@Type='INV']/[u]@Date</u>"/>&sep;
<xsl:value-of select="Customer/@SocSecNo"/>&sep;
</xsl:template>
</xsl:stylesheet>
|