xPath //elementName expression "stopped" working
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 14
- Joined: Sun Apr 01, 2012 1:17 pm
xPath //elementName expression "stopped" working
let's say I would like to target all `head` elements within a TEI XML document; I would normally use the expression
for some unclear ( to me at least) reason and after performing some queries in the same session this query stopped working ; so I quit the app reopened the file but it still wouldn't work either on the xPath search nor when using XPath XQuery Builder instead whenever I ran a query I got the following pop up message
I created a new TEI All document using oXygen's file templates, but I still had the same issue
As I was digging in oXygen's forum I came across an old post and I tried the following expression which gave me the correct results
However I've never had to use a prefix before while using the file templates and sticking only to TEI, am I missing something super obvious? Is there a setting I should check?
Code: Select all
//head
XML Refactoring still worked fine…The XPath query returned no results. XPath scope: Current File
I created a new TEI All document using oXygen's file templates, but I still had the same issue
As I was digging in oXygen's forum I came across an old post and I tried the following expression
Code: Select all
//default:head
However I've never had to use a prefix before while using the file templates and sticking only to TEI, am I missing something super obvious? Is there a setting I should check?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: xPath //elementName expression "stopped" working
Hello,
Normally XPath 2.0 expressions should be namespace-qualified when working with documents that have namespaces (like TEI). However, by default Oxygen tries to make XPath easier to use and is configured to use the default namespace of the root element in the document as the default namespace for XPath 2.0 expressions.
I'm guessing you have changed this option, menu > Options > Preferences, XML / XSLT-XQuery / XPath, XPath Default Namespace. For the default behavior it should be set to "Use the default namespace from the root element". Or you can press the "Restore Defaults" button from that option page. This affects both the XPath toolbar and the XPath/XQuery Builder.
Regards,
Adrian
Normally XPath 2.0 expressions should be namespace-qualified when working with documents that have namespaces (like TEI). However, by default Oxygen tries to make XPath easier to use and is configured to use the default namespace of the root element in the document as the default namespace for XPath 2.0 expressions.
I'm guessing you have changed this option, menu > Options > Preferences, XML / XSLT-XQuery / XPath, XPath Default Namespace. For the default behavior it should be set to "Use the default namespace from the root element". Or you can press the "Restore Defaults" button from that option page. This affects both the XPath toolbar and the XPath/XQuery Builder.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 14
- Joined: Sun Apr 01, 2012 1:17 pm
Re: xPath //elementName expression "stopped" working
That was it… thank you!!I'm guessing you have changed this option, menu > Options > Preferences, XML / XSLT-XQuery / XPath, XPath Default Namespace. For the default behavior it should be set to "Use the default namespace from the root element".
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