On Fri, Jul 17, 2009 at 06:13:41PM +0200, [email protected] wrote: > Hello, > > I have a simple DTD which has a fixed amount of elements inside. As > I want to create an xml file in my application, i'd like to know if > there is a call that produces an xml tree out of the parsed dtd tree > structure? I have looked in tree2.c and valid.c where such trees and > lookups are made either with xmlAddChild() or xmlHashLookup2().
There is no such generic algorithm because unless your DTD is very constrained the probability of ending up with an useful document is close to 0. What is needed is usually a hierarchy of test trees, and that explodes in memory usage really really fast. Better left as application code. > The second thing, sth that i found out during my experimenting, that > the call xmlParseDTD(ExternalID, SystemID) doesn't really create a tree > as expected. It gives me one root, all elements and their attributes > are listed as the children of the root. I also found this Well your expectations don't really match reality, if you look at what a DTD is, it's basically a list of statements enclosed in a DTD file or header, so the fact you get a flat list of children is IMHO perfectly normal and should be expected. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ [email protected] | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
