Re: [xml] DTD navigation within libxml

On Wed, Jan 09, 2002 at 02:43:00PM +0000, james binks wrote:
The question I have for the list is how do I find out how many subelements 
an element may contain ?

e.g. in my DTD I have

I'm trying to extract the logic that ACCUNIT may contain zero or more 
COUNTER elements then optional REJECTREASON and SYSTEM elements. Do 
functions/properties exist that could give me this info, where should I be 
looking ?

  I the DTD you will get nodes xmlElementPtr for each of the element
declarations. The structure is defined in tree.h
   That structure has an  xmlElementContentPtr content field which conatains
the element content. The various structures and enums are described in

 Since the validation is based on those informations they are complete.
Note that the existing function:
  xmlValidGetPotentialChildren() in valid.c

  probably does most of what you seems to look for. Alos look at
Apologies if this is a dumb question, I'm pretty new to the world of XML but 
desperately trying to get up to speed in it for a demanding project at work 
! Any assistance much appreciated,

  It's not related to learning XML but learning the libxml library internals.
Very different.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

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