Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-22 Thread Kari Cowan
RegEx in xQuery Righto – I’ll look to add such a function – thanks. From: on behalf of Christopher Hamlin Reply-To: MarkLogic Date: Wednesday, March 22, 2017 at 7:48 AM To: MarkLogic Subject: Re: [MarkLogic Dev General] Using RegEx in xQuery My guess is that it's a big doc and hard to

Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-22 Thread Kari Cowan
Righto – I’ll look to add such a function – thanks. From: on behalf of Christopher Hamlin Reply-To: MarkLogic Date: Wednesday, March 22, 2017 at 7:48 AM To: MarkLogic Subject: Re: [MarkLogic Dev General] Using RegEx in xQuery My guess is that it's a big doc and hard to find the HTML

Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-22 Thread Christopher Hamlin
My guess is that it's a big doc and hard to find the HTML tags? Open the doc in an XML editor and search for *:HTML and it may show. Also, those are both {incisive-repository}HTML nodes, even if there is a (surface) difference in prefix/namespace. This is an example of why regex for xml strings

Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-22 Thread Kari Cowan
do a directory query and write the HTML value with descendants, I get more than 1? Does the XSLT notation and unwrap suggestion still make sense given that context? From: on behalf of Geert Josten Reply-To: MarkLogic Date: Monday, March 20, 2017 at 8:49 AM To: MarkLogic Subject: Re

Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-20 Thread Geert Josten
t;> Reply-To: MarkLogic Developer Discussion mailto:general@developer.marklogic.com>> Date: Monday, March 20, 2017 at 4:29 PM To: MarkLogic Developer Discussion mailto:general@developer.marklogic.com>> Subject: Re: [MarkLogic Dev General] Using RegEx in xQuery I don't kno

Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-20 Thread Christopher Hamlin
I don't know off-hand of changes in xslt between 7 and 8. Something like this in 8 is what I was thinking, don't know if it is really what you need: let $doc := (: blah blah blah :) let $xslt := http://www.w3.org/1999/XSL/Transform"; xmlns:ir="incisive-repository"> retu

Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-19 Thread Kari Cowan
Thanks. I’ll look into that. Do you have any links/examples particular to ML 7? From: on behalf of Christopher Hamlin Reply-To: MarkLogic Date: Saturday, March 18, 2017 at 6:03 PM To: MarkLogic Subject: Re: [MarkLogic Dev General] Using RegEx in xQuery Note that regex works on strings

Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-18 Thread Christopher Hamlin
Note that regex works on strings, not nodes. It's easier I think to operate on nodes here. You could do it with xslt also. Start with an identity transform and then have {incisive-repository}HTML nodes with similar preceding-siblings transform to nothing.

Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-17 Thread Kari Cowan
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 H

Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-17 Thread Justin Makeig
The general way to recursively transform one node tree to another in XQuery is via recursive descent . I can't quite tell from your description what your transformation needs to do, though. "Strip ou

[MarkLogic Dev General] Using RegEx in xQuery

2017-03-17 Thread Kari Cowan
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