At Wed, 9 Jul 2014 11:08:00 -0400,
Trail, Nate wrote:
>
> [1 <text/plain; utf-8 (base64)>]
> [2 <text/html; utf-8 (base64)>]
> If you˘re using xslt to render the field into HTML, you can use <xsl:preserve-space elements="mods:nonSort"/>
>
> http://www.w3schools.com/xsl/el_preserve-space.asp
>
> That may also be useful for long note fields.
>
<xsl:preserve-space> and <xsl:strip-space> only deals with withspace-only nodes.
See http://www.w3.org/TR/xslt#strip
Trimming text nodes or better: whitespace-normalization is achived
with the normalize-space() function.
HTH,
-- David
> Nate
>
> -----------------------------------------
>
> Nate Trail
>
> LS/TECH/NDMSO
>
> Library of Congress
>
> From: Metadata Object Description Schema List [mailto:[log in to unmask]] On Behalf Of Terence H. Catapano
> Sent: Wednesday, July 09, 2014 10:55 AM
> To: [log in to unmask]
> Subject: Re: [MODS] Losing whitespace from nonSort element
>
> Vicky,
>
> Leading or trailing white space in XML elements and attributes can often be trimmed in processing or in other contexts (e.g., pretty printing). You can try explicitly encoding the space by using the numeric character entity  
> (non-breaking space). You might also consider inserting the space when the data is processed/rendered rather than encoding it as data.
>
> Hope this helps,
>
> Terry
>
> On Wed, Jul 9, 2014 at 10:09 AM, Vicky Phillips <[log in to unmask]> wrote:
>
> 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?
> Many thanks,
> Vicky
> Digital Standards Manager
> National Library of Wales
>
>
--
David Maus
Herzog August Bibliothek - D-38299 Wolfenbuettel
Bibliothekarische IT / Digital Humanities
Phone: +49-5331-808-317
Email: [log in to unmask]
PGP Key 0x7B4F5A762AF6FBA6
Fingerprint DD38 8D2E 34C1 94DE 2058 69BE 7B4F 5A76 2AF6 FBA6
|