Hi Raja,
this thread is going to be an pure XSLT discussion and should be
seperated from the xalan list.
If you would like to order the output in your own way, you can access
directly to the member
<xsl:template match="/">
<xsl:value-of
select="document(/Envelope/[EMAIL
PROTECTED]'ADR']/@File)/Document/AddressPage/BillAcc/Customer/@Id"/>&sep;
<xsl:value-of
select="document(/Envelope/[EMAIL PROTECTED]'INV']/@File)/Document/Invoice/[EMAIL
PROTECTED]'INV']/@Date"/>&sep;
...
</xsl:template>
Regards,
Holger
Sathasivam, Elayaraja schrieb:
One more question Holger !
If I follow as you said, then how I can print the value inbetween another file...
such as < getData from file1, getData from file2, again getData from file1>
You mean to get data again from file 1 I need to call one more template ..........???
please check with line number: 20 as I specified. Please suggest me the good
solution...
<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/Invoice" mode="FORMHDR">
<xsl:apply-templates select="document(@File)/Document/Invoice" mode="FORMHDR"/>
<xsl:value-of select="[EMAIL PROTECTED]'INV']/@Date"/>&sep;
</xsl:template>
<xsl:template match="/Document/AddressPage/BillAcc" mode="FORMHDR">
<xsl:param name="Sheet"/>
<xsl:text>FORMHDR</xsl:text>&sep;
<xsl:value-of select="$Sheet"/>&sep;
<xsl:value-of select="Customer/@Id"/>&sep;
<xsl:value-of select="Customer/@DrivLicNo"/>&sep;
<xsl:value-of select="Addr/@Line1"/>&sep;
<xsl:value-of select="document(@File)/Document/Invoice/[EMAIL
PROTECTED]'INV']/@Date"/>&sep; <!-- Please check here line number - 20.............? >
<xsl:value-of select="Customer/@SocSecNo"/>&sep;
</xsl:template>
Regards,
ElayaRaja
-----Original Message-----
From: Sathasivam, Elayaraja
Sent: Friday, July 25, 2008 2:26 PM
To: 'xalan-dev@xml.apache.org'
Cc: '[EMAIL PROTECTED]'
Subject: RE: XSL1.0 with Xalan-C no output / But output in Xalan-J....?????
If you use Eclipse with Xalan as builtin of Java 1.5.0_12 you will get the output.
I am wondering why it should work with the Xalan which is builtin from Java... ?
1) But if you use explicitly with Xalan-J such as xalan-j$ java
org.apache.xalan.xslt.Process -IN ForumXML.xml -XSL ForumXSL.xsl
Output: | ( No output )
2) If using Xalan-C, again there is not result,
Output: | ( No output )
My requirement is to work with Xalan-C. Thanks for your tips and the
correction. Its working fine...
-----Original Message-----
From: Holger Flörke [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2008 12:37 PM
To: xalan-dev@xml.apache.org
Subject: Re: XSL1.0 with Xalan-C no output / But output in Xalan-J....?????
Hi Raja,
I does not understand the deeper workflow of your stylesheet, but:
"""
<xsl:apply-templates
select="document(/Envelope/Part/@File)/Document/AddressPage/BillAcc"
mode="FORMHDR"/>
"""
You iterate over *every* File in your envelope and process the
"BillAcc"-Element.
"""
<xsl:template match="/Document/AddressPage/BillAcc" mode="FORMHDR">
<xsl:value-of
select="document(/Envelope/Part/@File)/Document/Invoice/[EMAIL
PROTECTED]'INV']/@Date"/>&sep;
</xsl:template>
"""
When you are in your INV-File you are trying to iterate again over your
envelope file???
This is something you can't do (I am wondering why it should work with
Xalan-J), because the root of your document is the root of the
INV-Document. Is it really possible with Xalan-J?
Once you are within your INV-Document, you can't break out to your main
envelope document (hopefully I am right at this point).
Eg you can (it depends on your wanted logic):
"""
<xsl:template name="createAccess">
<xsl:for-each select="/Envelope/Part">
<xsl:apply-templates select="document(@File)/*"
mode="FORMHDR"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="/Document/Invoice/[EMAIL PROTECTED]'INV']" mode="FORMHDR">
<xsl:value-of select="@Date"/>&sep;
</xsl:template>
"""
Iterate over every part, process the elements of your part and write
templates for special structures within your parts.
Holger
Sathasivam, Elayaraja schrieb:
Hi,
I am using Xalan-C with XSL1.0.
Command: $ xalan ForumXML.xml ForumXSL.xsl
Actual Output: | ???????????????????????
Expected Output: 20080428| ( If I run in Xalan-J its working fine, why
not in Xalan-C ????????????? )
XSLT processor: Xalan-C_1_10_0-win32-msvc_60, xerces-c-windows_2000-msvc_60
Find the input xml file and the xsl file,
ForumXML.xml
------------------------
<?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>
ForumXSL.xsl
-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE stylesheet [
<!ENTITY space "<xsl:text> </xsl:text>">
<!ENTITY tab "<xsl:text>	</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:call-template name="createAccess"/>
</xsl:template>
<xsl:template name="createAccess">
<xsl:apply-templates
select="document(/Envelope/Part/@File)/Document/AddressPage/BillAcc"
mode="FORMHDR"/>
</xsl:template>
<xsl:template match="/Document/AddressPage/BillAcc" mode="FORMHDR">
<xsl:value-of
select="document(/Envelope/Part/@File)/Document/Invoice/[EMAIL PROTECTED]'INV']/@Date"/>&sep;
</xsl:template>
</xsl:stylesheet>
INV24.2302.xml
-----------------------
<?xml version='1.0' encoding="UTF-8"?>
<Document>
<Invoice>
<Date Type="INV" Date="20080428"/>
<Date Type="START" Date="20060101" />
</Invoice>
</Document>
ADDR24.2302.xml
------------------------------
<?xml version='1.0' encoding="UTF-8"?>
<Document>
<AddressPage xml:lang="EN">
<BillAcc>
<Customer Id="1.85" SocSecNo="" DrivLicNo=""/>
</BillAcc>
</AddressPage>
</Document>
Regards,
Raja
--
holger floerke d o c t r o n i c
email [EMAIL PROTECTED] information publishing + retrieval
phone +49 228 92 682 00 http://www.doctronic.de
doctronic GmbH & Co. KG, Sitz: Bonn, HRA 4685 AG Bonn
Ust-IdNr.: DE 210 898 186, Komplementaerin:
doctronic Verwaltungsgesellschaft mbH, Sitz: Bonn, HRB 8926 AG Bonn
Geschaeftsfuehrer: Holger Floerke, Carsten Oberscheid, Ingo Kueper
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]