Re: [xml] parsing DTD



On Fri, Oct 05, 2001 at 05:38:06PM +0200, Filippo Mariani wrote:
Hi,

I'v just started to use libxml and I'm trying to access the content of an
element in a dtd declaration. For example I need to access what the element
'doc' contains in the following declaration:

<!ELEMENT doc (a+, b, c*)>

Using the function:

  xmlElementPtr   xmlGetDtdElementDesc    (xmlDtdPtr dtd,
                                           const xmlChar *name);

I am able only to get the name of the first child of the element doc:

xmlElementPtr ele;
ele=xmlGetDtdElementDesc(dtd, "doc");

ele->content->c1->name returns "a"
ele->content->c2->name returns nothing (I don't know why)

How can I get the name of the third element?

 the xmlElementContent ele->content generated should be 

 -> SEQ -> SEQ -> c
     |      | 
     a      b

 ele->content->c2->c2->name
The value for name is defined only if type == XML_ELEMENT_CONTENT_ELEMENT
you were looking for a node with type == XML_ELEMENT_CONTENT_SEQ

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]