将程序设置为使用LIBXML_PARSEHUGE [英] Set Program to use LIBXML_PARSEHUGE

查看:41
本文介绍了将程序设置为使用LIBXML_PARSEHUGE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用命令行应用程序xmlsec加密和解密文件.我得到一个XML文件,其节点大小为40 MB.我已经发现我需要设置

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

解析大于10 MB的节点

to parse nodes bigger than 10 MB

有人知道如何启用吗?我在xmlsec的源代码中搜索了Parser的初始化,但是找不到集成该选项的方法我是否必须在源代码中设置它并重新编译它?如果是这样,我是否必须重新编译libxml或xmlsec?

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?

推荐答案

好,所以我找到了解决方案并将其发布在这里,以防万一有人需要在

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){}

包含此

/* 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

这篇关于将程序设置为使用LIBXML_PARSEHUGE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆