Re: [xml] xmllint - Newbie THINKS there may be a whitespace error in 2.6.23



On Tue, Apr 25, 2006 at 02:50:08PM -0500, John Navratil wrote:
I thought that --noblanks would strip the whitespace and eliminate the 
error, 

paphio:~/XML -> xmllint --noblanks test.xml
<?xml version="1.0"?>
<A><B ID="1">
</B></A>
paphio:~/XML ->

  --noblanks won't eliminate that 'blank' node

Is this behavior correct?

  By definition no. --noblanks is a deviation from the spec, all white spaces
in content are significant at the XML parser level and must be retained,
that option is by definition a non-conformant behaviour, and you can't 
have any garantee about it.

If I remove the required attribute ("ID") from the schema 
and the document, this behavior is not observed.

  Not what I am seeing:

paphio:~/XML -> xmllint --noblanks test.xml
<?xml version="1.0"?>
<A><B>
</B></A>
paphio:~/XML ->

  Well, don't rely on this option, really.

Daniel

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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