Re: [xml] followup on inserting dtd



Daniel Veillard wrote:
On Sun, Apr 07, 2002 at 03:26:54PM +0800, Deryk Robosson wrote:

Okay, I managed to find the thread:

http://mail.gnome.org/archives/xml/2002-January/msg00226.html

The search facility is rather useless..manually skimming the subjects
was
the key.  However, the final entry of that thread is exactly the state
that I am in also.  Doing it the way Daniel suggests as:

 doc = xmlNewDoc("1.0");
 dtd = (xmlDtdPtr) xmlParseDTD("netlogon",
"/home/deryk/netlogon/netlogon.dtd");

 /* here to ... are Daniels suggested methods */
 doc->intSubset = dtd;

 if(doc->children == NULL)
   xmlAddChild((xmlNodePtr)doc, (xmlNodePtr)dtd);
 else
   xmlAddPrevSibling(doc->children, (xmlNodePtr)dtd);
 ...
 xmlDocDump(stderr, doc);


  Looks correct,


Still does not insert the external doctype reference into the document
as
one would expect.  The document itself is generated fine no problems.


  Damn, well there is only One True Way: take a debugger, put a
breakpoint
in xmlDocDump and see what happens. I could do this, but you are in a
better
situation to do it, isn't it ?


I did have some free time this evening so I gave it a whirl.  I did a cvs
update just to make sure I was current, compiled with the debug module
enabled and recompiled my test source including the above snippet.
Setting the LD_LIBRARY_PATH to the appropriate location and cranking up
gdb I spent around 15 minutes or so stepping through the library internals
after initially hitting the xmlDocDump breakpoint.  The only time I saw
reference to DTD was a series of if(blah==FOO_DTD) (greps source
looking.....) which appears to be from xmlNodeDump() in tree.c if(cur-type
== XML_DTD_NODE) but using gdb's stepi xmlDtdDump was never called.

(digs a bit more setting breakpoint at xmlAddchild())

xmlAddChild() as written above is being called.

If I can provide any further information let me know..I'll debug until the
cows come home to get this worked out =) (Keeping in my mind that I could
just as easily scrap the dtd idea..but I'm wanting it there for
completeness)

--
Regards,
Deryk Robosson

Robosson Business Services
22 Flemington Street
Albany, WA  6330
ABN: 56 728 377 499
Phone: +61 4 0842 9835 Email: deryk 0x0a com




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