I found the section of code - it's in snip:do-highlight-element():
for $parent at $pos in ($unique)[1 to $max-matches]
let $parent-path := if (xdmp:node-uri($parent)) then
xdmp:describe($parent) else xdmp:path($parent)
let $nodes :=
(for $s at $index in $selected[@parent-pos eq $pos]
let $sibs :=
if ($s[@nested]) then
let $ct := count($s/preceding::node())
return
(($s/preceding::node())[$ct],$s,$s/following::node()[1])
else
($s/preceding-sibling::node()[1],$s,$s/following-sibling::node()[1])
return $sibs)/.
My goal is to prevent certain elements from being stripped down to just text as
it constructs the $nodes element. Can anyone suggest an approach to this? I'm
still understanding how this works...
Thanks!
-Will
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Will Thompson
Sent: Friday, March 04, 2011 4:05 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Snippet.xqy - Where do elements get converted
to text?
Hello all,
Is anyone familiar enough with the snippet API code to tell me where elements
are being converted to text? I'm reading through snippet.xqy, but there's
quite a bit going on.
I'm building my own snippet module that will basically be a copy of the API
code with some modifications. I need to allow certain elements to pass
completely through to the <snip:match> so they can later be pretty-formatted
when the snippet is transformed into HTML.
Thanks,
Will Thompson
Jones McClure Publishing
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general