libxml2

python setuptool how can I add dependency for libxml2-dev and libxslt1-dev?

My application needs lxml >= 2.1, but to install lxml its requied to install libxml2-dev libxslt1-dev else it raises error while installing the lxml, is there a way that using python setup tool I can give this as dependency in my setup.py.... ...

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

I have XML documents like: <rootelement> <myelement>test1</myelement> <myelement>test2</myelement> <myelement type='specific'>test3</myelement> </rootelement> I'd like to retrieve the specific myelement, and if it's not present, then the first one. So I write: /rootelement/myelement[@type='specific' or position()=1] The XPath spec ...

Function 'xsltParseStylesheetDoc' not found in [libxml2.so]

This error comes up in Redhat Enterprise Linux Server 5.4 - 64 bit. Linux rhl-64-tibbr5 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux There is also this error in the stack trace. uninitialized constant Nokogiri::VERSION_INFO More version details: jruby-1.4.0RC1 ruby/gems/1.8/gems/activesupport-2....

Problems installing libxml2 on Mac OS X

I'm trying to install libxml2 on my Mac (OS 10.6.4). I'm actually trying to just run a Scrapy script in Python, which has required me to install Twisted, Zope, and now libxml2. I've downloaded the latest version (2.7.7, from xmlsoft.org) and tried following these instructions here. To summarize, I tried this command (in the python sub...

installing libxml2 on python 2.7 windows

hi, I've searched but theres no libxml2 binaries for py2.7. I have also tried running setup.py for version py2.6.9 but it gave me the error failed to find headers for libxml2: update includes_dir Does anyone have a solution? ...

On libxml, how can I get this property value?

For an XML that has <?xml version="1.0" encoding="utf-8"?> <COLLADA version="1.4.0" xmlns="http://www.collada.org/2005/11/COLLADASchema"&gt; <library_geometries> <geometry id="Cube"> <mesh> <source id="Cube"> <float_array count="24" ">1 2 3</float_array> [..] I'm getting properly "1 2 3" string with a if (!xmlStrcmp(c...

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: <html> <header> <title>Some document</title> </header <body> <p id="...

libxml2 - remove child, but not grandchildren

I'm using libxml2 to parse HTML. I want to remove certain formatting tags like <center>, while keeping their content (for example, a link). This means I'll have to remove certain child nodes from my xmlNodeSet, but keep that node's children. Right now, I got this code: xmlNodePtr parentNode = nodes->nodeTab[i]; if (parentNode != NULL...

libxml2 - insert child node before parent node's content

I'm using libxml2 to parse HTML. The HTML might look like this: <div> Some very very long text here. </div> I want to insert a child node, e.g. a header, in before the text, like this: <div> <h3> Some header here </h3> Some very very long text here. </div> Unfortunately, libxml2 always adds my header after t...

How do I include libxslt in my iPhone app?

I've heard that including libxslt.dylib is grounds for getting your app rejected. I don't know how accurate that is. Nevertheless, I would like to include the latest version of libxslt. I'd like to do the same thing with libxml2, as well as other libraries in the future. What is the correct way to include a code library like this in my...

libxml2 from java

Hi, This question is somewhat related to http://stackoverflow.com/questions/530064/fastest-xml-parser-for-small-simple-documents-in-java but with a few more specifics. I'm working on an application which needs to parse many (10s of millions), small (approx. 300k) xml documents. The current implementation is using xerces-j and it takes...

libxml2 vs expat for an XMPP server

I'm trying to create an XMPP library (and later a server) from scratch in a new C-like programming language (although the language itself is irrelevant) as a means to learn what I can about the XMPP protocol and server software development in general. As many of you know, XMPP is messaging protocol based on XML that depends on an enormo...

libXML relaxed HTML parsing

Hi, I am trying to scrape some content from an HTML page. I'm using libxml2 and htmlReadMemory to get a xmlDocPtr. The HTML is simple, but it has a problem. It's basically the following: <tr><td><tr><td>Some content</td></tr></td></tr> libxml doesn't like the nested tr, tds. It keeps giving me the following error: HTML parser error ...

XPath query for a node

I should be doing something wrong. What is the XPath query for all nodes named "name" under display-name? I am using libxml2. <?xml version="1.0" encoding="UTF-8"?> <description xmlns="http://openoffice.org/extensions/description/2006" xmlns:d="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink...

libxml2 use for ipad

When I use libxml2 in my ipad project (i use the dylib and add the header flags correctly) it doesn't build and gives the error: /Xcode4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/include/libxml2/libxml/xmlversion.h:24 Expected '=','','.','asm' or 'atrribute' before 'void'. line 23-25 of xmlversion.h ...

parsing an online document (xml file) in gtk

how do i parse an online document (xml file) in gtk, for example the url : http://www.w3schools.com/XML/note.xml contains the xml file. ...

Any native XML DOM on Windows with control over memory allocation?

I'm looking to replace MSXML with a library that will allow us to use DOM processing but using our own allocation, so we can assure it is mapped directly onto a memory-mapped file. This avoids having to synch the DOM back to the file. Can anyone please suggest which of the various libraries out there is most likely to be easily customise...

libxml2 which function can I use to process element's text

I use libxml2 SAXParser. To process entering and leaving the element I use startElementSAXFunc and endElementSAXFunc procedures. But I couldn't find procedures to process the text. For example : Blogger How can I get "Blogger"?? ...

LibXML doesn't find any nodes for my xpath expression

Hello! I'm using xpath and LibXML in an iPhone app to find some nodes in an xml document. I'm a noob in xpath so probably i am doing something wrong. Here is the xml: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs...

Searching nodes - Libxml

Hello all... I am trying to parse an XML document in C++. I do not have any form of metadata associated with the document. Since i am a novice with XML's i wanted to understand the best way to parse this xml. I am using libxml2 to achive this. What i am doing currently is 1) walking the complete tree node by node , using pointers of ...