[MarkLogic Dev General] Trailing Spaces Removed from Attribute Values--Bug or Feature?

Eliot Kimber ekimber at reallysi.com
Mon Mar 10 20:22:16 PST 2008


In storing some DITA documents into MarkLogic I discovered that the 
trailing spaces in the DITA class= attributes are not preserved. I 
created a simple test and got the same behavior, e.g.:

xdmp:document-load("test.xml", <root foo=" bar "/>)

<result>{doc("text.xml")/@foo}</result>

Returns:

<result>bar</result>

not

<result> bar </result>

The DITA standard requires the trailing spaces in the class= values 
because the value is a sequence blank-delimited tokens where you need to 
be able to match on " {token} " so you don't get false positives (for 
example, the "topic" type is the token "topic/topic", without the 
spaces, a search for "topic/topic" would also match "mytopic/topic-foo", 
which would be bad.

My question is: is this behavior unalterable or is it configurable?

This behavior does make it impossible to use DITA documents stored in 
MarkLogic with any normal DITA-aware processor (because they all expect 
there to be a trailing space in the class= value) without some serious 
workaround (essentially a post-fetch fixup to add back in the trailing 
space).

Cheers,

Eliot

-- 
Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 610.631.6770
www.reallysi.com
www.rsuitecms.com


More information about the General mailing list