Hi,
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 th...
hello,
I am pasting some code here that compiles with no warning using gcc file.c -lxml2, assuming that libxml2 is installed in your system.
#include libxml/parser.h>
#include libxml/xpath.h>
#include assert.h>
#include libxml/tree.h>
#include libxml/xpathInternals.h>
xmlDocPtr
getdoc (char *docname) {
xmlDocPtr doc;
doc = x...
When using libxml2 to parse non-UTF8 encoded HTML, htmlDocContentDumpOutput returns empty data.
URL used to test : http://www.asahi.com/national/update/0628/TKY201006280289.html and askmen.com
I don't know encoding used before hand.
NSData * data = [[NSData alloc] initWithContentsOfURL:_url options:0 error:&error];
CFStringEncoding cf...
Hi guys,
I have the need to parse partial XML fragments (which are presented as std::string), such as this one:
<FOO:node>val</FOO:node>
as xmlDoc objects in libxml2, and because these are fragments, I keep getting the namespace error : Namespace prefix FOO on node is not defined errors spit out into STDERR.
What I am looking for is ...
I'd like to show the memory peak (not 'leak', but the highest quantity of memory used in small amount of time) of an iPhone app i am running in the simulator. Where shall i look precisely?
PS I am using libxml2 and i suppose that the allocations done by the library aren't considered
...
i have soap based Xml using that soap message i want to perform libxml parsing also perform lazy loading so how can i perform it please any one have idea about it then please help me.
...
hi.
using python 2.4/2.5, with libxm2dom.
trying to get my haed around a question/issue that I'm considering.
I have a doc
I import the doc, and can build the DOM (libxml2dom)
I'm trying to figure out if there's a way to programatically "search" for a given term, and be able to craft the XPath function to extract the href for the te...
Say I have an invalid XML. For some reason, TouchXML still sees it as a valid object.
For example:
NSString *str = @"?> obviously invalid!";
NSData *data = [str dataUsingEncoding:NSASCIIStringEncoding];
NSError *parseError = nil;
CXMLDocument *document = [[[CXMLDocument alloc] initWithData:data encoding:NSASCIIStringEncoding options:0...
I have a problem with retrieving information from a XML tree.
My XML has this shape:
<?xml version="1.0"?>
<records xmlns="http://www.mysyte.com/foo">
<record>
<id>first</id>
<name>john</name>
<papers>
<paper>john_1</paper>
<paper>john_2</paper>
</papers>
</record>
<record>
<id>second</id>
<...
Hello every one!
Has any one managed to use libxml2 with axis2c. Please correct me if i am wrong , if one goes with libxml2, all parsing/creation will be done by libxml2 api and not axiom api.. I would love to see a simple example for managing requests & response.I had a look at the wrapper classes , unfortunately i can not make how to...
I'm trying to get MinGW and MSYS working so I can build iconv and libxml2 in Windows, but I'm finding ./configure and make are giving lots of BSD/Unix related errors that aren't specific enough to google, and not descriptive enough for me to figure out. Can anybody go through some of the steps needed to get iconv and libxml2 .dll/.lib b...
Hi! I want to load collada with libxml2.
I get the COLLOADA node, okay, then I try to get the children tag - FAIL, the children tag name is "text".
Why? How can i get the child of COLLADA node?
xmlNode* geometries = xmlDocGetRootElement(doc)->children;
//at THIS point the geometries->name == "text" WHY?
//IS not it supposed to be "as...
I have xampp 1.7.1 installed on linux, and i need to update libxml2 to version 2.7.3. Can anyone help me? I suppose that i need to recompile php but first i need to install libxml2 and i don't know how.
Thanks in advance,
...
I'm trying to read and handle a web-page in Python which has lines like the following in it:
<div class="or_q_tagcloud" id="tag1611"></div></td></tr><tr><td class="or_q_artist"><a title="[Artist916]" href="http://rateyourmusic.com/artist/ac_dc" class="artist">AC/DC</a></td><td class="or_q_album"><a title="[Album374717]" hr...
I am use libxml2 for XML parsing. The sample code on the libxml website are hard to follow and seem to lack some details. I arrived at the following code by Googling so I don't even think it's the proper way to do it, but it worked in the sample learning program I wrote, but not this one. I still don't know the proper way to use libxml i...
I'm using libxml2 and C++. The following function crashes here at return (char*)cur->content;. When I change it to return (char*)cur->name; then it will return attribute which is the name of the tag. What I want is 1, 2, and 3 (based on the XML file below the C++ code). What am I doing wrong?
char* xml2sdf::getId(xmlNode* part){
xm...
So, when it comes to xml, is using libxml or xpath faster?
...
I'm downloading HTML from a website. The file can be quite large so while the file's downloading, I want to already parse the available chunks of HTML so that the process appears faster for the end-user of my program. I don't have control over how the cunks are generated, so a chunk can begin in the middle of a word, e.g. like so:
chunk...
Hello,
I would like to know the best way to parse a large amount of xml from stdin (data getting piped) into a program I am writing using libxml2. I can parse fine using a reader from the function xmlTextReaderPtr reader = xmlNewTextReaderFilename(filename) when I have a char * to the name of the file. I would preferably like to wind...
I'm using libxml2 to parse HTML:
static htmlSAXHandler simpleSAXHandlerStruct = {
NULL, /* internalSubset */
NULL, /* isStandalone */
NULL, /* hasInternalSubset */
NULL, /* hasExternalSubset */
NULL, /* res...