Xpath evaluator telling me that a namespace is not declared, but it is
Oxygen general issues.
-
- Posts: 1
- Joined: Thu Sep 21, 2023 9:42 pm
Xpath evaluator telling me that a namespace is not declared, but it is
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">
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Xpath evaluator telling me that a namespace is not declared, but it is
Hello,
Probably you changed the XPath scope from "Current File" to "Selected Project Resources". Please note that the namespace is only detected from the file when using the "Current File" scope. To adjust the scope, you have two options: you can either modify it from the XPath toolbar or from the XPath builder. In the XPath toolbar, the drop-down menu will display a different icon before the XPath expression, depending on the scope you have selected. For more information, please refer to our user manual: https://www.oxygenxml.com/doc/versions/ ... xv_cgk_54b
If you wish to utilize a different scope for your XPath, you can declare the namespaces in the XPath Options: https://www.oxygenxml.com/doc/versions/ ... xpath.html
Best Regards,
Octavian
Probably you changed the XPath scope from "Current File" to "Selected Project Resources". Please note that the namespace is only detected from the file when using the "Current File" scope. To adjust the scope, you have two options: you can either modify it from the XPath toolbar or from the XPath builder. In the XPath toolbar, the drop-down menu will display a different icon before the XPath expression, depending on the scope you have selected. For more information, please refer to our user manual: https://www.oxygenxml.com/doc/versions/ ... xv_cgk_54b
If you wish to utilize a different scope for your XPath, you can declare the namespaces in the XPath Options: https://www.oxygenxml.com/doc/versions/ ... xpath.html
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service