Re: [xml] Why <!DOCTYPE> considered as the root element

On Tue, Oct 30, 2001 at 01:31:58AM +0300, k_f_d mail ru wrote:

Can anyone explain me why I have the folllowing problem. Say, 
I'm trying to parse with libxml the XML file like this:

<?xml version="1.0"?>
<!DOCTYPE testfile SYSTEM "blah-blah">
    <elem attr="val"/>

libxml counts `testfile' as the root element -- the only element 
in the document! If I removing the second line (<DOCTYPE...>), 
the problem disappearing. What am I doing wrong?

  You're assuming doc->children is the root element, this is wrong !


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]