MarkLogic Server 4.0 only normalizes whitespace if there is a schema that says 
that attribute should be normalized.  This is a change from 3.2.  Here is the 
relevant section from the 4.0 release notes 
(http://developer.marklogic.com/pubs/4.0/books/relnotes.pdf) regarding this:

Attribute Whitespace No Longer Normalized

In 4.0 in all XQuery dialects, attribute whitespace is only normalized if the 
attribute uses a schema type that includes whitespace normalization. In 3.2, 
all attribute whitespace was normalized. The following illustrates this change:

    fn:string(<my-element my-att="  hello   there  ">
               content</my-element>/@*)
    (: returns the string "  hello   there  " in 4.0 and
       returns the string "hello there" in 3.2 :)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Blakeley
Sent: Friday, September 26, 2008 9:25 AM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] Preserving whitespace in attributes

Geert,

I tried your test case with 4.0-1 (and cq 4.0-1.1) on linux x86_64. The 
whitespace was not trimmed, irrespective of the xmlspace setting, and 
the result was:

   <test att="bla  bla " att2="bla2  bla2 "/>

-- Mike

Geert Josten wrote:
> Hi all,
> 
> I have what seems to me a simple question: how to create an attribute that 
> starts or ends with white-space and/or has multiple occurrences of 
> white-space characters behind each other?
> 
> Something like:
> declare xmlspace = preserve
> <test att="bla  bla&#32;">{attribute {'att2'} {'bla2  bla2 '}}</test>
> 
> Results in:
> <test att="bla bla" att2="bla2 bla2"/>
> 
> Are there other ways of creating attribute, which do result in the expected:
> <test att="bla  bla " att2="bla2  bla2 "/>?
> 
> It looks like the attribute values are passed through normalize-space, but as 
> far as I can determine that is against the XML recommendation. 
> (http://www.w3.org/TR/1998/REC-xml-19980210#AVNormalize) Am I missing 
> something obvious? Or is there a particular reason for this behaviour?
> 
> Note: haven't had time to install 4.0, so the above was tested in 3.2.4. Does 
> 4.0 respond differently on the above statement?
> 
> Kind regards,
> Geert
> 
> 
> Drs. G.P.H. Josten
> Consultant
> 
> 
> http://www.daidalos.nl/
> Daidalos BV
> Source of Innovation
> Hoekeindsehof 1-4
> 2665 JZ Bleiswijk
> Tel.: +31 (0) 10 850 1200
> Fax: +31 (0) 10 850 1199
> http://www.daidalos.nl/
> KvK 27164984
> De informatie - verzonden in of met dit emailbericht - is afkomstig van 
> Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
> bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
> bericht kunnen geen rechten worden ontleend.
> 
> 
> 
> _______________________________________________
> General mailing list
> [email protected]
> http://xqzone.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to