I need to take an existing xml file, and modify just a few attributes and write the file back out.
I was thinking of using libxml2 to get this done. Application is C/C++ running on Linux.
Thing is, libxml2 seems to include several variations of the kitchen sink, along with portable washrooms, showers, and various other things connecte...
Is it possible to use libxml with unicode?
For example the xmlParseDoc function takes an xmlChar
xmlChar has the following definition:
typedef unsigned char xmlChar;
I would like for libxml to interpret all as 2 byte chars.
I have a feeling that the following would not work properly with the lib:
typedef unsigned short xmlChar;
...
I cannot find comparison of these parsing technique. Which one is most commonly used?
Regards.
Mustafa
...
Hi,
To sum up, i'm a totally beginner in libxml and I have to use an existing source code. The main idea is to apply a first xpath expression to extract a set of nodes from an xml file. Then, for each node, the second xpath expression shall be applied to extract some values.
Existing source code is:
int xt_parseXmlResult(xmlDocPtr doc...
I am trying to install a copy of PHP 5 to my home directory on the school computer. The problem is that whenever I try, it complains that my copy of libxml2 is too outdated to work.
Is there any way I can install this without upgrading libxml2, since I don't have permission to upgrade.
Any suggestions?
...
I'm writing a static library for the iPhone and I'm wondering if what I'm doing is recommended or if I should take a different approach.
The static library I'm writing is dependant on libxml2. libxml2 has a dynamic library (dylib) and a static library (a). I've tried two approaches.
Approach one - When I attempt to link against the s...
I was looking for a better (well documented and efficient) xml processing C library.
¿ Ideas ?
...
I'm trying to make an XPath query with TouchXML, but if the query fail, the programm crash immmediately.
Is there any way to prevent this and continue the execution of the programme.
I know that TouchXML is based on libxml2 and that lib have an option called XML_PARSE_RECOVER but i don't know how to use it with TouchXML.
Source code
...
I'm using libxml2 in a Python app I'm writing, and am trying to run some test code to parse an XML file. The program downloads an XML file from the internet and parses it. However, I have run into a problem.
With the following code:
xmldoc = libxml2.parseDoc(gfile_content)
droot = xmldoc.children # Get document root
dchild = d...
I'm using this program to display a list of all html tags in a given file:
#include <cstdio>
#include <libxml/HTMLparser.h>
#include <libxml/tree.h>
#include <iostream>
#include <cstring>
using namespace std;
static void
print_element_names(htmlNodePtr a_node)
{
htmlNodePtr cur_node = NULL;
for (cur_node = a_node; cur_node!=N...
I've encountered (what I think is) a strange behavior when using the sax parser, and I wanted to know if it's normal.
I'm sending this XML through the SAX parser:
The "& a m p ;" gets converted to " & # 3 8 ;" when the startElement callback
is called. Is it supposed to do that? If so, I would like to
understand why.
I've pasted an...
I wrote a program for linux using libxml2 for html parsing. Although it does its job, the html parser writes lots of various errors to stderr. Is it possible to disable stderr at all (or redirect it to /dev/null while not having to run it with a redirecting shell script)? I can live with having to write my own errors to stdout, I just wa...
Default Getting Memory Issues when Using Libxml2
Hi all,
This is the code we are using for application,I fgiving where we are getting the leaks.
(void)connectionNSURLConnection *)connection didReceiveDataNSData *)data {
xmlParseChunk(context, (const char *)[data bytes], [data length], 0);
Here we are getting the leak
}
(void)dow...
Hi all,
I am working on a parser to get data from xml file,I am using libxml2 to extract data.I am a
not able to get the attributes from nodes,I am using nb_attributes to get the count of the attributes,Can some one help me out
Thank You
...
I have an xml file that looks like the following
<siteinfo>
...
</siteinfo>
<page>
<title>...</title>
<revision>
...
<revision>
</page>
It does not have a root/enclosing node so I get the "extra content at end of document" on running my program. After opening the file for parsing using libxml, is there a way to easily add ...
I am working with a Wikipedia XML dump that is encoded in UTF-8. Right now, I am reading in everything as std::string, so when I std::cout to the screen, foreign characters are displayed as jibberish.
The actual parsing process only looks for ASCII characters though, but when I write the parsed file to disk, I want to preserve the fore...
How can I copy the xmlNodeSet from from a xmlXPathObject?
This is my code now:
xmlNodeSet *get_nodes( xmlDoc *doc, xmlChar *xpath ) {
xmlXPathContext *context;
xmlXPathObject *object;
xmlNodeSet *nodeSet;
xmlXPathObject *nObj;
context = xmlXPathNewContext( doc );
object = xmlXPathEvalExpression( xpath, c...
Update: It appears that a recent XCode update may have changed this macro, please see this Question & Answer for more information: http://stackoverflow.com/questions/2292694/obtaining-older-sdkroot-behavior-in-xcode
Situation: I'm using libxml2 on an iPhone project and I've added it as relative to the SDK version. However, in order to...
I would like to validate a user-provided XPath query to ensure that it is syntactically correct.
Does it make sense to "validate" an XPath query without an XML document?
How can i achieve such a thing in libxml?
...
Apart from lxml, is anyone aware of Python packages that depend on libxml2 and libxslt?
...