I have a relatively complex XML file following the ReqIF standard that I wish to manipulate using BaseX. When I strip out all of the xlmns
attributes in the REQ-IF
node, then I can perform XQueries and traverse the file (e.g., //REQ-IF/THE-HEADER
) in the XQuery bar, and see the results as expected.
However when I include the xlmns
attributes, none of the queries work. Even worse, when I select a node in the Map View to copy the path and paste it into the XQuery bar, no results are returned either.
So, how does one express an XQuery (using presumably the namespace information) to get to the innards of this XML file?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<REQ-IF xmlns="http://www.omg.org/spec/ReqIF/20110401/reqif.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/spec/ReqIF/20110401/reqif.xsd reqif.xsd" xmlns:reqif="http://www.omg.org/spec/ReqIF/20110401/reqif.xsd" xmlns:reqif-xhtml="http://www.w3.org/1999/xhtml" xmlns:rm-reqif="http://www.ibm.com/rm/reqif" xmlns:xhtml="http://www.w3.org/1999/xhtml" >
<THE-HEADER>
</THE-HEADER>
<CORE-CONTENT>
<REQ-IF-CONTENT>
<DATATYPES>
</DATATYPES>
<SPEC-TYPES>
</SPEC-TYPES>
<SPEC-OBJECTS>
</SPEC-OBJECTS>
<SPEC-RELATIONS>
</SPEC-RELATIONS>
<SPECIFICATIONS>
</SPECIFICATIONS>
<SPEC-RELATION-GROUPS>
</SPEC-RELATION-GROUPS>
</REQ-IF-CONTENT>
</CORE-CONTENT>
</REQ-IF>