[yunqa.de] Re: Extra Content error with very large value

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Fri, 11 Mar 2011 18:12:03 +0100

On 11.03.2011 14:43, Charly Luyet wrote:

> I have a problem with some XML files which have the following structure:
> 
> <root>
> <bigTag>A lot of data here (more than 17'000'000 chars)</bigTag>
> <smallTag>small value</smallTag>
> </root>
> 
> I cannot parse my file, probably because of the amount of characters in
> <bigTag>, I get the error "Extra content at the end of the document in
> file ....". 
>
> Is there a limitation of the amount of data here ?

Yes. When building a tree, the maximum length of a single text node
10000000. This is not a limitation of the parser but a safety boundary
feature.

> Also, I would like to know if it is possible to continue loading the
> rest of the file in this case ?

Yes. Pass the XML_PARSE_HUGE option to xmlReadFile() to override this limit:

  doc := xmlReadFile('Huge.xml', nil, XML_PARSE_HUGE);
                                      ^^^^^^^^^^^^^^

Please note that loading huge documents is always limited by available
memory.

Ralf
_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: