Sure, in the same return, I am getting back 2 HTML elements.  So the first one 
is the one I want to keep.  The 2nd one I would like to do away with entirely.  
At the least to remove all child elements and I could strip the rest on the 
frontend if I had to.  

Here’s a pared-down example of the HTML elements in the same doc.  Is this what 
you wanted to see?

<HTML xmlns="incisive-repository" xmlns:i="incisive-repository">
    <p xmlns="http://www.w3.org/1999/xhtml";>
        <a 
href="http://images.legalweek.com/contrib/content/uploads/sites/378/2016/11/charlotte_stalin_01_revised-002-Article-201611151248.jpg";>
            <img class="alignleft size-full wp-image-57737" 
alt="charlotte_stalin_01_revised (002)-Article-201611151248" 
src="http://images.legalweek.com/contrib/content/uploads/sites/378/2016/11/charlotte_stalin_01_revised-002-Article-201611151248.jpg";
 width="616" height="372" />
        </a>
    </p>
    <p xmlns="http://www.w3.org/1999/xhtml";>Simmons &amp; Simmons has appointed 
two new sector heads for
its financial institutions and life sciences groups.</p>
    <p xmlns="http://www.w3.org/1999/xhtml";>London financial services partner 
Charlotte Stalin will lead
financial institutions while Paris disputes partner Alexandre
Reginault will head up life sciences. Both positions are
effective from 1 May for a three year term.</p>
</HTML>

<HTML xmlns:occurrenceattr="http://luxid.temis.com/occurrence/attribute"; 
xmlns:entityattr="http://luxid.temis.com/entity/attribute"; 
xmlns:entity="http://luxid.temis.com/entity"; 
xmlns:category="http://luxid.temis.com/category"; xmlns="incisive-repository" 
xmlns:i="incisive-repository">
    <p xmlns="http://www.w3.org/1999/xhtml";>
        <a 
href="http://images.legalweek.com/contrib/content/uploads/sites/378/2016/11/charlotte_stalin_01_revised-002-Article-201611151248.jpg";>
            <img class="alignleft size-full wp-image-57737" 
alt="charlotte_stalin_01_revised (002)-Article-201611151248" 
src="http://images.legalweek.com/contrib/content/uploads/sites/378/2016/11/charlotte_stalin_01_revised-002-Article-201611151248.jpg";
 width="616" height="372" />
        </a>
    </p>
    <p xmlns="http://www.w3.org/1999/xhtml";>
        <entity:entity path="/Entity/LawFirm/Simmons &amp; Simmons, P.C.">
            <entityattr:variant value="Simmons, Simmons" />
            <entityattr:variant value="Simmons and Simmons" />
            <entityattr:variant value="Simmons Simmons" />
            <entityattr:variant value="Simmons &amp; Simmons, P.C." />
            <entityattr:variant value="Simmons &amp; Simmons" />
            <entityattr:label value="Simmons &amp; Simmons, P.C." />
            <entityattr:id value="LF00001069" />
            <entityattr:domain value="LawFirm" />Simmons &amp; 
Simmons</entity:entity> has appointed two new sector heads for
its financial institutions and life sciences groups.</p>
    <p xmlns="http://www.w3.org/1999/xhtml";>London financial services partner 
Charlotte Stalin will lead
financial institutions while Paris disputes partner Alexandre
Reginault will head up life sciences. Both positions are
effective from 1 May for a three year term.</p>
</HTML>

On 3/17/17, 1:49 PM, "[email protected] on behalf of 
Justin Makeig" <[email protected] on behalf of 
[email protected]> wrote:

    The general way to recursively transform one node tree to another in XQuery 
is via recursive descent 
<https://gist.github.com/jmakeig/7273340b3065f442030451d04587c466#file-identity-transform-xqy>.
 
    
    I can't quite tell from your description what your transformation needs to 
do, though. "Strip out everything in between" what? Can you give a more fleshed 
out example of the input and your expected output?
    
    Justin
    
    
    
    > On Mar 17, 2017, at 1:28 PM, Kari Cowan <[email protected]> wrote:
    > 
    > Inside my return for a query, I have an HTML node that I don’t need that 
includes a bunch of child elements  -- I want to strip out everything in 
between; alternately I could be happy to remove the node entirely from the 
returned data.  Is there a function for that I don’t know about or is th is 
better done with a regex?  Anyone have a tip they can share?
    >  
    > <HTML xmlns:occurrenceattr="http://luxid.temis.com/occurrence/attribute"; 
xmlns:entityattr="http://luxid.temis.com/entity/attribute"; 
xmlns:entity="http://luxid.temis.com/entity"; 
xmlns:category="http://luxid.temis.com/category"; xmlns="incisive-repository" 
xmlns:i="incisive-repository">  (bunches of child elements here )  </HTML>
    > _______________________________________________
    > General mailing list
    > [email protected]
    > Manage your subscription at: 
    > http://developer.marklogic.com/mailman/listinfo/general
    
    
    
    _______________________________________________
    General mailing list
    [email protected]
    Manage your subscription at: 
    http://developer.marklogic.com/mailman/listinfo/general
    

_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to