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



Hello!

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">
<root>
  <child>
    <elem attr="val"/>
  </child>
</root>

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?

Regards, Dmitry




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