[xml] whitespace significance

Date view Thread view Subject view Author view

From: R.vd.Leek@fokkerspace.nl
Date: Wed Oct 18 2000 - 11:01:12 EDT


Just before submitting this comment i found documentation on it
in the upgrade instructions.. maybe a good idea to still add a
FAQ entry since new users aren't likely to read upgrade instructions.
The main document should also be updated ("the tree output" section).

-- start original msg

Sorry to bother you all with this, but shouldn't this question
deserve an entry in the FAQ? Note that i started out with libxml
today (and XML in general) so forgive my ignorance.

The problem is simple; how significant is whitespace between tags?
For example, the libxml docs suggest that the following XML:

<head>
   <title>Welcome to Gnome</title>
</head>

should create an internal DOM tree like:

ELEMENT head
  ELEMENT title
    TEXT
    content=Welcome to Gnome

instead the xmllint util packed with my libxml 2.2.4 version
gives:

ELEMENT head
  TEXT
  content=
  ELEMENT title
    TEXT
    content=Welcome to Gnome
  TEXT
  content=

A way to ignore the whitespace is to call xmlKeepBlanksDefault(0);
before parsing.

shouldn't this be noted in a FAQ or other documentation??

rob.

--
Rob van der Leek
Fokker Space b.v.
Remote Sensing Group
e-mail: r.vd.leek@fokkerspace.nl
tel.: +31-(0)71-5245531
----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Oct 18 2000 - 11:43:47 EDT