Am 10.07.2014 08:31, schrieb David Maus:
> At Thu, 10 Jul 2014 07:52:08 +0200,
> Thomas Scheffler wrote:
>>
>> Am 09.07.2014 16:09, schrieb Vicky Phillips:
>>> Hi,
>>> We seem to be losing the whitespace when formating xml e.g.
>>>
>>> <nonSort>Yr </nonSort>
>>> <title>Annibynwr</title>
>>>
>>> becomes
>>>
>>> <nonSort>Yr</nonSort>
>>> <title>Annibynwr</title>
>>>
>>> Any suggestions as to what we should do in order to retain this whitespace?
>>
>> Hi,
>>
>> try this:
>>
>> <nonSort xml:space="preserve">Yr </nonSort>
>>
>> It should work this way. But it finally depends on the quality of your
>> XML formatting tool.
>>
>
> I'm pretty sure that @xml:space does not help here, either. This
> attribute is also about whitespace-only nodes.
Hi,
you are mistaken here. The XML 1.0 standard
(http://www.w3.org/TR/xml/#sec-white-space) clearly states:
"The value 'preserve' indicates the intent that applications preserve
all the white space. This declared intent is considered to apply to all
elements within the content of the element where it is specified, unless
overridden with another instance of the xml:space attribute."
There is nothing mentioned about whitespace-only nodes here. It is also
not required to follow xml:space='preserve' for any XML tool, but most do.
regards,
Thomas
--
Thomas Scheffler
Friedrich-Schiller-Universität Jena
Thüringer Universitäts- und Landesbibliothek
Bibliotheksplatz 2
07743 Jena
Phone: ++49 3641 940027
FAX: ++49 3641 940022
|