Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mathmlquerygenerator.iml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: net.sf.saxon:Saxon-HE:9.5.1-6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:17.0" level="project" />
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
</distributionManagement>

<dependencies>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.5.1-6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.formulasearchengine.mathmlquerygenerator;

import com.formulasearchengine.xmlhelper.DomDocumentHelper;
import com.formulasearchengine.xmlhelper.NonWhitespaceNodeList;
import com.formulasearchengine.mathmlquerygenerator.xmlhelper.XMLHelper;
import com.formulasearchengine.mathmlquerygenerator.xmlhelper.NonWhitespaceNodeList;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Expand All @@ -15,7 +15,7 @@
import java.util.ArrayList;
import java.util.List;

import static com.formulasearchengine.xmlhelper.NonWhitespaceNodeList.getFirstChild;
import static com.formulasearchengine.mathmlquerygenerator.xmlhelper.NonWhitespaceNodeList.getFirstChild;

/**
* Created by Moritz on 08.11.2014.
Expand All @@ -35,7 +35,7 @@ public NtcirTopicReader( Document topics ) {
}

public NtcirTopicReader( File topicFile ) throws ParserConfigurationException, IOException, SAXException {
DocumentBuilder documentBuilder = DomDocumentHelper.getDocumentBuilderFactory().newDocumentBuilder();
DocumentBuilder documentBuilder = XMLHelper.getDocumentBuilder( true );
topics = documentBuilder.parse( topicFile );

//TODO: Find out how this code duplication can be avoided in Java.
Expand Down Expand Up @@ -75,7 +75,7 @@ public final NtcirTopicReader setAddQvarMap( boolean addQvarMap ) {
* @throws XPathExpressionException Thrown if xpaths fail to compile or fail to evaluate
+ */
public final List<NtcirPattern> extractPatterns() throws XPathExpressionException {
final XPath xpath = DomDocumentHelper.namespaceAwareXpath( "t", NS_NII );
final XPath xpath = XMLHelper.namespaceAwareXpath( "t", NS_NII );
final XPathExpression xNum = xpath.compile( "./t:num" );
final XPathExpression xFormula = xpath.compile( "./t:query/t:formula" );
final NonWhitespaceNodeList topicList = new NonWhitespaceNodeList(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.formulasearchengine.mathmlquerygenerator;


import com.formulasearchengine.xmlhelper.DomDocumentHelper;
import com.formulasearchengine.xmlhelper.NonWhitespaceNodeList;
import com.formulasearchengine.mathmlquerygenerator.xmlhelper.XMLHelper;
import com.formulasearchengine.mathmlquerygenerator.xmlhelper.NonWhitespaceNodeList;
import com.google.common.collect.Lists;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
Expand All @@ -14,7 +14,7 @@
import java.util.*;
import java.util.regex.Pattern;

import static com.formulasearchengine.xmlhelper.NonWhitespaceNodeList.getFirstChild;
import static com.formulasearchengine.mathmlquerygenerator.xmlhelper.NonWhitespaceNodeList.getFirstChild;

/**
* Converts MathML queries into XQueries.
Expand Down Expand Up @@ -48,7 +48,7 @@ public class XQueryGenerator {
*/
public XQueryGenerator( String input )
throws IOException, SAXException, ParserConfigurationException {
final Document xml = DomDocumentHelper.String2Doc( input );
final Document xml = XMLHelper.String2Doc( input, true );
this.mainElement = getMainElement( xml );
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.formulasearchengine.xmlhelper;
package com.formulasearchengine.mathmlquerygenerator.xmlhelper;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Expand Down
Loading