libxml2

Does libxml2 support XPath 2.0 or not?

99封情书 提交于 2019-12-30 06:11:20
问题 I've tried to use the XPath 2.0 exp //span/string(.) in libxml2 , but it doesn't work. So, my question is: does libxml2 support XPath 2.0 or not? 回答1: As far as I know -- not. The prevailing majority of XPath 2.0 implementations are part of XSLT 2.0 processors or XQuery processors. 回答2: According to this 2007 email from the maintainer of libxml2, libxml2 does not, and will not, support XPath 2.0. 回答3: you might be interested in an XPath 2.0 extension to libxml2 - however, 2 caveats apply: it

How can libxml2 be used to parse data from XML?

[亡魂溺海] 提交于 2019-12-28 12:32:30
问题 I have looked around at the libxml2 code samples and I am confused on how to piece them all together. What are the steps needed when using libxml2 to just parse or extract data from an XML file? I would like to get hold of, and possibly store information for, certain attributes. How is this done? 回答1: I believe you first need to create a Parse tree. Maybe this article can help, look through the section which says How to Parse a Tree with Libxml2. 回答2: I found these two resources helpful when

xmlReaderForMemory crashes on 2nd time call [closed]

痴心易碎 提交于 2019-12-25 16:55:30
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . after making google for long time also, i am unable to find reason/solution for crashing of xmlReaderForMemory,still with valid parameters. i have

how to parse xml using libxml2 in iphone

喜夏-厌秋 提交于 2019-12-25 06:37:08
问题 i am getting information in the form of xml from .net web server. I am using NSXml parser to parse it. But it takes time to parse. I hear that libxmll2 is faster than NSXml parser. But i did n't find clear info regarding how to use it. can any one pls post sample code or example regarding how to parse using libxml2. Thank u in advance. 回答1: You need to use XML parsing to implement this.I suggest use touchXML. Here is a sample code for that: -(void)callwebservice{ NSString *path = @"YOUR URL";

LibXML findnodes($query)

风格不统一 提交于 2019-12-25 04:05:31
问题 I'm having some trouble with this code: my $file= '../xml/news.xml'; my $parser= XML::LibXML->new(); my $doc = $parser->parse_file($file); my $xpc = XML::LibXML::XPathContext->new($doc); my $query = '/notizie/news[@id='.$newsId.']'; print $query; my $node = $xpc->findnodes($query)->get_node(1); print $node; In particular "print $node" prints an empty string, even if the XML file path is correct and the XPath query should return a node. The "funny" thing is that if i use: my $query = '/*/*[@id

Howto handle libxml2 parser errors

陌路散爱 提交于 2019-12-25 02:52:33
问题 I have to use xsd (schema) validation with libxml2, I can set a callback for error-handling, for the schema-validation errors, using: xmlSchemaSetValidErrors(). But before getting to the schema-validation, I have to parse my xml, to get a xmlDocPtr e.g. with xmlParseMemory. But: What if the xml is invalid, how do I set error-handlers for getting these errors? (I don't want them to be printed to stderr) I did not find a function similar to xmlSchemaSetValidErrors for the parsing functions. 回答1

Howto handle libxml2 parser errors

二次信任 提交于 2019-12-25 02:51:40
问题 I have to use xsd (schema) validation with libxml2, I can set a callback for error-handling, for the schema-validation errors, using: xmlSchemaSetValidErrors(). But before getting to the schema-validation, I have to parse my xml, to get a xmlDocPtr e.g. with xmlParseMemory. But: What if the xml is invalid, how do I set error-handlers for getting these errors? (I don't want them to be printed to stderr) I did not find a function similar to xmlSchemaSetValidErrors for the parsing functions. 回答1

gnuwin32 libxml2 installation : setting several lib and include directories

江枫思渺然 提交于 2019-12-25 01:53:24
问题 I am now compiling libxml2 on windows 8 using mingw32. I have downloaded from here ftp://xmlsoft.org/libxml2/ and follow the instruction found in the README file. They instruct to configure make using a javascript called configure.js. We can run the script like this: cscript configure.js compiler=msvc prefix=c:\opt include=c:\opt\include lib=c:\opt\lib debug=yes I guess there is a super simple and maybe obvious to this question, but how do I set several lib and include folders ? I tried

libxml2 not compilable on Cray, static/dynamic library missmatch

你说的曾经没有我的故事 提交于 2019-12-24 19:02:53
问题 Since I cannot seem to use the available libxml2 (see my other question), I want to compile it myself from scratch. I need to use the Cray wrapped Intel compiler for this. During the linking stage, I get many of these errors: ld: attempted static link of dynamic object `./.libs/libxml2.so' The configure line is this: libxml2/configure --prefix=local-icc CC=/opt/cray/pe/craype/2.5.14/bin/cc CXX=/opt/cray/pe/craype/2.5.14/bin/CC --enable-option-checking --host=x86_64-linux-gnu --without-zlib -

Parsing XML with line breaks / newline characters with Perl's LibXML

别说谁变了你拦得住时间么 提交于 2019-12-24 13:24:01
问题 I'm trying to parse a series of XML files with Perl's XML::LibXML module. <log date="2012-08-07 18:05:44.0" level="unit" label="2G-or-3G-server" name="unitnote" value="# Firmware level after downgrade # -&gt; show /HOST /HOST Targets: bootmode diag domain ...." Where some of the values contain output from the execution of scripts. When I try to parse these values, I end up with something like the following: my $value = $log->findvalue('@value'); print "value: $value\n"; Output: # Firmware