Hi Will,

I think this has to do with how MarkLogic serializes XML.

What version of MarkLogic are you using?  There were some changes made in 4.2-4 
that should make your output return this unindented.  

You can also use the xdmp:output prolog option in your xquery to explicitly set 
the output.  In this case, this is untyped-xml (XML that has no schema in 
scope).

So I recommend trying this in 4.2-4 and see if that does what you want.

-Danny

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Will Thompson
Sent: Friday, May 06, 2011 11:52 AM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] cts:highlight adding new line/carriage return

Cts:highlight sometimes automatically formats its output to include new lines 
after certain elements. 

let $p := <p>Follow this <a href="#">link</a>.</p>
return cts:highlight($p,"link",<b>{$cts:text}</b>)

returns:

<p>Follow this <a href="#">
    <b>link</b>
  </a>.</p>

This results in HTML that renders the newline as an extra space before the 
period.  However, if there is additional non-highlighted content, it's not 
formatted this way.

let $p := <p>Follow this <a href="#">link, too</a>.</p>
return cts:highlight($p,"link",<b>{$cts:text}</b>)

returns:

<p>Follow this <a href="#"><b>link</b>, too</a>.</p>

I need the latter output style to happen every time - otherwise, some links 
will have an undesired space before the period.  But the former example is the 
most common in my application.  Can anyone recommend a way to handle this?

Thanks,

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

Reply via email to