|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
March 17th, 2010, 03:11 AM
|
Authorized User
|
|
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Getting error XML Parsing Error: junk after document element
Hi,
iam getting below error when i run my xsl in Oracle Appliations
XML Parsing Error: junk after document element
Location: http://rws60169rems.us.oracle.com:80..._id=1536238626
Line Number 2, Column 1:<AA>260</AA>
may i know the reason for this error??
My xsl file.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:apply-templates select=".//ARXEURSL"/>
</xsl:template>
<xsl:template match="ARXEURSL">
<xsl:variable name="t1" as="element(AA)*">
<xsl:for-each-group select="G_ROW[INTRA_EU_TRX_CODE = ('GOODS','TRI')]" group-by="concat(VAT_TAX_NO,BILL_CUST_NAME,INTRA_EU_TRX_CODE)">
<AA><xsl:value-of select="sum(current-group()/ACCTD_AMOUNT)"/></AA><xsl:text>
</xsl:text>
<AB><xsl:value-of select="VAT_TAX_NO"/></AB>
</xsl:for-each-group>
</xsl:variable>
<xsl:for-each-group select="$t1" group-by="(position() - 1) idiv 2">
<xsl:copy-of select="current-group()"/><xsl:text>
</xsl:text>
<BB><xsl:value-of select="sum(current-group()/AA)"/></BB>
</xsl:for-each-group>
</xsl:template>
</xsl:stylesheet>
Thanks
Anil
|
March 17th, 2010, 04:22 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
The error is reporting something wrong with your input XML, not your stylesheet.
|
March 17th, 2010, 04:25 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Actually, it might be complaining about the output XML I suppose.
Are you creating a document root element, or simply outputting a load of XML elements? I can't see a root element being output here.
<root>
<AA>1</AA>
<AB>2</AB>
</root>
The above is a valid XML document.
<AA>1</AA>
<AB>2</AB>
The above isn't a valid XML document (although it is a valid XML fragment, and some XSLT processors will allow that to be output).
|
March 17th, 2010, 05:23 AM
|
Authorized User
|
|
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Hi,
Please find my input XML
But this is generated by oracle Applications
( When i run the report, it generates this xml file and load it to xsl sheet)
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ARXEURSL>
<P_REPORT_TYPE>D</P_REPORT_TYPE><P_TAX_DATE_FROM>2010-03-01 00:00:00.0</P_TAX_DATE_FROM><P_TAX_DATE_TO>2010-03-31 00:00:00.0</P_TAX_DATE_TO><P_TRX_GL_DATE>TRX_DATE</P_TRX_GL_DATE><P_REMIT_TO_ADDRESS_ID>7592</P_REMIT_TO_ADDRESS_ID><P_SITE_USE_CODE>BILL_TO</P_SITE_USE_CODE><P_SHOW_OUT_OF_PERIOD>N</P_SHOW_OUT_OF_PERIOD><P_ROUNDING>X</P_ROUNDING><P_INTRA_EU_GOODS_TRX>GOODS</P_INTRA_EU_GOODS_TRX><P_INTRA_EU_SERVICES_TRX>SERVICES</P_INTRA_EU_SERVICES_TRX><P_INTRA_EU_VAT_TRX_1>TRI</P_INTRA_EU_VAT_TRX_1><P_SET_OF_BOOKS_ID>289</P_SET_OF_BOOKS_ID><P_CHART_OF_ACCOUNTS_ID>51213</P_CHART_OF_ACCOUNTS_ID><P_Custom_Char1>2110-03-16</P_Custom_Char1>
<P_SITE_USE_VALUE>Bill To</P_SITE_USE_VALUE>
<P_SHOW_OUT_OF_VALUE>No</P_SHOW_OUT_OF_VALUE>
<P_ROUNDING_VALUE>No</P_ROUNDING_VALUE>
<G_INTRA_EU_TRX_MEANING>
<INTRA_EU_TRX_MEANING>0</INTRA_EU_TRX_MEANING>
</G_INTRA_EU_TRX_MEANING>
<G_INTRA_EU_TRX_MEANING>
<INTRA_EU_TRX_MEANING>1</INTRA_EU_TRX_MEANING>
</G_INTRA_EU_TRX_MEANING>
<G_INTRA_EU_TRX_MEANING>
<INTRA_EU_TRX_MEANING>5</INTRA_EU_TRX_MEANING>
</G_INTRA_EU_TRX_MEANING>
<G_SOB>
<SOB_NAME>Progress UK</SOB_NAME>
<TRADER_VAT_NO>HU21212121</TRADER_VAT_NO>
<SOB_CURRENCY>GBP</SOB_CURRENCY>
</G_SOB>
<G_REMIT_TO>
<ADDRESS1>TEST ADD FOR XML Testing BE</ADDRESS1>
<ADDRESS2/>
<ADDRESS3/>
<ADDRESS4/>
<CITY/>
<POSTAL_CODE/>
<STATE/>
<COUNTRY/>
</G_REMIT_TO>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>GOODS</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>0</INTRA_EU_TRX>
<BILL_CUST_NAME>ABC</BILL_CUST_NAME>
<TRX_NUMBER>100000098</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>10</AMOUNT>
<ACCTD_AMOUNT>10</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>ABC</CUST_NAME>
<CUST_ADDRESS1>TEST ABC Address</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>GOODS</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>0</INTRA_EU_TRX>
<BILL_CUST_NAME>ABC</BILL_CUST_NAME>
<TRX_NUMBER>100000099</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>20</AMOUNT>
<ACCTD_AMOUNT>20</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>ABC</CUST_NAME>
<CUST_ADDRESS1>TEST ABC Address</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>GOODS</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>0</INTRA_EU_TRX>
<BILL_CUST_NAME>ABC</BILL_CUST_NAME>
<TRX_NUMBER>100000100</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>30</AMOUNT>
<ACCTD_AMOUNT>30</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>ABC</CUST_NAME>
<CUST_ADDRESS1>TEST ABC Address</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>GOODS</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>0</INTRA_EU_TRX>
<BILL_CUST_NAME>TEST DEF</BILL_CUST_NAME>
<TRX_NUMBER>100000101</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>10</AMOUNT>
<ACCTD_AMOUNT>10</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>TEST DEF</CUST_NAME>
<CUST_ADDRESS1>Czech</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>GOODS</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>0</INTRA_EU_TRX>
<BILL_CUST_NAME>TEST GHI</BILL_CUST_NAME>
<TRX_NUMBER>100000102</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>10</AMOUNT>
<ACCTD_AMOUNT>10</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>TEST GHI</CUST_NAME>
<CUST_ADDRESS1>TEST GHI</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>GOODS</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>0</INTRA_EU_TRX>
<BILL_CUST_NAME>JKL</BILL_CUST_NAME>
<TRX_NUMBER>100000103</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>10</AMOUNT>
<ACCTD_AMOUNT>10</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>JKL</CUST_NAME>
<CUST_ADDRESS1>TEST JKL</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>GOODS</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>0</INTRA_EU_TRX>
<BILL_CUST_NAME>BCD</BILL_CUST_NAME>
<TRX_NUMBER>100000104</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>20</AMOUNT>
<ACCTD_AMOUNT>20</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>BCD</CUST_NAME>
<CUST_ADDRESS1>TEST BCD</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>GOODS</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>0</INTRA_EU_TRX>
<BILL_CUST_NAME>CDE</BILL_CUST_NAME>
<TRX_NUMBER>100000112</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>20</AMOUNT>
<ACCTD_AMOUNT>20</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>CDE</CUST_NAME>
<CUST_ADDRESS1>Test CDE</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>GOODS</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>0</INTRA_EU_TRX>
<BILL_CUST_NAME>TEST DEF</BILL_CUST_NAME>
<TRX_NUMBER>100000113</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-16T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-16T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-16T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>250</AMOUNT>
<ACCTD_AMOUNT>250</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>TEST DEF</CUST_NAME>
<CUST_ADDRESS1>Czech</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>SERVICES</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>1</INTRA_EU_TRX>
<BILL_CUST_NAME>CBA</BILL_CUST_NAME>
<TRX_NUMBER>100000108</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>10</AMOUNT>
<ACCTD_AMOUNT>10</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>CBA</CUST_NAME>
<CUST_ADDRESS1>TEST CBA</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>SERVICES</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>1</INTRA_EU_TRX>
<BILL_CUST_NAME>CBA</BILL_CUST_NAME>
<TRX_NUMBER>100000109</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>20</AMOUNT>
<ACCTD_AMOUNT>20</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>CBA</CUST_NAME>
<CUST_ADDRESS1>TEST CBA</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>SERVICES</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>1</INTRA_EU_TRX>
<BILL_CUST_NAME>EDC</BILL_CUST_NAME>
<TRX_NUMBER>100000110</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>30</AMOUNT>
<ACCTD_AMOUNT>30</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>EDC</CUST_NAME>
<CUST_ADDRESS1>TEST EDC</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>TRI</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>5</INTRA_EU_TRX>
<BILL_CUST_NAME>TTT</BILL_CUST_NAME>
<TRX_NUMBER>100000105</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>30</AMOUNT>
<ACCTD_AMOUNT>30</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>TTT</CUST_NAME>
<CUST_ADDRESS1>TEST TTT</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>TRI</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>5</INTRA_EU_TRX>
<BILL_CUST_NAME>TTT</BILL_CUST_NAME>
<TRX_NUMBER>100000106</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>20</AMOUNT>
<ACCTD_AMOUNT>20</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>TTT</CUST_NAME>
<CUST_ADDRESS1>TEST TTT</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
<G_ROW>
<COUNTRY_CODE>CZ</COUNTRY_CODE>
<VAT_MEMBER_STATE_CODE>CZ</VAT_MEMBER_STATE_CODE>
<VAT_TAX_NO/>
<INTRA_EU_TRX_CODE>TRI</INTRA_EU_TRX_CODE>
<INTRA_EU_TRX>5</INTRA_EU_TRX>
<BILL_CUST_NAME>TRT</BILL_CUST_NAME>
<TRX_NUMBER>100000107</TRX_NUMBER>
<TRX_CLASS>Invoice</TRX_CLASS>
<TRX_DATE>2010-03-15T00:00:00.000-08:00</TRX_DATE>
<GL_DATE>2010-03-15T00:00:00.000-08:00</GL_DATE>
<TAX_DATE>2010-03-15T00:00:00.000-08:00</TAX_DATE>
<CURRENCY_CODE>GBP</CURRENCY_CODE>
<AMOUNT>20</AMOUNT>
<ACCTD_AMOUNT>20</ACCTD_AMOUNT>
<APP_TRX_NUMBER/>
<APP_TRX_CLASS/>
<APP_TRX_DATE/>
<APP_TRX_GL_DATE/>
<APP_TRX_TAX_DATE/>
<OUT_OF_PERIOD>N</OUT_OF_PERIOD>
<CUST_NAME>TRT</CUST_NAME>
<CUST_ADDRESS1>TEST TRT</CUST_ADDRESS1>
<CUST_ADDRESS2/>
<CUST_ADDRESS3/>
<CUST_ADDRESS4/>
<CUST_CITY/>
<CUST_POSTAL_CODE/>
<CUST_STATE/>
<CUST_COUNTRY>Czech Republic</CUST_COUNTRY>
</G_ROW>
</ARXEURSL>
You mean with "oracle XSLT processor" i can't see the out put for this xsl file??
Thanks
Anil
|
March 17th, 2010, 05:45 AM
|
|
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
I think the problem is that your output XML isn't well-formed (it has more than one top-level element).
I can't say I'm impressed with Oracle's error message. Referring to your data as "junk" is not very polite. It doesn't say much for the company's procedures if they allow their programmers to put error messages like this into a product.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|
March 17th, 2010, 06:25 AM
|
Friend of Wrox
|
|
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
|
|
While using your code, i could get the error as note below:
Code:
Required item type of value of variable $t1 is element(AA, xs:anyType); supplied value has item type text() at xsl:apply-templates
If you could post the output required from the input xml yo have posted, someone here could help in other way.
__________________
Rummy
|
March 17th, 2010, 06:43 AM
|
Authorized User
|
|
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Hi,
This is my expected out put ..
<AA>60</AA>
<AA>260</AA>
<AA>10</AA>
<BB>330</BB> -- sum of above 3 AA records
<AA>10</AA>
<AA>20</AA>
<AA>20</AA>
<BB>50</BB>
<AA>50</AA>
<AA>20</AA>
<BB>70</BB>
I got the above xsl logic which is working fine in saxon processor ( as told by one of the Guru )
but , when i tried the same xsl in Jdev,
it is giving below out put like...
<AA>60</AA>
<AA>260</AA>
<AA>10</AA>
<AA>10</AA>
<AA>20</AA>
<AA>20</AA>
<AA>50</AA>
<AA>20</AA>
<BB>450</BB> -- sum of all the above AA records
so i tried to run this xsl in oracle applications, and it is giving the error
XML Parsing Error: junk after document element
|
March 17th, 2010, 08:01 AM
|
Friend of Wrox
|
|
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
|
|
From the above it seems that you are not using <AB> and also trying to get the sum of 3 <AA>. Try using the below code without <xsl:text>
</xsl:text> inside variable:
Code:
<xsl:template match="/">
<xsl:apply-templates select=".//ARXEURSL"/>
</xsl:template>
<xsl:template match="ARXEURSL">
<xsl:variable name="t1" as="element(AA)*">
<xsl:for-each-group select="G_ROW[INTRA_EU_TRX_CODE = ('GOODS','TRI')]" group-by="concat(VAT_TAX_NO,BILL_CUST_NAME,INTRA_EU_TRX_CODE)">
<AA><xsl:value-of select="sum(current-group()/ACCTD_AMOUNT)"/></AA>
</xsl:for-each-group>
</xsl:variable>
<xsl:for-each-group select="$t1" group-by="(position() - 1) idiv 3">
<xsl:copy-of select="current-group()"/><xsl:text>
</xsl:text>
<BB><xsl:value-of select="sum(current-group())"/></BB>
</xsl:for-each-group>
</xsl:template>
__________________
Rummy
|
March 17th, 2010, 08:11 AM
|
Authorized User
|
|
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Hi,
when run in Jdev , giving o/p like below..
<AA>60</AA><AA>260</AA><AA>10</AA><AA>10</AA><AA>20</AA><AA>20</AA><AA>50</AA><AA>20</AA>
<BB>6.0260101020205024E16</BB>
same code run in oracle Applications
given below error:
XML Parsing Error: junk after document element
Location: http://rws60169rems.us.oracle.com:80...p_id=301012931
Line Number 2, Column 12:<AA>60</AA><AA>260</AA><AA>10</AA><AA>10</AA><AA>20</AA><AA>20</AA><AA>50</AA><AA>20</AA>
-----------^
|
March 17th, 2010, 08:23 AM
|
Friend of Wrox
|
|
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
|
|
With Michael Kay's idea, try inserting a root element <root> like below, and test whether the same error is shown:
Code:
<xsl:template match="/">
<root>
<xsl:apply-templates select=".//ARXEURSL"/>
</root>
</xsl:template>
<xsl:template match="ARXEURSL">
<xsl:variable name="t1" as="element(AA)*">
<xsl:for-each-group select="G_ROW[INTRA_EU_TRX_CODE = ('GOODS','TRI')]" group-by="concat(VAT_TAX_NO,BILL_CUST_NAME,INTRA_EU_TRX_CODE)">
<AA><xsl:value-of select="sum(current-group()/ACCTD_AMOUNT)"/></AA>
</xsl:for-each-group>
</xsl:variable>
<xsl:for-each-group select="$t1" group-by="(position() - 1) idiv 3">
<xsl:copy-of select="current-group()"/><xsl:text>
</xsl:text>
<BB><xsl:value-of select="sum(current-group())"/></BB>
</xsl:for-each-group>
</xsl:template>
__________________
Rummy
|
|
|