Physikerwelt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/100121


Change subject: Add length constraint to XQueryGenerator
......................................................................

Add length constraint to XQueryGenerator

Change-Id: If80ac394d4afeca7f21157821df4e1f9379608e2
---
M XQueryGenerator.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/21/100121/1

diff --git a/XQueryGenerator.php b/XQueryGenerator.php
index 1fcd386..52aca08 100644
--- a/XQueryGenerator.php
+++ b/XQueryGenerator.php
@@ -20,6 +20,7 @@
        }
        private $qvar = array();
        private $relativeXPath ="";
+       private $lengthConstraint='';
        function searchForm( $tex, $type ) {
 
                $out = '';
@@ -152,7 +153,7 @@
 for $m in //*:expr return
        for $x in $m//*:'.self::getFirstChildName($xml).'['.
                 $fixedConstraints. '] return
-                       if( '.$qvarConstraintString.') then
+                       if( '.$qvarConstraintString.$this->lengthConstraint.') 
then
  <a 
href="http://demo.formulasearchengine.com/index.php?curid={$m/@url}";>result</a>
 else endif';
 // <res>{$m}</res>';
@@ -206,6 +207,7 @@
 
                        }
                }}
+               $this->lengthConstraint .=' and 
fn:count($x'.$this->relativeXPath .'/*) = '. $i;
                if ($this->relativeXPath){
                        $this->relativeXPath=  substr($this->relativeXPath, 0, 
strrpos($this->relativeXPath,"/"));
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/100121
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If80ac394d4afeca7f21157821df4e1f9379608e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <w...@physikerwelt.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to