Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent versions of libxml2 won't load large files #127

Open
tverho opened this issue Mar 21, 2024 · 0 comments
Open

Recent versions of libxml2 won't load large files #127

tverho opened this issue Mar 21, 2024 · 0 comments

Comments

@tverho
Copy link

tverho commented Mar 21, 2024

Recently, libxml2 added a safeguard against large xml files, which can be disable with the option XML_PARSE_HUGE. As a consequence LightXML no longer loads large files (in my case, large VTK files with ReadVTK).

A workaround is defining

function LightXML.parse_string(s::AbstractString; huge_tree=true)
    options = 0
    if huge_tree
        options |= 524288
    end
    result = ccall((:xmlReadMemory, LightXML.XML2_jll.libxml2), LightXML.Xptr, (Cstring, Int, Cstring, Cstring, Int), s, sizeof(s), "", Ptr{Nothing}(), options)
    LightXML._check_result(result)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant