Re: [xml] SAX-like parsing of DTDs

On 27Feb, Daniel Veillard wrote:
On Thu, Feb 27, 2003 at 07:51:25AM -0800, Mark S Petrovic wrote:
Good day.

Does libxml2 expose an API for performing basic parsing of a DTD -
specifically providing the ability to sense when an attribute declaration
appears in the input stream?  I am looking for the DTD-equivalent of
SAX-based parsing of an XML stream.  My goal is to assemble the logical

  What about looking at it before asking ? Just laziness ?


Thank you for the pointer.

 * attributeDeclSAXFunc:
 * @ctx:  the user data (XML parser context)
 * @elem:  the name of the element
 * @fullname:  the attribute name
 * @type:  the attribute type
 * @def:  the type of default value
 * @defaultValue: the attribute default value
 * @tree:  the tree of enumerated value set
 * An attribute definition has been parsed.
typedef void (*attributeDeclSAXFunc)(void *ctx,
                                const xmlChar *elem,
                                const xmlChar *fullname,
                                int type,
                                int def,
                                const xmlChar *defaultValue,
                                xmlEnumerationPtr tree);

struct _xmlSAXHandler {
 attributeDeclSAXFunc attributeDecl;

where the attributeName_i are ordered in the order in which they are
declared in the DTD.

  I already said it made no sense to try to build an order.

Yes, I remember well, and respect that fact.  However, I am forced
to deal with an existing infrastructure that demands I know the order.
You may argue that this is not, then, XML according to the spirit of XML.
I will not contest - nor can I reasonably hope to change my condition.



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]