ooxml:runs-merge( $nodes as node()* ) as node()*
This function updates document or paragraph node(s) (from a Word 2007 document) so that all similar runs are merged, retaining formatting, and removing text split across elements.
Parameters | |
---|---|
nodes | The nodes to merge. |
xquery version "1.0-ml"; import module namespace ooxml= "http://marklogic.com/openxml" at "/MarkLogic/openxml/word-processing-ml.xqy"; declare namespace w= "http://schemas.openxmlformats.org/wordprocessingml/2006/main"; let $runs := <w:p w:rsidR="00D203FD" w:rsidRDefault="00423AEC"> <w:r><w:t>This is a de</w:t></w:r> <w:r><w:t xml:space="preserve">monstration </w:t></w:r> <w:r><w:t>of merging runs</w:t></w:r> </w:p> return ooxml:runs-merge($runs) => <w:p w:rsidR="00D203FD" w:rsidRDefault="00423AEC" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"> <w:r> <w:t xml:space="preserve">This is a demonstration of merging runs</w:t> </w:r> </w:p>
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.