Thanks, Danny. Turns out we were not handling the XHTML namespace. Once we did that, it worked as you describe.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Danny Sokolsky Sent: Wednesday, July 18, 2012 5:30 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:highlight and phrase-through/phrase-around Hi Stewart, Yes, I believe it does, but depending on how you use it, you might end up with several highlights for a phrase through (or around). For example, the following (b in the xhtml namesapce is a phase-through by default): xquery version "1.0-ml"; let $node := <html xmlns="http://www.w3.org/1999/xhtml"> <body> <p>this is a <b>bold</b> phrase</p> </body> </html> return ( cts:highlight($node, "a", <span class="highlight" xmlns="http://www.w3.org/1999/xhtml">{$cts:text}</span>), cts:highlight($node, "a bold", <span class="highlight" xmlns="http://www.w3.org/1999/xhtml">{$cts:text}</span>), cts:highlight($node, "a bold phrase", <span class="highlight" xmlns="http://www.w3.org/1999/xhtml">{$cts:text}</span>) ) returns the node marked up as follows for the 3 cases: <html xmlns="http://www.w3.org/1999/xhtml"> <body><p>this is <span class="highlight">a</span> <b>bold</b> phrase</p></body> </html> <html xmlns="http://www.w3.org/1999/xhtml"> <body><p>this is <span class="highlight">a </span><b><span class="highlight">bold</span></b> phrase</p></body> </html> <html xmlns="http://www.w3.org/1999/xhtml"> <body><p>this is <span class="highlight">a </span><b><span class="highlight">bold</span></b><span class="highlight"> phrase</span></p></body> </html> -Danny From: [email protected] [mailto:[email protected]] On Behalf Of Stewart Shelline Sent: Wednesday, July 18, 2012 3:52 PM To: MarkLogic Developer Discussion Subject: [MarkLogic Dev General] cts:highlight and phrase-through/phrase-around Does cts:highlight respect phrase-through and phrase-around settings? I'm seeing behavior that suggests it doesn't, but I can't find anything in the documentation that says so. NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
