GUI not counting all updates?

Wednesday, 5 June 2019 · 3 messages · last reply 26 Jun 2019
FB
France Baril5 Jun 2019 11:22 #
Hi, I am running this query on my DB in BasexGui. The updates are performed, but the info window shows hit=0 and update=0.
(
  for $i in db:open('en-us')//p/node()[1]
  return
    if ($i instance of text() and normalize-space($i) = '')
    then replace node $i with ''
    else (),
  for $i in db:open('en-us')//p/node()[last()]
  return
    if ($i instance of text() and normalize-space($i) = '')
    then replace node $i with ''
    else ()
)
The DB has items like this one:
<td id="j1359186">
              <p id="j1360382">   <q id="j1213306">Turn off projector</q>
  </p>
              <p id="j1348"><q id="j1158327">Switch off projector</q></p>
              <p id="j1279295"><q id="j11037">Projector off</q>     </p>
              <p id="j169323"><q id="j147181">Turn projector off</q></p>
              <p id="j1157299">    <q id="j1277">Deactivate
projector</q></p>
              <p id="j1145358">     <q id="j122584">Disable projector</q>
   </p>
            </td>
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com
CG
Christian Grün19 Jun 2019 10:31 #
Hi France, Thanks for the hint. This was a little bug in the query info output: Empty string replacements were not counted as updates (with "delete node $i", it works). Fixed in the latest snapshot. Best, Christian
Quoted text · France Baril · 35 lines
On Wed, Jun 5, 2019 at 11:22 AM France Baril <france.baril at architextus.com> wrote: > > Hi, > > I am running this query on my DB in BasexGui. The updates are performed, but the info window shows hit=0 and update=0. > > ( > for $i in db:open('en-us')//p/node()[1] > return > if ($i instance of text() and normalize-space($i) = '') > then replace node $i with '' > else (), > for $i in db:open('en-us')//p/node()[last()] > return > if ($i instance of text() and normalize-space($i) = '') > then replace node $i with '' > else () > ) > > The DB has items like this one: > > <td id="j1359186"> > <p id="j1360382"> <q id="j1213306">Turn off projector</q> </p> > <p id="j1348"><q id="j1158327">Switch off projector</q></p> > <p id="j1279295"><q id="j11037">Projector off</q> </p> > <p id="j169323"><q id="j147181">Turn projector off</q></p> > <p id="j1157299"> <q id="j1277">Deactivate projector</q></p> > <p id="j1145358"> <q id="j122584">Disable projector</q> </p> > </td> > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com
FB
France Baril26 Jun 2019 09:13 #
Awesome, thanks!
Quoted text · Christian Grün · 53 lines
On Wed, Jun 19, 2019 at 9:31 AM Christian Grün <christian.gruen at gmail.com> wrote: > Hi France, > > Thanks for the hint. This was a little bug in the query info output: > Empty string replacements were not counted as updates (with "delete > node $i", it works). Fixed in the latest snapshot. > > Best, > Christian > > > > On Wed, Jun 5, 2019 at 11:22 AM France Baril > <france.baril at architextus.com> wrote: > > > > Hi, > > > > I am running this query on my DB in BasexGui. The updates are performed, > but the info window shows hit=0 and update=0. > > > > ( > > for $i in db:open('en-us')//p/node()[1] > > return > > if ($i instance of text() and normalize-space($i) = '') > > then replace node $i with '' > > else (), > > for $i in db:open('en-us')//p/node()[last()] > > return > > if ($i instance of text() and normalize-space($i) = '') > > then replace node $i with '' > > else () > > ) > > > > The DB has items like this one: > > > > <td id="j1359186"> > > <p id="j1360382"> <q id="j1213306">Turn off > projector</q> </p> > > <p id="j1348"><q id="j1158327">Switch off projector</q></p> > > <p id="j1279295"><q id="j11037">Projector off</q> </p> > > <p id="j169323"><q id="j147181">Turn projector off</q></p> > > <p id="j1157299"> <q id="j1277">Deactivate > projector</q></p> > > <p id="j1145358"> <q id="j122584">Disable > projector</q> </p> > > </td> > > > > -- > > France Baril > > Architecte documentaire / Documentation architect > > france.baril at architextus.com >
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com

⚡Generated with XQuery