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 

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

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


Daniel Veillard      | Red Hat
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]