Re: [xml] problem reading attributes in XML with DTD
- From: Rob Richards <rrichards ctindustries net>
- To: oliverst online de
- Cc: xml gnome org
- Subject: Re: [xml] problem reading attributes in XML with DTD
- Date: Wed, 19 Oct 2005 08:54:05 -0400
oliverst online de wrote:
I am trying to read the attributes in an XML with a DTD (http://www.breaken.de/temp/output.xml) and for soem reason I
don't get the attributes with the node with xmlGetProp(). I read in the manual, that it does look for the #FIXED or
default declarations unless DTD validation has been turned off. I have no DTD validation activated (I assume passing 0
as the last parameter in xmlReadFile() truns it off) and I don't get anything from xmlGetProp(). If I look at the
properties, I can clearly, that the first one is the one I am looking for ("name"). If I remove the DTD part
in the XML it does parse it fine, but I don't want to remove, as this XML is automatically created.
You aren't getting anything because you are reading the DTD (still part
of tree). The DTD is the first child of your doc. Use
xmlDocGetRootElement to get your root.
xmlNodePtr root = xmlDocGetRootElement(doc);
Rob
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]