libxml2

Why does installing Nokogiri on Mac OS fail with libiconv is missing?

吃可爱长大的小学妹 提交于 2019-12-17 02:40:09
问题 I've been trying to install Nokogiri on Mac OS 10.9.3 and whatever I try, the install fails in the end with the following error message: $ sudo gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib Building native extensions with: '--with-xml2

我需要在XML文档中转义哪些字符?

*爱你&永不变心* 提交于 2019-12-16 14:27:47
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> XML文档中必须转义哪些字符,或者在哪里可以找到这样的列表? #1楼 除了常见的五个字符[<,>,&,“,'],我还将转义垂直制表符(0x0B)。它是有效的UTF-8,但不是有效的XML 1.0,甚至许多库(包括libxml2)错过它,并以静默方式输出无效的XML。 #2楼 如果您使用适当的类或库,它们将为您进行转义。 许多XML问题是由字符串串联引起的。 XML转义字符 只有五个: " " ' &apos; < < > > & & 转义字符取决于使用特殊字符的位置。 可以在 W3C标记验证服务处 验证示例。 文本 安全的方法是对文本中的所有五个字符进行转义,但是,在文本中不必对三个字符 " , ' 和 > " 进行转义: <?xml version="1.0"?> <valid>"'></valid> 属性 安全的方法是转义属性中的所有五个字符,但是,不必在属性中转义 > 字符: <?xml version="1.0"?> <valid attribute=">"/> 如果引号是 " 则不必在属性中转义 ' 字符: <?xml version="1.0"?> <valid attribute="'"/> 同样, " 不用在属性中进行转义,如果行情是 ' : <?xml version="1.0"?>

RVM doesn't work for 1.9.1 but works for 1.8.6 and 1.8.7

岁酱吖の 提交于 2019-12-14 03:49:15
问题 UPDATE 6/25/10 Using Google, I am not the only person to encounter this problem. Apparently this problem has to do with readline . Has anyone out there encountered this issue? (see error at make.error.log below) As google suggests, I compiled readline: curl -O ftp://ftp.gnu.org/gnu/readline/readline-6.1.tar.gz tar xzvf readline-6.1.tar.gz cd readline-6.1 ./configure --prefix=/usr/local make sudo make install Update II Following the advice of the above update (compile readline), has led me to

Best way to match Attribute value in XML element

坚强是说给别人听的谎言 提交于 2019-12-13 18:07:03
问题 My XML: < measValue dn="Cabinet=0, Shelf=0, Card=2, Host=0"> < r p="1">1.42</r> < r p="2">2.28</r> < /measValue> I want to match getAttribute("dn") with different patterns like 1> Host=0 # this is very easy my solution: if (getAttribute("dn")=~ /Host=0/) 2> Host=0 && Card=2 I can do it but I need to match it twice like if (getAttribute("dn")=~ /Host=0/) && (getAttribute("dn")=~ /Card=2/) Is there any better way to accomplice this match this second pattern? using LibXML 回答1: Have a try with:

libxml2 crash on second use on Windows

空扰寡人 提交于 2019-12-13 06:41:37
问题 I've been using libxml2 push parsing (SAX) to parse an incoming XML stream, this works well first time but crashes on the second attempt every time, my code looks like this: xmlSAXHandler saxHandler; memset(&saxHandler, 0, sizeof(m_SaxHandler)); xmlSAXVersion(&saxHandler, 2); saxHandler.initialized = XML_SAX2_MAGIC; // so we do this to force parsing as SAX2. saxHandler.startElementNs = &startElementNs; saxHandler.endElementNs = &endElementNs; saxHandler.warning = &warning; saxHandler.error =

Building libiconv fails with the Android standalone toolchain

試著忘記壹切 提交于 2019-12-12 21:16:03
问题 When I try to build libiconv using the Android NDK standalone toolchain (android-ndk-r5-crystax-2), I get this error output. Can someone please tell me what might be wrong? My environment looks like this: export NDK=$HOME/android/android-ndk-r5-crystax-2 export TOOLCHAIN=$HOME/android/toolchain export ARCH=armv7-a export SYSROOT=$TOOLCHAIN/sysroot export PATH=$PATH:$TOOLCHAIN/bin:$SYSROOT/usr/local/bin export CROSS_COMPILE=arm-linux-androideabi export CC=${CROSS_COMPILE}-gcc export CXX=$

Use of undefined constant LIBXML_HTML_NOIMPLIED

穿精又带淫゛_ 提交于 2019-12-12 19:16:44
问题 I have just deployed some DOM Manipulation code to our staging server and am getting the error: [PHP notice] Use of undefined constant LIBXML_HTML_NOIMPLIED - assumed 'LIBXML_HTML_NOIMPLIED' I have no issues on my desktop using WAMP and cannot find any modules that appear to be related. Our Centos 6 server appears to be using PHP version 5.4.34 with libxml2-2.7.6-1 installed. I have searched our php.ini file and there is no mention of 'libxml' and phpinfo() gives me the following section for

On Solaris, are libraries compiled with gcc usable the same way as for libs generated with cc?

被刻印的时光 ゝ 提交于 2019-12-12 18:26:45
问题 I am currently trying to compile libxml2 on Solaris . When I run the ./configure script provided with the sources, the gcc and g++ compilers are automatically used. However, I would like to use cc and CC compilers. So I run : ./configure CC=cc CXX=CC It works but then, when I run " make ", I get some errors which prevent the libraries to be generated. When gcc and g++ are used, everything goes well with no errors, so I was wondering: can I use the librairies generated with gcc/g++ the same

libxml error handler with OOP

纵然是瞬间 提交于 2019-12-12 15:57:43
问题 I need catch libxml errors. But I want to use my class for this. I know about libxml_get_errors and other function. But I need something like libxml_set_erroc_class("myclass") and in all case for error will call my class. I don't want in each case after use $dom->load(...) create some construction like foreach(libxml_get_errors as $error) {....} . Can you help me? 回答1: libxml errors are mostly generated when reading or writing xml document because automatic validation is done. So this is

Perl XML/SVG Parser unable to findnodes

风流意气都作罢 提交于 2019-12-12 13:24:05
问题 In the following code, I am trying to parse an SVG file and delete all text nodes in it. However, it does not work (Code never goes into the forloop for findnodes). What am I doing wrong? I tried with XPath and LibXML version of the code, but none of them worked. They parse and dump the file fine, but the findnodes matches nothing. #!/usr/bin/perl use strict; use warnings; use XML::XPath; use XML::XPath::XMLParser; my $num_args=$#ARGV+1; if($num_args != 1) { print "Usage: $0 <filename>\n";