After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 169838 - XML_PARSE_NOBLANKS difference regarding CRLF and LF
XML_PARSE_NOBLANKS difference regarding CRLF and LF
Status: VERIFIED DUPLICATE of bug 166777
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-03-10 14:44 UTC by kbuchcik
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test-lf.xml, with LF (66 bytes, text/xml)
2005-03-10 14:47 UTC, kbuchcik
Details
test-crlf.xml, with CRLF (68 bytes, text/xml)
2005-03-10 14:48 UTC, kbuchcik
Details

Description kbuchcik 2005-03-10 14:44:37 UTC
Please describe the problem:
I noticed a difference between parsing with XML_PARSE_NOBLANKS.

Given the following XML:
 
<?xml version="1.0" encoding="iso-8859-1"?>
<foo> 
<bar/> 
</foo>

in the first variant, which has only a LF after the tags:

kbu@librax:/data/home/kbuchcik/gnomecvs/tests$ od -a test-lf.xml
0000000   <   ?   x   m   l  sp   v   e   r   s   i   o   n   =   "   1
0000020   .   0   "  sp   e   n   c   o   d   i   n   g   =   "   i   s
0000040   o   -   8   8   5   9   -   1   "   ?   >  cr  nl   <   f   o
0000060   o   >  sp  nl   <   b   a   r   /   >  sp  nl   <   /   f   o
0000100   o   >
0000102

and the second variant, which has a CRLF after the tags:

kbu@librax:/data/home/kbuchcik/gnomecvs/tests$ od -a test-crlf.xml
0000000   <   ?   x   m   l  sp   v   e   r   s   i   o   n   =   "   1
0000020   .   0   "  sp   e   n   c   o   d   i   n   g   =   "   i   s
0000040   o   -   8   8   5   9   -   1   "   ?   >  cr  nl   <   f   o
0000060   o   >  sp  cr  nl   <   b   a   r   /   >  sp  cr  nl   <   /
0000100   f   o   o   >
0000104

results in the tree having text-nodes with the latter variant.


Steps to reproduce:
Compare the debug output of the files I will attach with xmllint:

xmllint --noblanks --debug test-lf.xml
xmllint --noblanks --debug test-crlf.xml


Actual results:
kbu@librax:/data/home/kbuchcik/gnomecvs/tests$ xmllint --noblanks --debug test-
lf.xml
DOCUMENT
version=1.0
encoding=iso-8859-1
URL=test-lf.xml
standalone=true
  ELEMENT foo
    ELEMENT bar

kbu@librax:/data/home/kbuchcik/gnomecvs/tests$ xmllint --noblanks --debug test-
crlf.xml
DOCUMENT
version=1.0
encoding=iso-8859-1
URL=test-crlf.xml
standalone=true
  ELEMENT foo
    TEXT
      content=
    ELEMENT bar
    TEXT
      content=





Expected results:


Does this happen every time?


Other information:
Comment 1 kbuchcik 2005-03-10 14:47:23 UTC
Created attachment 38508 [details]
test-lf.xml, with LF
Comment 2 kbuchcik 2005-03-10 14:48:38 UTC
Created attachment 38509 [details]
test-crlf.xml, with CRLF
Comment 3 Daniel Veillard 2005-07-06 15:20:12 UTC

*** This bug has been marked as a duplicate of 166777 ***