Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 17th, 2010, 04:11 AM
Authorized User
 
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Default 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>&#xD;</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>&#xD;</xsl:text>
    <BB><xsl:value-of select="sum(current-group()/AA)"/></BB>
  </xsl:for-each-group>
</xsl:template>
</xsl:stylesheet>
Thanks
Anil
Reply With Quote
  #2 (permalink)  
Old March 17th, 2010, 05:22 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

The error is reporting something wrong with your input XML, not your stylesheet.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
Reply With Quote
  #3 (permalink)  
Old March 17th, 2010, 05:25 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

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).
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
Reply With Quote
  #4 (permalink)  
Old March 17th, 2010, 06:23 AM
Authorized User
 
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #5 (permalink)  
Old March 17th, 2010, 06:45 AM
mhkay's Avatar
Wrox Author
Points: 18,438, Level: 59
Points: 18,438, Level: 59 Points: 18,438, Level: 59 Points: 18,438, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,954
Thanks: 0
Thanked 290 Times in 285 Posts
Default

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
Reply With Quote
  #6 (permalink)  
Old March 17th, 2010, 07:25 AM
Friend of Wrox
Points: 1,306, Level: 14
Points: 1,306, Level: 14 Points: 1,306, Level: 14 Points: 1,306, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2008
Location: Pondicherry, India
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

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
Reply With Quote
  #7 (permalink)  
Old March 17th, 2010, 07:43 AM
Authorized User
 
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #8 (permalink)  
Old March 17th, 2010, 09:01 AM
Friend of Wrox
Points: 1,306, Level: 14
Points: 1,306, Level: 14 Points: 1,306, Level: 14 Points: 1,306, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2008
Location: Pondicherry, India
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

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>&#xD;</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>&#xD;</xsl:text>
    <BB><xsl:value-of select="sum(current-group())"/></BB>
  </xsl:for-each-group>
</xsl:template>
__________________
Rummy
Reply With Quote
  #9 (permalink)  
Old March 17th, 2010, 09:11 AM
Authorized User
 
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Default

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>
-----------^
Reply With Quote
  #10 (permalink)  
Old March 17th, 2010, 09:23 AM
Friend of Wrox
Points: 1,306, Level: 14
Points: 1,306, Level: 14 Points: 1,306, Level: 14 Points: 1,306, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2008
Location: Pondicherry, India
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

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>&#xD;</xsl:text>
    <BB><xsl:value-of select="sum(current-group())"/></BB>
  </xsl:for-each-group>
</xsl:template>
__________________
Rummy
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2: ToDo Example - Error Parsing XML archergin BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 2 May 2nd, 2009 11:01 AM
Error in php xml parsing... caught PHP How-To 0 April 12th, 2007 04:54 AM
NuSOAP Help : XML error parsing WSDL on line 2 Odys PHP How-To 0 March 16th, 2007 05:11 PM
JSTL XML parsing error pankajbrathi JSP Basics 1 August 29th, 2006 08:35 AM
XML Parsing error: require </META> disaacs XSLT 1 August 6th, 2004 02:58 PM



All times are GMT -4. The time now is 02:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.