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

On Fri, Mar 23, 2007 at 05:25:47PM -0400, Kali, Jayashree wrote:
Thanks for your instant reply. But my requirement is if the first node
is the main node containing other nodes I need to ignore it. But if it
contains that data then I need to include it.

  From an XML point of view the parser cannot ignore it. Either you
detect and ignore it at your level after parsing (and it's dependant on
how you process the data) or you have to get it stripped out with non-XML
tools before handling it to the parser. I don't see any other possibilities
and in either case, it's fully dependant on how your code work, not on
how libxml2 works.


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]