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
6
votes
1 answer

libxml2 HTML parsing

I'm parsing HTML with libxml2, using XPath to find elements. Once I found the element I'm looking for, how can I get the HTML as a string from that element (keeping in mind that this element will have many child elements). Given a document: …
johndoe
  • 63
  • 1
  • 3
6
votes
2 answers

xpath 'or' behaving like union ('|') with xmllib2

I have XML documents like: test1 test2 test3 I'd like to retrieve the specific myelement, and if it's not present, then the first one.…
foudfou
  • 976
  • 6
  • 11
6
votes
4 answers

How to use libxml2 with CMake?

I am using CLion editor (with CMake) for my C project, I've never used an external library though, my question is how do I link an external lib (for ex. libxml2) to my project? I've seen some questions similar to this but none worked for me. My…
Gal Pressman
  • 130
  • 1
  • 13
6
votes
1 answer

Using Perl and LibXML to obtain sub node values when namespace is used

I have the following XML as an example: C Node Value Here
Brian
  • 101
  • 1
  • 3
6
votes
2 answers

Trouble Installing Nokogiri on Mac OS X Yosemite v.10.10.1 because of libxml2 while upgrading to Rails 4.2.0

I'm trying to install Rails 4.2.0 on my computer, but I am having issues installing Nokogiri. I followed the steps in the first answer for "bundle install stopped at Nokogiri", but when I run brew install nokogiri, I get the following: Activating…
Dave
  • 61
  • 3
6
votes
3 answers

What version of XPath is implemented in XML::LibXML?

Does anybody know which version of the XPath specification has been implemented in XML::LibMXL? Or more to the point, where can I find a description of the XPath functions that I can use in LibXML? For example, I tried something…
jackthehipster
  • 978
  • 8
  • 26
6
votes
2 answers

libxml2 ImportError when importing etree from lxml

I am trying to run python-docx in Enthought Canopy. I'm running Ubuntu 14.04 on VMWare Worstation 10. Whenever I try to import docx or import etree from lxml, I get an error that seems to be related to the libxml2 library: ImportError:…
ScottYoung
  • 115
  • 1
  • 2
  • 5
6
votes
2 answers

Does "find" return nodes in order?

Do XML::LibXML::Node::find and related methods guarantee that the list of nodes will always be ordered as in the XML document? This is important for me because my document corresponds to a big array in which I want to be able to delete series of…
scozy
  • 2,511
  • 17
  • 34
6
votes
1 answer

What's wrong with this findnodes statement in my Perl's script?

I have a simple xml file that looks like this: Bactrian…
John
  • 5,139
  • 19
  • 57
  • 62
6
votes
1 answer

How can I access attributes and elements from XML::LibXML in Perl?

I am having trouble understanding / using name spaces with XML::LibXML package in Perl. I can access an element successfully but not an attribute. I have the following code which accesses an XML file (http://pastebin.com/f3fb9d1d0). my $tree =…
John
  • 5,139
  • 19
  • 57
  • 62
6
votes
3 answers

Perl XML::LibXML: how to access comment nodes

For the life of me I can't figure out the proper code to access the comment lines in my XML file. Do I use findnodes, find, getElementByTagName (doubt it). Am I even making the correct assumption that these comment lines are accessible? I would hope…
CraigP
  • 453
  • 1
  • 3
  • 17
6
votes
2 answers

Getting list of all properties of a node using libxml

I'm having trouble to find a way to extract a list of all properties of a node without knowing what they're called. I'm extracting single known properties using: xmlGetProp(cur, (const xmlChar*)"nodename") But how to get a list of all properties…
Marius
  • 61
  • 1
  • 6
6
votes
4 answers

Getting nokogiri to use a newer version of libxml2

I've been trying to get Nokogiri installed on my computer (Mountain Lion) to use with rspec and capybara, but for the life of me, I can't get it to run properly. From what I can tell, the issue is with nokogiri using the wrong version of libxml2. …
Alex LaFroscia
  • 961
  • 1
  • 8
  • 24
6
votes
4 answers

How to add a xml node constructed from string in libxml2

I am using Libxml2 for encoding the data in a xml file. My data contain tags like "<" and ">". when it is converted into xml these tags are also converted into "<" and ">". Is there any way to solve this problem. I want to use those tags as xml…
Parul Garg
  • 63
  • 1
  • 5
6
votes
1 answer

Header Search Paths in XCode - Is it possible to set a macro or variables so they're relative to the SDK version?

Update: It appears that a recent XCode update may have changed this macro, please see this Question & Answer for more information: Obtaining older SDKROOT behavior in XCode Situation: I'm using libxml2 on an iPhone project and I've added it as…
Justin Searls
  • 4,789
  • 4
  • 45
  • 56