diff --git a/src/Math/Reader/MathML.php b/src/Math/Reader/MathML.php index 8416988..275fe98 100644 --- a/src/Math/Reader/MathML.php +++ b/src/Math/Reader/MathML.php @@ -61,7 +61,7 @@ protected function getElement(DOMElement $nodeElement): Element\AbstractElement case 'mfrac': $element = new Element\Fraction(); $nodeList = $this->xpath->query('*', $nodeElement); - if ($nodeList->count() == 2) { + if ($nodeList->length == 2) { $element ->setNumerator($this->getElement($nodeList->item(0))) ->setDenominator($this->getElement($nodeList->item(1))); @@ -75,7 +75,7 @@ protected function getElement(DOMElement $nodeElement): Element\AbstractElement if (empty($nodeValue)) { $nodeList = $this->xpath->query('*', $nodeElement); if ( - $nodeList->count() == 1 + $nodeList->length == 1 && $nodeList->item(0)->nodeName == 'mchar' && $nodeList->item(0)->hasAttribute('name') ) { @@ -88,7 +88,7 @@ protected function getElement(DOMElement $nodeElement): Element\AbstractElement case 'msup': $element = new Element\Superscript(); $nodeList = $this->xpath->query('*', $nodeElement); - if ($nodeList->count() == 2) { + if ($nodeList->length == 2) { $element ->setBase($this->getElement($nodeList->item(0))) ->setSuperscript($this->getElement($nodeList->item(1))); diff --git a/src/Math/Reader/OfficeMathML.php b/src/Math/Reader/OfficeMathML.php index 63c2047..3a701eb 100644 --- a/src/Math/Reader/OfficeMathML.php +++ b/src/Math/Reader/OfficeMathML.php @@ -67,7 +67,7 @@ protected function getElement(DOMElement $nodeElement): Element\AbstractElement $element = new Element\Fraction(); // Numerator $nodeNumerator = $this->xpath->query('m:num/m:r/m:t', $nodeElement); - if ($nodeNumerator->count() == 1) { + if ($nodeNumerator->length == 1) { $value = $nodeNumerator->item(0)->nodeValue; if (is_numeric($value)) { $element->setNumerator(new Element\Numeric($value)); @@ -77,7 +77,7 @@ protected function getElement(DOMElement $nodeElement): Element\AbstractElement } // Denominator $nodeDenominator= $this->xpath->query('m:den/m:r/m:t', $nodeElement); - if ($nodeDenominator->count() == 1) { + if ($nodeDenominator->length == 1) { $value = $nodeDenominator->item(0)->nodeValue; if (is_numeric($value)) { $element->setDenominator(new Element\Numeric($value)); @@ -88,7 +88,7 @@ protected function getElement(DOMElement $nodeElement): Element\AbstractElement return $element; case 'm:r': $nodeText = $this->xpath->query('m:t', $nodeElement); - if ($nodeText->count() == 1) { + if ($nodeText->length == 1) { $value = trim($nodeText->item(0)->nodeValue); if (in_array($value, $this->operators)) { return new Element\Operator($value);