libxml2

xmllint validation error “no DTD found” while using XSD

五迷三道 提交于 2019-11-29 03:32:36
I'm trying to use xmllint to check my work while developing a basic XSD i.e. XML Schema schema. However it's giving me an error Validation failed: no DTD found. What am I doing wrong? My xmllint command: xmllint --noout --valid --schema simple.xsd lucas-basic.xml lucas-basic.xml:5: validity error : Validation failed: no DTD found ! > ^ lucas-basic.xml validates Test XSD file: <?xml version = "1.0" encoding = "UTF-8"?> <!--Generated by XML Authority. Conforms to w3c http://www.w3.org/2001/XMLSchema--> <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema"> <xsd:element name = "vehicles">

Error installing nokogiri 1.6.0 on mac (libxml2)

徘徊边缘 提交于 2019-11-28 21:15:04
UPDATE: Fixed I found the answer in another thread. The workaround I used is to tell Nokogiri to use the system libraries instead: NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install ==== Trying to install nokogiri 1.6.0 on a mac. With previous versions, I had no problems. But 1.6.0 refuses to install. This is the error: Building native extensions. This could take a while... ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /Users/josenriq/.rvm/rubies/ruby-1.9.3-head/bin/ruby extconf.rb Extracting libxml2-2.8.0.tar.gz into tmp/i686-apple-darwin11/ports/libxml2/2.8.0...

Adding libxml2 in XCode

允我心安 提交于 2019-11-28 19:33:37
I have added libxml2 to my Xcode 4 project following this guide . But it's not working. Xcode gives me error saying it no such libxml2 directory. What am I doing wrong? Here's the screenshots of the target settings of my project: Thanks. jazzcat add ${SDKROOT}/usr/include/libxml2 to "Header Search Paths" instead of "User Header Search Paths" under yourtarget -> Build Settings -> Search Paths link with libxml2.dylib in yourtarget -> Build Phases -> Link Binary With Libraries include libxml2 headers with, for instance, #include <libxml/HTMLparser.h> and you're off for better explanation see to

How check if a String is a Valid XML with-out Displaying a Warning in PHP

穿精又带淫゛_ 提交于 2019-11-28 17:25:20
i was trying to check the validity of a string as xml using this simplexml_load_string() Docs function but it displays a lot of warning messages. How can I check whether a string is a valid XML without suppressing ( @ at the beginning ) the error and displaying a warning function that expec Tjirp Use libxml_use_internal_errors() to suppress all XML errors, and libxml_get_errors() to iterate over them afterwards. Simple XML loading string libxml_use_internal_errors(true); $doc = simplexml_load_string($xmlstr); $xml = explode("\n", $xmlstr); if (!$doc) { $errors = libxml_get_errors(); foreach (

Why am I getting this “libxml/tree.h file not found” error?

别等时光非礼了梦想. 提交于 2019-11-28 16:39:43
I just installed Xcode version 4.3.1 and I get this error: libxml / tree.h file not found I have also installed Xcode 4.2, and with the same project I get the same error. I have configured the header search paths with /usr/include/libxml2 I also tried $(SDKROOT) / usr/include/libxml2 and it didn't work. I have also put Other Linker Flag with lxml2 Include the following in your header search path and you should be immune to any weirdness Apple does with their Xcode updates: $(SDKROOT)/usr/include/libxml2 In your question, you have a space between the / and usr . Perhaps this is a typo, but the

installed libtool but libtoolize not found

☆樱花仙子☆ 提交于 2019-11-28 16:28:45
问题 im trying to build libxml2 from source on my mac. so i have autoconf libtool and automake installed using mac ports autoconf and automake seem to be working fine as expected. i try running autogen.sh first. libtoolize --version unfortunately gives -bash: libtoolize: command not found i try running (again) sudo port install libtool ---> Cleaning libtool ---> Scanning binaries for linking errors: 100.0% ---> No broken files found. i try locate libtool and it seems to be installed fine

how to read a part of xml file in C++ using Libxml2

流过昼夜 提交于 2019-11-28 14:50:27
Hello i need to know "how to read a part of xml file in C++ using Libxml2". In my xml file I have : <svg> <g> <path d="11"/> </g> </svg> I want to see a value of "d" on my c++ program, when I come to this point : xmlNode *cur_node = NULL; for (cur_node = a_node; cur_node; cur_node = cur_node->next) { if(xmlStrEqual(xmlCharStrdup("path"),cur_node->name)){ printf("element: %s\n", cur_node->name); } print_element_names(cur_node->children); } } I dont know what I need to do, please help me. I'm not sure I understand the question, but it sounds like you want to print the attribute "d" in the

libxml xmlNodePtr to raw xml string?

不羁的心 提交于 2019-11-28 14:06:36
Given a valid, arbitrary xmlNodePtr, I would like the string representation of that node, including the tag, attributes, and children in the same form (recursive). FWIW, my scenario is I am using PerformXPathQuery to get a block of data from within an existing document. I need to get the results of the query, which has nested XML elements in it, as the raw string, so I can insert it into a text field. These seems like a simple task, however I cannot find an easy way. Writing an xmlDocPtr to file must do this, however, I cannot see a handy method that will do the same thing to an arbitrary node

How to get attributes from a node in libxml2

僤鯓⒐⒋嵵緔 提交于 2019-11-28 13:37:52
I am working on a parser to get data from an XML file. I am using libxml2 to extract data. I am a not able to get the attributes from nodes. I only found nb_attributes to get the count of the attributes. Matthew Lowe I think joostk meant attribute->children, giving something like this: xmlAttr* attribute = node->properties; while(attribute) { xmlChar* value = xmlNodeListGetString(node->doc, attribute->children, 1); //do something with value xmlFree(value); attribute = attribute->next; } See if that works for you. if you just want a single attribute, use xmlGetProp or xmlGetNsProp I think I

How to get attributes from a node in libxml2

谁说我不能喝 提交于 2019-11-28 08:02:23
问题 I am working on a parser to get data from an XML file. I am using libxml2 to extract data. I am a not able to get the attributes from nodes. I only found nb_attributes to get the count of the attributes. 回答1: I think joostk meant attribute->children, giving something like this: xmlAttr* attribute = node->properties; while(attribute) { xmlChar* value = xmlNodeListGetString(node->doc, attribute->children, 1); //do something with value xmlFree(value); attribute = attribute->next; } See if that