Re: [xml] ignoring namespace while parsing a XML file



Is it valid to have multiple nodes, in a single XML file.

<configuration abc:changed-seconds="0" abc:changed-localtime="1970-01-01 00:00:00 UTC" >
<services>
</services>
</configuration>

<configuration junos:changed-seconds="0" junos:changed-localtime="1970-01-01 00:00:00 UTC">
<services>
</services>
</configuration>

-Dheeraj


-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com] 
Sent: Thursday, September 01, 2011 11:58 AM
To: Dheeraj Gautam
Cc: xml gnome org
Subject: Re: [xml] ignoring namespace while parsing a XML file

On Thu, Sep 01, 2011 at 07:47:42AM +0530, Dheeraj Gautam wrote:
Hello,

Is it possible to ignore the namespace while parsing a XML file? I tried the parse the file using 
xmlParseFile(). 

I am getting following errors:
origin-map-config.xml:1: namespace error : Namespace prefix abc for changed-seconds on configuration is not 
defined
uration abc:changed-seconds="0" abc:changed-localtime="1970-01-01 00:00:00 UTC"

<configuration abc:changed-seconds="0" abc:changed-localtime="1970-01-01 00:00:00 UTC" >
<services> </services>
</configuration>

  It's a namespace error, not an XML-1.0 error, so you get the error
but the parsing completes and you get the data, that sounds normal. For
interoperability libxml2 should really report namespace errors as
this is now an expected part of the XML processing stack.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



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