Re: [xml] How do you detect if a xml file has a root node??

On Fri, Mar 23, 2007 at 10:55:59AM -0400, Kali, Jayashree wrote:
How do I detect if the file has a root node or not? 

  An XML file has one and only one root node, by definition,

I mean how do I make the difference between the below xml file and the
above xml file.

<!-some comment generated.."  -->




  There is still only one root node here, 

I need to know it before parsing the whole file, 

  I don't think you can, and I feel some confusion


Red Hat Virtualization group
Daniel Veillard      | virtualization library
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]