You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Sathasivam, Elayaraja" <el...@capgemini.com> on 2008/07/25 08:20:02 UTC
XSL1.0 with Xalan-C no output / But output in Xalan-J....?????
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/Date[@Type='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
Re: XSL1.0 with Xalan-C no output / But output in Xalan-J....?????
Posted by David Bertoni <db...@apache.org>.
Sathasivam, Elayaraja wrote:
> Hi,
>
> I am using Xalan-C with XSL1.0.
>
> Command: $ xalan ForumXML.xml ForumXSL.xsl
>
> Actual Output: | ???????????????????????
The Xalan-J command line processor produces the exact same output as
Xalan-C.
Please post future questions like this on the Xalan-C User list.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
RE: XSL1.0 with Xalan-C no output / But output in Xalan-J....?????
Posted by "Sathasivam, Elayaraja" <el...@capgemini.com>.
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:floerke@doctronic.de]
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/Date[@Type='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/Date[@Type='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/Date[@Type='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 floerke@doctronic.de 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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
Re: XSL1.0 with Xalan-C no output / But output in Xalan-J....?????
Posted by Holger Flörke <fl...@doctronic.de>.
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/Date[@Type='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/Date[@Type='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/Date[@Type='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 floerke@doctronic.de 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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org