libxml2

How to install libxml2 2.9.0 for lxml for Python 3.4.3 on win 7 64?

蓝咒 提交于 2019-12-24 12:34:47
问题 I'm using lxml 3.4.2 for Python 3.4 on a win 7 64 computer. I got lxml from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml. One of its parts is libxml2 2.9.2. I'm having a problem that a user of lxml 3.4.2 with libxml2 2.9.0 is not having, so I'd like to try libxml2 2.9.0, but can't figure out how to install it. See Python 2 v. 3 xpath for more on the problem. I don't have the ability to compile from sources. How can I install 2.9.0? 回答1: To use custom versions, you will almost certainly

libxml2 XML_PARSE_HUGE option for xmlParseMemory

六眼飞鱼酱① 提交于 2019-12-24 12:33:53
问题 C++ on Centos 6.4, libxml2.x86_64 2.7.6-12.el6_4.1: I'm trying to fix an old C++ program that occasionally gets XML parser errors on large xml files, seems to need the XML_PARSE_HUGE option set. But I can't see any place to set it! The code that's failing is using the xmlParseMemory function which only has 2 parameters - the char array to parse and its size. Is there some way to set the XML_PARSE_HUGE option globally? 回答1: You have to switch to xmlReadMemory which has an options parameter.

LibXML2.dylib with Xcode6

寵の児 提交于 2019-12-24 11:37:40
问题 I'm trying to integrate libxml2.dylib in my IOS project,I have linked this library in Link binary with libraries in Build phases for target,its working fine when I run it on simulator,but throws linker command failed with exit code 1 (use -v to see invocation) library not found for -lxml2 error when trying to run it in device ,I have also added -lxml2 in Other Linker flags in Build settings,still couldn't get it done.I'm a beginner,any advice on this is highly appreciated.I'm using Xcode 6.1

Rails Installing libxml2 on Windows

两盒软妹~` 提交于 2019-12-24 10:47:54
问题 When I run bundle install , I get the following error: Using activeresource (3.0.3) Installing libxml-ruby (1.1.4) with native extensions C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:529:in `build_extensions': ERROR: Failed to build gem native extension. ( Gem::Installer::ExtensionBuildError) C:/RailsInstaller/Ruby1.8.7/bin/ruby.exe extconf.rb checking for socket() in -lsocket... no checking for gethostbyname() in -lnsl... no checking for atan() in -lm... yes

libxml2 xmlNodePtr's type changes when I observe it

半城伤御伤魂 提交于 2019-12-24 09:46:17
问题 I spent some time yesterday debugging a lovely Heisenbug where an xmlNodePtr 's type would change on me. This example shows the error: #include <iostream> #include <vector> #include <string> #include <memory> // std::unique_ptr #include <cstdint> #include <libxml/tree.h> #include <libxml/parser.h> struct SomeDataType { std::vector<std::vector<std::string>> data; explicit SomeDataType(uint32_t rows_, uint32_t columns_) : data(rows_) { for (uint32_t row = 0; row < rows_; ++row) { data[row]

Remove XML namespaces with XML::LibXML

眉间皱痕 提交于 2019-12-24 01:18:56
问题 I'm converting an XML document into HTML. One of the things that needs to happen is the removal of namespaces, which cannot be legally declared in HTML (unless it's the XHTML namespace in the root tag). I have found posts from 5-10 years ago about how difficult this is to do with XML::LibXML and LibXML2, but not as much recently. Here's an example: use XML::LibXML; use XML::LibXML::XPathContext; use feature 'say'; my $xml = <<'__EOI__'; <myDoc> <par xmlns:bar="www.bar.com"> <bar:foo/> </par>

Conditionally compiling for differences in libxml2 in iOS 7

一世执手 提交于 2019-12-23 21:44:44
问题 When using iOS 7 SDK, due to changes in libxml2 I had to change a single line of a library to use the new output buffer accessor methods for the xmloutput buffer. NSData * result = [[[NSData alloc] initWithBytes:outputBuffer->buffer->content length:outputBuffer->buffer->use] autorelease]; Resulted in compile error 'Incomplete definition of type struct_xmlBuf'. Using the new accessor methods this became: NSData * result = [[NSData alloc] initWithBytes:xmlOutputBufferGetContent(outputBuffer)

libxml2 and XPath traversing children and siblings in ANSI C

断了今生、忘了曾经 提交于 2019-12-23 20:15:30
问题 I have done a fair bit of XML stuff in Perl and now I need to do it in ANDI C for a project. Here's the code I wrote with a snippet of the XML. I have had success to a degree, but am having problems with getting siblings, I am sure it's super easy but I just can't get it. There is two functions, one that simply gets the node set (copied directly from xmlsoft.org). The second function is mine. xmlXPathObjectPtr getnodeset (xmlDocPtr doc, xmlChar *xpath){ xmlXPathContextPtr context;

Cannot parse CDATA with SimpleXML

女生的网名这么多〃 提交于 2019-12-23 19:26:11
问题 I have the following XML code: <para> <![CDATA[ <?php $data = '<?xml version="1.0"?> <root>content</root>'; $sxe = simplexml_load_string($data); var_dump($sxe); ?> ]]> </para> I want to parse the CDATA section to take this result: Content: <?php $data = '<?xml version="1.0"?> <root>content</root>'; $sxe = simplexml_load_string($data); var_dump($sxe); ?> I use the following but it doesn't work. $xml='sxml.xml'; $book = simplexml_load_file($xml, 'SimpleXMLElement', LIBXML_NOCDATA); $para =

libxml2 attribute modification C

你说的曾经没有我的故事 提交于 2019-12-23 18:16:53
问题 I want to change one attribute ('voltage') in my xml: ... <detector voltage="1.2e3f"/> ... Here is how im trying to do it: void save_detector_attr(xmlNode *node, xmlDoc *doc){ char *voltage; xmlAttrPtr s_vnewattr; char buf[128]; xmlNode *cur = node->xmlChildrenNode; float sv; int cnt = 0; while(cur != NULL) { if (cur->type == XML_ELEMENT_NODE) { if (!xmlStrcmp(cur->name, "detector")){ voltage = xmlGetProp(cur, "voltage"); sv = atof(voltage); snprintf(buf, 128, "%f", sv + 20.1 ); s_vnewattr =