Re: [xml] Listing possible valid attributes

That sounds like it might work! I will give it a try.

--- On Wed, 10/7/09, Daniel Veillard <veillard redhat com> wrote:

From: Daniel Veillard <veillard redhat com>
Subject: Re: [xml] Listing possible valid attributes
To: "D Haley" <mycae yahoo com>
Cc: xml gnome org
Date: Wednesday, October 7, 2009, 2:50 AM
On Sat, Oct 03, 2009 at 01:34:02AM
-0700, D Haley wrote:

I have been hunting around the API, but I cannot seem
to find any way to obtain a list of attributes as specified
by the DTD for a given type of node.

I am basically building a simple XML writing "helper"
app and I would like to show users what their attribute
options are. Does anyone know how I might do this, or where
I should look?

  Hum, right, there is no equivalent to
but for attributes... The solution is:
 - use xmlGetDtdElementDesc/xmlGetDtdQElementDesc to find
the DTD
   element description for the element
 - walk the list of struct _xmlElement returned called
   IIRC the list use the ->next link to
get to the next attribute
   on that node (nexth is used internally
for the attribute hash table
   of the full DTD).


Daniel Veillard      | libxml Gnome XML XSLT
daniel veillard com 
| Rpmfind RPM search engine | virtualization library

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