From: Gary Pennington (Gary.Pennington@uk.sun.com)
Date: Mon Feb 26 2001 - 06:40:42 EST
Hi,
I have a problem which I'm not sure about how to solve most efficiently
using libxml, so any ideas/pointers would be appreciated.
I am writing a library which will create xml elements for insertion into
a document (which is also created at runtime) which will then be
validated. A lot of my elements carry default or fixed attributes and
I'd like to make the API for creating these elements as simple as
possible. Thus, when a user calls a function to create an element, I'd
like that element to be populated with all the fixed and default
attribute values (which may be retrieved from the DTD).
The problem I have is how to extract all this information from the
DTD and use it when new elements are created? I've tried to create a doc
and associate a DTD with the doc (using xmlCreateIntSubset) which works
fine from a validation point of view. However, any elements that are
created are not populated with values from the DTD, which defeats the
purpose of what I'm trying to achieve.
Anybody got any suggestions?
Gary
PS I tried investigating the xmlGetDtdElementDesc function but could
never get a definition for my elements (only a NULL pointer).
---- Message from the list xml@rpmfind.net Archived at : http://xmlsoft.org/messages/ to unsubscribe: echo "unsubscribe xml" | mail majordomo@rpmfind.net
This archive was generated by hypermail 2b29 : Mon Feb 26 2001 - 08:43:34 EST