Xpath evaluator telling me that a namespace is not declared, but it is
Posted: Thu Sep 21, 2023 9:53 pm
I feel like I'm going crazy here.
The Xpath evaluator keeps telling me that namespaces that are declared in the document are not declared. For instance I'm trying to evaluate the following Xpath:
in a document with this header:
But the evaluator keeps telling me "XPath failed due to: Namespace prefix 'gco' has not been declared". This was not a problem until I tried to use the XPath builder to evaluate that XPath across files in a directory. When I tried to do that, I got the same error, and now every time I try to do it in just one xml file I get the same error.
The Xpath evaluator keeps telling me that namespaces that are declared in the document are not declared. For instance I'm trying to evaluate the following Xpath:
Code: Select all
MD_Metadata/contact/CI_ResponsibleParty/individualName[following-sibling::role/CI_RoleCode[text() = 'resourceProvider']]/gco:CharacterString
Code: Select all
<MD_Metadata xmlns="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">