chenino
chenino

Reputation: 454

Set Program to use LIBXML_PARSEHUGE

I am using the commandline app xmlsec to encrypt and decrypt files. I got an XML File with a node at 40 MB of size. I already found out i need to set

LIBXML_PARSEHUGE

to parse nodes bigger than 10 MB

Does anyone know how to enable this? I searched the source code of xmlsec for the Parser init, but couldn't find a way to integrate the option Do i have to set this inside the source and recompile it? When so, do i have to recompile libxml or xmlsec?

Upvotes: 0

Views: 1248

Answers (2)

Gwi7d31
Gwi7d31

Reputation: 1772

You can also activate the parameter via the simplexml_load_string function itself:

simplexml_load_string($xmlString,'SimpleXMLElement', LIBXML_PARSEHUGE);

Upvotes: 0

chenino
chenino

Reputation: 454

Ok, so i found the solution and post it here just in case anyone needs this sometime In

src/Parser.c 
xmlDocPtr xmlSecParseFile(const char *filename){}

Contains this

/* enable parsing of XML documents with large text nodes */
xmlCtxtUseOptions (ctxt, XML_PARSE_HUGE);

Orinigally, the second line is commented out. You have to uncomment it and recompile the tool

Upvotes: 0

Related Questions