|
85 | 85 | #### parse and free
|
86 | 86 |
|
87 | 87 | function parse_file(filename::AbstractString)
|
| 88 | + ccall((:xmlSubstituteEntitiesDefault, libxml2), Cint, (Cint,), 1) |
88 | 89 | p = ccall((:xmlParseFile,libxml2), Xptr, (Cstring,), filename)
|
89 | 90 | p != C_NULL || throw(XMLParseError("Failure in parsing an XML file."))
|
90 | 91 | XMLDocument(p)
|
91 | 92 | end
|
92 | 93 |
|
93 | 94 | function parse_file(filename::AbstractString, encoding, options::Integer)
|
| 95 | + ccall((:xmlSubstituteEntitiesDefault, libxml2), Cint, (Cint,), 1) |
94 | 96 | p = ccall((:xmlReadFile,libxml2), Xptr, (Cstring, Ptr{Cchar}, Cint),
|
95 | 97 | filename, encoding, options)
|
96 | 98 | p != C_NULL || throw(XMLParseError("Failure in parsing an XML file."))
|
97 | 99 | XMLDocument(p)
|
98 | 100 | end
|
99 | 101 |
|
100 | 102 | function parse_string(s::AbstractString)
|
| 103 | + ccall((:xmlSubstituteEntitiesDefault, libxml2), Cint, (Cint,), 1) |
101 | 104 | p = ccall((:xmlParseMemory,libxml2), Xptr, (Xstr, Cint), s, sizeof(s) + 1)
|
102 | 105 | p != C_NULL || throw(XMLParseError("Failure in parsing an XML string."))
|
103 | 106 | XMLDocument(p)
|
|
0 commit comments