1,525 questions
2
votes
2
answers
113
views
Perl XML::LibXML and Storable equals segfault?
When using the perl library Storable to store and retrieve XML::LibXML document objects, I get a segmentation fault. Specifically, once I use the LibXML routine findnodes. My question is: why, and is ...
0
votes
1
answer
47
views
libxml2 throws SIGFPE in debian 13
Consider this code:
// g++ xml.cpp -I /usr/include/libxml2 -lxml2
#include <libxml/xmlschemas.h>
#include <fenv.h>
int main() {
feenableexcept(FE_DIVBYZERO);
xmlParserCtxtPtr ctx ...
0
votes
1
answer
101
views
/usr/local/bin/xmllint: undefined symbol: xmlMemSize when compiling webkitgtk-2.46.3
During compilation of the latest stable release webkitgtk-2.46.3 I'm getting this error:
raphy@raohy:~/Downloads/webkitgtk-2.46.3$ cmake --build builddir/
[ 92%] Built target ...
0
votes
0
answers
15
views
Does xmlSchemaValidateDoc ignores begin and end position anchors on regex? [duplicate]
I have an .xsd file that has an element wich needs to conform to the following regex: ^[0-9]{1,9}$
According to ChatGPT and Copilot, this regex means that the value must have between one and nine ...
0
votes
0
answers
63
views
Older versions of lxml and pandas on WIndows 10 in 2024
I've recently ran into an issue where I have to install an older (4.6.2) version of lxml to use an older version of pandas, however, when installing via pip install lxml==4.6.2, the wheel simply won't ...
0
votes
1
answer
69
views
Is redefinition of attribute values in extension allowed?
Does the official specification of XSD allow to re-define attribute values (with default/fixed) in derived types with <extension>?
Both MSXML and Xerces-C allow this, but not libxml2 (does not ...
2
votes
3
answers
2k
views
XML::LibXML not installing on ubuntu 22.04
I'm having trouble installing XML::LibXML with cpan on ubuntu 22.04.
I have installed libxml2 and zlib1g. And CPAN reports that it sees libxml2:
# Compiled against libxml2 version: 21303
# Running ...
0
votes
1
answer
109
views
Invalid XSD schema using libxmljs with NodeJS with flattened XSD
I want to validate an XML document against an XSD schema. I'm using libxmljs 0.33 with NodeJS 18.
I keep receiving this error:
Error: Invalid XSD schema
at createPDF (/root/workspace/app/apps/...
1
vote
1
answer
97
views
How to construct XML node from string with namespace?
I am trying to create a xmlNode from an XML string with xmlParseBalancedChunkMemory but when the XML string containing a prefix/namespace in it, libxml2 would throw error 201 (...
0
votes
2
answers
173
views
How to register default NS in libxml2 for C++?
Question: What is the correct way to register the default NS for XPath context?
I've gone through numerous posts (mostly non-C++ and Google search) about registering NS, but I cannot find anything for ...
0
votes
1
answer
131
views
libxml2 not pretty print if xml contains whitespaces?
I have the following sample XML. if I feed it to libxml2 without any formatting or whitespace in between, then it would pretty-print fine when calling xmlNodeDump() with 1:
const char *xml= "<...
1
vote
1
answer
4k
views
I encounter the error xmlsec.InternalError: (-1, 'lxml & xmlsec libxml2 library version mismatch')
When I run sentry devserver --workers on my computer, I encounter the error:
xmlsec.InternalError: (-1, 'lxml & xmlsec libxml2 library version
mismatch')
My computer is running MacOS m3 pro, ...
0
votes
0
answers
35
views
libxml2 How to keep tag and property's letter case In Parse
My libxml2 Version is 2.9.10
I tried to parse the HTML and find the SVG from it, and save it in file.
The work went smoothly.
However,I found the saved svg can't not render in browser.
I compared the ...
1
vote
0
answers
1k
views
libxml2 and libxslt development packages issue in Redhat Linux
I am trying to install python module shareplum on python3.8 and My machine is RHEL 6.10 , but getting below error while using command:
pip3.8 install shareplum
× Getting requirements to build wheel ...
0
votes
1
answer
246
views
Building libxml2 without root privilages
I am trying to build libxml2 on a high performance cluster where I don't have root privileges.
I do this with (first loading possible dependencies as instructed by someone who managed to install ...
1
vote
0
answers
124
views
XML schema validation by using libxml2 SAX interface
Can the libxml2 SAX interface do schema validation against the whole XML contents? Currently, I have a completed xsd loaded into the memory. Based on my knowledge, libxml2 SAX interface is a stream-...
1
vote
1
answer
361
views
Errors linking statically the libxml2
Trying to build statically an application using libxml2 I have errors like
undefined reference to `__imp_xmlTextReaderRead'
Removing the -static option it works perfectly.
The command I used is:
gcc -...
3
votes
1
answer
1k
views
What are the differences between libxmljs and libxmljs2 for node.js? How to choose?
What are the current differences or improvements of libxmljs2 vs libxmljs?
Which one to choose for a new node.js project?
libxmljs seems active again as of today, so the reason of the libxmljs2 fork ...
0
votes
1
answer
115
views
Kotlin/Native Cinterop With libxml2 - Corrupted XPath Expression
Versions
Kotlin 1.9.22
libxml 2.9.14+dfsg-1.3
OS: Ubuntu 23.10
The Problem
In a small Kotlin/Native application I use cinterop with libxml2 to evaluate a set of XPath expressions to extract element ...
0
votes
0
answers
319
views
Setting root element from the same XML doc results in memory leak
I have an XML as follows:
xmlChar *xml_in:
<rpc-reply xmlns:abc="http://xml.myorg.net/">
<a myorg:style="abc-myorg">
<b>Enabled</b>
<c>1</c>
<...
1
vote
1
answer
164
views
Memory leak due to continuous opening and closing of XML File
I am calling this code snippet inside a thread. But I'm getting memory leak.Is it due to continuous opening and closing of the File?If so, how can i solve this issue?
if(g_readFromDataFile == TRUE)
{ ...
0
votes
1
answer
241
views
How to compile libxml2 without two level folder libxml2/libxml in include
I am compiling libxml2 with the next setup:
function libxml() {
wget -O - https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.5.tar.xz | tar --strip-components 1 -xJ
./configure ...
0
votes
1
answer
388
views
Use FP exception traps (-ffpe-trap/-fpe0) for code linked against SIGFPE-unsafe library (libxml2)
I have Fortran code, for which I would like to enable trapping of floating-point exceptions (as recommended by the compiler man pages). But when I do so, the binary will no longer run in a Slurm queue....
0
votes
1
answer
125
views
Can’t parse too deep node by using libxml2
I generate a html of an img tag is wrapped by 255 div tags. I use libxml parse the html and output the result, but the img tag is missed in the result. But if the count of the div tags is 254, the ...
0
votes
1
answer
138
views
How do I access a specific element in an xml file with libxml2?
I need an xmlNode that points to the "tiles" element of this file.
<map>
<export from="v4.3.9" build="4390" date="2023-07-17" time="14:55:14&...
0
votes
1
answer
73
views
Memory leak when copying dom and then replacing node (xmlCopyDoc and xmlReplaceNode)
I am building a program that does a merge validation between two xml files using libxml2 v2.11.
In summary, I am creating a copy of a target dom to then replace all nodes with the replacement dom's ...
3
votes
0
answers
286
views
How to use libxml2 on windows?
I want use this lib in my project:
https://github.com/terminalstatic/go-xsd-validate
I try to use debug is vscode on Windows. Now i am getting this error:
Build Error: go build -o ...\service\...
0
votes
1
answer
899
views
Python AWS CDK build broke yesterday - 'Please make sure the libxml2 and libxslt development packages are installed.'
I've been using CDK to regularly deploy my python-based lambdas to AWS for over a year and it's been working great. The build broke yesterday, and I noticed that the image I'm using was updated a ...
0
votes
0
answers
124
views
libxml2-Question about xmlCreateFileParserCtxt
I'm confused about the return value. I think the ret is a newly allocated memory, and I need to free it by using xmlFreeParserCtxt. But when I remove xmlFreeParserCtxt, I found there is no error and I'...
1
vote
1
answer
65
views
Why does //NODE not find any elements, but //*[name() = 'NODE'] does?
I am trying to parse the XML (or maybe HTML?) output of the San Francisco transit Operators API (free API key required):
https://511.org/open-data/transit
Pasted the full XML string into this Gist ...
1
vote
0
answers
83
views
Is it possible to reuse schema context in libxml2 when validating multiple xml buffers or files?
learning to use the libxml2 library, and I'm trying to develop code that uses the same schema file to validate either multiple buffers of xml data or multiple files of xml data. But it looks like I ...
0
votes
1
answer
142
views
LibXML2 failing to free memory when encapsulated in Python/ctypes
My Python script is:
def xmlEncodeSpecialChars(doc: xmlDoc, input: str) -> str:
'''
Do a global encoding of a string, replacing the predefined entities this routine is reentrant, and result ...
1
vote
1
answer
82
views
Perl libxml findvalue fails when root tag contains attributes
I am trying to filter records in a given XML file matching the contract ids contained in a CSV file.
The xml file looks like this:
<ROOTS02 xmlns="http://www.fja.com/RAN/RANTS02" xmlns:...
2
votes
0
answers
39
views
XML::LibXML converted é to é [duplicate]
I have a test.xml file which contains the following content:
<div value="éclair">éclair</div>
I'm using the following perl code to extract and print it:
use strict;
use XML::...
0
votes
1
answer
241
views
How manage error of xmlReadMemory (libxml Gnome) in a multithreaded environment?
I use the libxml2 Gnome in a multithreaded environment.
When I call xmlReadMemory() I use xmlGetLastError() to have the detail of error message.
However this function, according to the doc, returns ...
0
votes
1
answer
152
views
Parsing html text out of a content node using libxml++ returns empty output
I modified the DOM parsing example found here: https://libxmlplusplus.github.io/libxmlplusplus/manual/html/chapter-parsers.html#sect-dom-parser
The code:
#include <libxml++/libxml++.h>
#include &...
0
votes
1
answer
291
views
Including libxml++ library in cmake
I'm trying to compile a project utilizing QT and LibXMl++. I'm having trouble messing around with the cmake file. I'm getting undefined references to libxml++ while compiling my code.
Here is the ...
0
votes
1
answer
83
views
libxml2 strips prefix off node tags
I have an XML document that looks like this:
<RootNode schemeIdUri="xxx">
<cenc:pssh>some_data</cenc:pssh>
<bar:detail>details</bar:detail>
</...
0
votes
1
answer
118
views
Xpath 1.0 get unique values with limited scope
I am wokring with XML and XPATH v1.0, specifically using libxml2's Schematron module, that I am quite sure that uses the Xpath module for the assert tests. So in order to simplify the problem, lets ...
0
votes
1
answer
294
views
xmlNodeGetContent memory leak, how to fix it?
We have code which does parsing of SOAP xml, and we use xmlNodeGetContent api. In valgrind it shows that it leaking memory. What i found in some posts that we need to explicitly free the memory ...
0
votes
1
answer
662
views
Need Help Cross-Compiling libxml2 With Conan
I've been trying to cross-compile an application from Linux > Windows which depends on libxml2. I'm trying to use Conan for managing the dependencies.
I've been running into various roadblocks, the ...
0
votes
0
answers
1k
views
xsltproc crashes on windows 10
I can use xsltproc from http://xmlsoft.org/sources/win32/64bit/ on Windows 8. But after I upgrade to Windows 10, xsltproc stops working and crashes every time. Has Anyone experienced this problem ...
-1
votes
1
answer
123
views
Why does DOMDocument use 80 minutes when XMLParser use 10 seconds to parse 120MB of XML?
I have a large 120MB XML file, and i have written 2 parsers to parse it, 1 with the DOMDocument API, which uses roughly 80 minutes to parse it, and another parser using the XML Parser API, using ...
1
vote
1
answer
250
views
Schema validation does not report all missing children
Given this example schema ("big.xsd"):
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:...
0
votes
0
answers
378
views
python lxml in docker: "Document is empty" while parsing
Why this code is working without issues on my mac with any version of python, requests and lxml, but doesn't work in any docker container? i tried everything(
it just fails on 34533 line (discovered ...
0
votes
1
answer
68
views
python ctypes structure pointers don't resolve as expected
I've built a ctypes interface to Libxml2, the Python xmlDoc is:
class xmlDoc(ctypes.Structure):
_fields_ = [
("_private",ctypes.c_void_p), # application data
("...
0
votes
0
answers
70
views
How to find the character index of an XPath match with libxml2?
Given an XML file (stored in, say, sample.xml), and an XPath expression (say, //storyinfo), I want to get the character index in the XML file of the start of each node that results from evaluating the ...
2
votes
2
answers
3k
views
How to get first element from lxml using xpath
Minimal example:
In [1]: from lxml import etree
In [2]: etree.fromstring('<who>syslogd</who>').xpath('/who/text()')
Out[2]: ['syslogd']
currently I'm using helper function:
def ...
1
vote
0
answers
90
views
I cant upgrade the lxml version,
i get the message "Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?"
Also
PS C:\Users\herna> pip install lxml --upgrade
Requirement already satisfied: ...
-1
votes
1
answer
421
views
getting Error: Invalid XSD schema NODEJS using libxmljs
I am getting Error: Invalid XSD schema error while running this error. What is the actual issue, I am unable to find it.
var libxml = require("libxmljs");
var fs = require('fs');
var xsd = ...