XML Parsing Error: junk after document element

Asked By 0 points N/A Posted on -
qa-featured

Hi,

The problem is with the execution of XML code. I think it was ok.

However, I received an error message as the screenshot below.

What does it mean?

Have you any idea?

Please help me to get a solution of this problem.

Thanks in advance.

 

XML Parsing Error: junk after document element

Location: file:///D:/Temp/Broken.xml

Line Number 4, Column 1:

          ——-asdfklajskljfsd—

            ^

SHARE
Best Answer by Edmund Joseph
Answered By 0 points N/A #130625

XML Parsing Error: junk after document element

qa-featured

Maybe it's complaining about the output XML as i suppose. It depends if u are creating a document root element or simply outputting the load of xml elements. I think that your XML output isn't well formed- it can have more than one top-element level.

Best Answer
Best Answer
Answered By 5 points N/A #130626

XML Parsing Error: junk after document element

qa-featured

Hi there user:

The problem here is the amount of your XML which is (could be) not well-formed.

Try to use the below code from this link, http://p2p.wrox.com/xslt/78585-getting-error-xml-parsing-error-junk-after-document-element.html

Also modify to enter a <root> element. 

‘<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>’

I hope this could solve your problem.

Thank you for posting your query here at techyv.com

Best regards,

Answered By 0 points N/A #130627

XML Parsing Error: junk after document element

qa-featured

Well explained my friends. Edmund Joseph, your solution made me see what problem I had. Also thanks for providing me a very helpful link. By visiting your link, I got my perfect solution. Thanks to techyv.com too for giving me the chance to post this problem and as a result now problem has disappear.

Related Questions