I'm reading through the libxml2 API and examples on xmlsoft.com and having some real difficulty wrapping my head around the type system. For example, the _xmlAttribute struct has an xmlChar* field called name. This obviously refers to the name of the attribute (e.g., "bar" for the struct tied to the element <foo bar='baz' />). The _xmlAt...
I'm trying to see how libxml implements XPath support, so it made sense to me to test using xmllint. However, the obvious option, --pattern, is somewhat obscure, and I ended up using something like the following:
test.xml: <foo><bar/><bar/></foo>
> xmllint --shell test.xml
/ > dir /foo
ELEMENT foo
/ > dir /foo/*
ELEMENT bar
ELEMENT b...
How would you convert / cast an xmlChar* to char* from the libxml2 library? Thanks.
...
Hello,
I've got a small problem with parsing XML. I cannot get the name of a child node.
Here's my XML code:
<?xml version="1.1" encoding='UTF-8'?>
<SceneObject>
<ParticleSystem>
</ParticleSystem>
</SceneObject>
Here's how I parse the XML file:
SceneObject::SceneObject(const char *_loadFromXMLFile, const char *_childType)
{
xmlNod...
i'm having a hell of a time installing scrapy on my sl mbp. it requires libxml2, so i set about installing that. installing it from macports doesn't seem to pull down the python binding.
installing it from source through scrapy's instructions (here) does install the python bindings, but when i run 'python -c "import libxml2"' i get an a...
I believe this question might have been previously attempted in 2006 on a different site. But, my current XML/RDF writer (XML::LibXML 1.70) outputs element namespaces in the form of xmlns attributes. This will exclude people using non-namespace aware parsers who just do a look_down for foaf:Person. I'm wondering if anyone knows of an eas...
Trying to install Scrapy on Mac OSX 10.6 using this guide:
When running these commands from Terminal:
cd libxml2-2.7.3/python
sudo make install
I get the following error:
Making install in .
make[1]: *** No rule to make target `../libxslt/libxslt.la', needed by `libxsltmod.la'. Stop.
make: *** [install-recursive] Error 1
Followin...
I am new to iphone development.I want to parse and retrieve a particular content from the HTML file at the url.I have a sample code from this link http://blog.objectgraph.com/index.php/2010/02/24/parsing-html-iphone-development/
NSData *htmlData = [[NSString stringWithContentsOfURL:[NSURL URLWithString: @"http://www.objectgraph.com/...
I'm trying to parse HTML data using KissXML for iphone. I've noticed that I can't have dashes in the id() tag, otherwise it won't evaluate. For example, if I'm trying to get the element at I would do
id("foo")
However, if I try to get at element , and I try
id("foo-bar")
the libxml2 XPATH engine doesn't seem to return anything. It w...
<td></td><td>foo</td>
I would like to return ['', 'foo'] but libxml's xpath //td/text() returns just ['foo']. How do I find the empty tag as '' instead of (not matched)?
...
I have this XML tree that looks like this (I've changed the tag names but if you're really clever you may figure out what I'm actually doing.)
<ListOfThings>
<Thing foo:action="add">
<Bar>doStuff --slowly</Bar>
<Index>1</Index>
</Thing>
<Thing foo:action="add">
<Bar>ping yourMother.net</Bar>
<Index>2</In...
Hello,
I'm currently using libxmlsec into my C++ software and I try to load a RSA private key from memory. To do this, I searched trough the API and found this function.
It takes binary data, a size, a format string and several PEM-callback related parameters.
When I call the function, it just stucks, uses 100% of the CPU time and nev...
I'm looking for a streaming xml pretty printer for C/C++ that's either self contained or that uses libxml2 or expat and has a BSD-ish license. I've searched a bit and not found one. It seems like something that would be generally useful. Am I missing an obvious tool that does this?
Background: I have a library that outputs xml without w...
I'm using libxml2 for SOAP-Actions in an iPhone App.
The big problem is that i want send an SQL-Statement with
NSString *query = @"SELECT test FROM database WHERE test = \"string\""
But libxml2 converts the qotes " into &quot;
Any ideas how to prevent this?
...
Hi,
I'm trying to parse an XHTML document using TBXML on the iPhone (although I would be happy to use either libxml2 or NSXMLParser if it would be easier). I need to extract the content of the body as a series of paragraphs and maintain the inline tags, for example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/T...
Hi,
How can i get name space of an xml file using libxml2.
...
I am using libxml2 in my iPhone app. I have an NSString that holds the pathname to an XML file. The pathname may include non-ASCII characters. I want to get a C string representation of the NSString for to pass to xmlReadFile(). It appears that cStringUsingEncoding gives me the representation I seek. I am not clear on which encoding to u...
This is my code:
<?php
$data = <<<EOL
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<script type="text/javascript">
//<![CDATA[
var a = 123; // JS code
//]]>
</script>
</html>
EOL;
$dom = new DOMDocument();
$dom-...
Ok I am trying to use libxml2 with the iPhone OS 4.0 SDK, but for some reason it is throwing errors. Is this not supported in iPhone OS 4?
...
Hi,
I have xml file nameed Hello as under with starting node as under:
/Hello xmlns:xsi: = "some text" xmlns:xsd = "some text" version="1.0"/
I tried to get the first and second attributes of node named Hello, using
xmlAttr *attr = nodePtr->properties;//nurrent node is Hello
while ( attr )
{
NSLog(@"\n Attribute name:%s value...