libxml2

How do I get libxml2's SAX2 interface to let me see < et al?

I have some code using libxml2's SAX2 interface. I want to be able to see < type entities as entity references and not as characters but it appears that no matter what I do, libxml2 will turn &lt; into a < and then hand it to my characters callback instead of calling my reference callback. Any ideas as to how I can force libxml2 to cal...

HTML Entity problems using Nokogiri::XML.fragment

Hi everybody, it seems that all entities are killed using tags = "<p>test umlauts &ouml;</p>" Nokogiri::XML.fragment(tags) Result: <p>test umlauts </p> The above method calls Nokogiri::XML::DocumentFragment.parse(tags) and that methods calls Nokogiri::XML::DocumentFragment.new(XML::Document.new, tags). In relation to the nokogir...

libxml/tree.h no such file or directory

i am getting following errors. I have already added libxml2.dylib to my project, how ever i am getting this type of trouble. Plz any body help me. ...

Explain whats different between ImageMagick on Windows and on CentOS linux?

I have been using ImageMagick running on a Windows 2003 server that is called in a PHP script to create a thumbnail of an image using the following command: $cmd = "convert.exe \"". $fullpath . "\" -resize \"" . res_image_width ."x" . res_image_height . ">\" \"". $fullpath. "\" 2>&1"; passthru($cmd); I have now moved this functionalit...

How to use nokogiri from Jruby on Windows?

Hello, I'm getting the following error when trying to use Nokogiri with Jruby on Windows 7 D:\code\h4>jruby -e "require 'rubygems'; require 'nokogiri'" D:/jruby-1.3.1/bin/../lib/ruby/1.8/ffi/library.rb:18:in `ffi_lib': Could not ope n any of [xml2, xslt, exslt] (LoadError) from D:/jruby-1.3.1/lib/ruby/gems/1.8/gems/nokogiri-1.3....

Good strategies for REST -> XML -> Core Data -> UITableView?

What are good practices for asynchronously pulling large amounts of XML from a RESTful service into a Core Data store, and from this store, populating a UITableView on the fly? I'm thinking of using libxml2's xmlParseChunk() function to parse chunks of incoming XML and translate a node and its children into the relevant managed objects...

Python's libxml2 can't parse unicode strings

OK, the docs for Python's libxml2 bindings are really ****. My problem: An XML document is stored in a string variable in Python. The string is a instance of Unicode, and there are non-ASCII characters in it. I want to parse it with libxml2, looking something like this: # -*- coding: utf-8 -*- import libxml2 DOC = u"""<?xml version="1...

How LibXmlParsing can parse in chunks

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { xmlParseChunk(context, (const char *)[data bytes], [data length], 0); } my Question is as follows => didReceiveData: method receives data in parts Some what like this first data----------| <masterData>Main</ma second data-----| ster><maste...

libxml2 error handling

I'm writing a small wrapper around libxml2 in C++, and I'm trying to work out how to handle errors. For now, let's say I just want to print them out. Here's what I've got at present: My error handling function: void foo(void *ctx, const char *msg, ...) { cout << msg << endl; return; } Initialised like this: xmlGenericErrorFunc h...

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 able to do another XPath query on the results of my first query. Currently I do this by s...

Python XPath Result displaying only []

Hey I have just started to use Python recently and I want to use it with a bit of xPath, the thing is when I print the result of the query I only get [] and I don't know why =S import libxml2, urllib doc = libxml2.parseDoc(urllib.urlopen("http://www.domain.com/").read()) result = doc.xpathEval("//th//td[(((count(preceding-sibling:...

The choice of XML/XSL lib for Python 2.6.x

Currently I have 2 varieties, LXML and libXML2 that both seem to work. I have tried benchmarking both, specifically for parsing memory string and files into XML and importing XSLT stylesheets and applying them. While pure performance based tests indicate that LXML comes on top (applying stylesheets specifically) libxml2 seems to have bee...

Is there a way to build a libxml2 without text relocations on Linux?

Good afternoon, I am having difficulties with libxml2. I tried to build the Perl module XML-LibXML which is part of our standard runtime environment. However, this time the installation on a RHEL5 box failed, because the build process complained about missing libxml2: $> perl Makefile.PL LIB=/foo/lib/perl PREFIX=/foo INSTALLDIRS=site...

iPhone - does TouchXML use an undocumented APIs?

Recently I've heard that Apple is using tools to search for references to undocumented APIs and are rejecting iPhone apps from the App Store because of it. The popular Three20 framework is causing people to get rejected. I also just saw that the KissXML library has also caused rejection. I'm looking for an Objective C DOM-based XML p...

Install libxml2 and associated python bindings - Windows

Hello, I am attempting to install libxml2 so that I can setup the python bindings and eventually use lxml. However I am unable to work out here on earth I am supposed to be unzipping the files. I haven't been able to google successfully. Do I need Cygwin/MinGW for the installation to be successful? At the moment I have the files from...

Getting list of all properties of a node using libxml

Hi, 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 using libxml2? Regards, marius ...

Is there a way to do something to static members on process end?

I have a class that uses libxml2. It has static members which are used to hold context for a schema file and its parser. I'm using valgrind, and it's complaining that memory is not deallocated in connection with the schema context. This is because you need to free that memory yourself. However, since these context variables are stati...

python libxml2dom xpath question

hi... quick question... i can create/parse a chunk of html using libxml2dom, etc... however, is there a way to somehow display the xpath used to generate/extract the html chunk.. i'm assuming that there's some method/way of doing this that i can't find.. ex: import libxml2dom d = libxml2dom.parseString(s, html=1) ## hdr="//div[3]/...

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 instead of using NSXMLParser. Now, as referring to XMLPerformance that is a sample of iPho...

libxml2 - validate XML document against schema. Retrieve schema url from the actual XML file.

Hi, I need to validate a xml file against DTD schema. I found out that I need to pass the source of schema file for validation. Is that possible to make libxml2 find the declaration of schema in XML file and do the validation on its own, or do I have to retrieve the declaration manually? Thanks in advance Michal ...