Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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
 
Old February 22nd, 2010, 08:58 AM
Authorized User
 
Join Date: Dec 2009
Posts: 23
Thanks: 3
Thanked 0 Times in 0 Posts
Default SXXP0003: Error reported by XML parser: Content is not allowed in prolog.

Hi ,

I am using following XSLT to split my xml file to multiple xml file .

Code:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:t="http://www.safersys.org/namespaces/T0020V1" version="2.0">
 <xsl:output method="xml" indent="yes" name="xml" /> 
 <xsl:variable name="accounts" select="t:T0020/t:IRP_ACCOUNT" /> 
 <xsl:variable name="size" select="30" />
 <xsl:template match="/">
  <xsl:for-each select="$accounts[position() mod $size = 1]">
   <xsl:variable name="filename" select="resolve-uri(concat('output/',position(),'.xml'))" /> 
    <xsl:result-document href="{$filename}" method="xml">
     <T0020>
      <xsl:for-each select=". | following-sibling::t:IRP_ACCOUNT[position() &lt; $size]">
         <xsl:copy-of select="." /> 
        </xsl:for-each>      
     </T0020>
    </xsl:result-document>    
  </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>

It works well in Sample Java Apllication,but when i tried to use same in my Spring based application then it gives following error .


Code:
Error on line 1 column 1 of T0020:
  SXXP0003: Error reported by XML parser: Content is not allowed in prolog.
I don't know what goes wrong ? Please help me.
 
Old February 22nd, 2010, 09:31 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

"Content is not allowed in prolog" is a rather unhelpful error message produced by the default XML parser in the Sun JDK when the file you supply to the XML parser does not start with "<", or is malformed in some other simple way. The name of this file is being reported as "T0020".

Can't tell you more about what's wrong with your XML file without seeing it.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old February 24th, 2010, 12:50 AM
Authorized User
 
Join Date: Dec 2009
Posts: 23
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Thanks for the reply it was some problem with XSLT transformation .Now it is resolved and i got to know from your reply that what Prolog means.

Is there any way that we can close this Thread ? As it is solved ?

Last edited by nisargmca; February 24th, 2010 at 12:53 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error - Content is not allowed in prolog. --- SOS nkolli007 XSLT 12 March 19th, 2012 08:58 AM
Saxon-PE 9.2.0.2: Content is not allowed in prolog. ITEpicurean XSLT 1 November 21st, 2009 12:34 AM
XML parser error is not working in ASP bhaskar_joardar Classic ASP XML 0 August 23rd, 2006 01:34 AM
XML File not found error from xerces parser P.J.Kim XML 0 October 19th, 2004 05:39 AM
MSJet.OLEDB.4.0 reported an error in ASP.NET mdrafi Visual Studio 2005 0 September 12th, 2004 11:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.