Questions tagged [libxml2]

Software library for parsing XML documents.

libxml2 is written in the programming language, and provides bindings to , , , , / and other Pascals, , , and .

The library was originally developed as part of the GNOME project and features

Useful Links

1518 questions
5
votes
1 answer

libxml2 generator ( from xsd to C source code)

there is someone that know if exist a XSD code generator for C source code? I have a lot of xsd files and I need to generate C struct and relative function fromXml and toXml. Thanks.
n3wtron
  • 73
  • 6
5
votes
1 answer

Including libxml2 with a LLVM module map

When trying to build a Swift package I created that uses a LLVM module map to include libxml2 from /usr/include/libxml2/, I get the following error: Compiling Swift Module 'foo' (1 sources) 2:9: note: in file included from…
Nicolai
  • 328
  • 2
  • 10
5
votes
1 answer

What is the maximum size of an XML file when using python's lxml etree

In our application we use python's lxml to read an XML string in memory: parser = etree.XMLParser(... huge_tree=False) xml = etree.fromstring(src, parser) I noticed that it bails out when the content of src is more than 10Mb. This is the expected…
lorenzog
  • 3,483
  • 4
  • 29
  • 50
5
votes
1 answer

Libxml2 installation onto Mac

I'm trying to install "libxml2" and "libxslt" in order to use scrapy (web scraping with python) on a mac. I have homebrew and I ran $ brew install libxml2 libxslt I get this message OS X already provides this software and installing another…
efong5
  • 366
  • 1
  • 6
  • 21
5
votes
1 answer

How to get attribute in XML using libxml c library?

A certain task requires me to parse an XML file and check every node and its attributes. I have spent few weeks learning XML and XML parsing. I have even taken the help of earlier questions posted related to LIBXML parsing in C and based on that…
Albert
  • 415
  • 5
  • 15
5
votes
2 answers

Why aren't "gem" and "bundle" using the same libxml2?

I seem to be in a recursive loop of frustration. I'm trying to "bundle install" a project, but it results in: An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.6.6.2'`…
Todd R
  • 18,236
  • 8
  • 31
  • 39
5
votes
1 answer

How to obtain an xmlBuf for use with xmlBufGetNodeContent/xmlBufNodeDump etc.?

The description of xmlNodeDump() (which takes an xmlBufferPtr) states: Since this is using xmlBuffer structures it is limited to 2GB and somehow deprecated, use xmlBufNodeDump() instead. Fair enough, but since xmlBufNodeDump() (and e.g.…
maxschlepzig
  • 35,645
  • 14
  • 145
  • 182
5
votes
5 answers

libxml-ruby failed to load at x86_64

We are having problem with libxml-ruby gem at the server side Possible because it uses x86_64 architecture: $ uname -a Linux ip-10-228-171-64 2.6.21.7-2.fc8xen-ec2-v1.0 #1 SMP Tue Sep 1 10:25:30 EDT 2009 x86_64 GNU/Linux require 'libxml' LoadError:…
Bogdan Gusiev
  • 8,027
  • 16
  • 61
  • 81
5
votes
1 answer

How to disable XXE in libxml2in C?

Requirement: When i pass the following request to my application, 1) How to do XML validation on such input xml which is risk 2) How to disable XXE in libxml2 i.e. should not parse the ENTITY field
Praveen PVS
  • 91
  • 3
  • 7
5
votes
1 answer

Error Rails - libxml-Ruby

I've been struggling with this error installing libxml-ruby while setting up my active merchant git. I've Googled all the components of the error many times, but I'm just not really sure what I'm looking at. There's a bunch of "no's" - anybody know…
Tommy Nicholas
  • 1,133
  • 5
  • 20
  • 31
5
votes
2 answers

How to get the name and value of attributes from xml when using libxml2 sax parser?

I got stuck on trying to detect the pair of name and value of the attributes in some general xmls by using libxml2 for parsing the api on iPhone application. For my project, the parsing speed is really important, so I decided to use libxml2 itself…
tksohishi
  • 245
  • 1
  • 4
  • 8
5
votes
1 answer

What's the most efficient way to do recursive XPath queries using libxml2?

I've written a C++ wrapper function for libxml2 that makes it easy for me to do queries on an XML document: bool XPathQuery( const std::string& doc, const std::string& query, XPathResults& results); But I have a problem: I need to be…
Matthew Lowe
  • 1,350
  • 1
  • 17
  • 29
5
votes
2 answers

lxml: clean_html replaces html tag with div?

I'm using lxml 3.1.0 (installed with easy_install), and seeing strange result: > from lxml.html.clean import clean_html > clean_html("

hi

") '

hi

' the html tag is being replaced with…
ykaganovich
  • 14,736
  • 8
  • 59
  • 96
5
votes
1 answer

lxml._ElementTree.getpath(element) returns "*" instead of tag names for elements in non default name space

Please help to make getpath() to return full tag names in getpath() xpath or to find workaround I'm trying to generate xpath to element in a lxml.etree._ElementTree. ElementTree is generated by parsing 600Kb response from some production…
vvladymyrov
  • 5,715
  • 2
  • 32
  • 50
5
votes
5 answers

Problem with namespace and libxml when i use Xpath

i've got a problem when i'm using libxml with XPath. I want to parse an youtube playlist :
Sly33
  • 165
  • 2
  • 7