Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 24e7647

Browse files
committed
Fix namespace issue
Change-Id: I77ecaa51e57217afe865e982af274af0481c194f
1 parent 801e405 commit 24e7647

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/main/java/de/tuberlin/dima/schubotz/mathmlquerygenerator/XQueryGenerator.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static Node getMainElement (Document xml) {
6666
}
6767
}
6868
// if that fails too interprete content of first semantic element as content MathML
69-
expr = xml.getElementsByTagName( "semantics" );
69+
expr = xml.getElementsByTagNameNS("*", "semantics");
7070
if ( expr.getLength() > 0 ) {
7171
return new NdLst( expr ).item( 0 );
7272
}
@@ -147,7 +147,10 @@ private String generateConstraint (Node node, boolean isRoot) {
147147
}
148148
} else {
149149
if ( child.getNodeType() == Node.ELEMENT_NODE ) {
150-
i++;
150+
if(child.getLocalName().matches("annotation(-xml)?")){
151+
continue;
152+
}
153+
i++;
151154
if ( hasText ) {
152155
out += " and ";
153156
}
@@ -165,7 +168,9 @@ private String generateConstraint (Node node, boolean isRoot) {
165168

166169
} else if ( child.getNodeType() == Node.TEXT_NODE ) {
167170
out = "./text() = '" + child.getNodeValue().trim() + "'";
168-
}
171+
} else {
172+
System.out.println(child.getNodeType());
173+
}
169174
}
170175
}
171176
if ( !isRoot ) {

0 commit comments

Comments
 (0)