From: Daniel Veillard (Daniel.Veillard@imag.fr)
Date: Thu Jan 18 2001 - 03:55:54 EST
On Wed, Jan 17, 2001 at 03:48:04PM -0500, H.-Arno Jacobsen wrote:
>
>
> Hi,
>
> has anybody written a function to automatically generate
> XML documents from a provided DTD for libxml ?
Not that I know of.
The main problem is that it is hard to make such a function
given that a DTD can generate (quite often) an infinity of
document instance conforming to it. A DTD which would generate
a single instance is possible but I have never seen one :-)
You could write a big ball of heuristics and try to get one
document generated but chances are very high that it would
not suit the needs of the caller...
There is 2 functions which could help if you're trying to
automatically generate such a tree (or a list of choices
in a GUI):
- xmlValidGetValidElements ()
http://xmlsoft.org/html/gnome-xml-valid.html#XMLVALIDGETVALIDELEMENTS
- xmlValidGetPotentialChildren ()
http://xmlsoft.org/html/gnome-xml-valid.html#XMLVALIDGETPOTENTIALCHILDREN
Daniel
-- Daniel Veillard | Red Hat Network http://redhat.com/products/network/ veillard@redhat.com | libxml Gnome XML toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ ---- 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 : Thu Jan 18 2001 - 04:44:47 EST