Using an XQuery //foo/@bar gives "Your query returned an empty sequence."
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 102
- Joined: Tue Aug 19, 2014 12:04 pm
Using an XQuery //foo/@bar gives "Your query returned an empty sequence."
Post by Martin Honnen »
Using XML Editor 18.0, build 2016081012, when I use a simple path expression //foo/@bar in the XQuery/XPath query builder against an XML document
I get a notice "Your query returned an empty sequence." at the bottom of the builder when I execute as XQuery 1.0 or 3.0. When I select XPath I get the two selected attributes.
Is the "Your query returned an empty sequence." for XQuery the intended result?
I understand that an XQuery returning attribute nodes without any parent is not serializable as XML but I think if that if a serialization problem is the reason that the query does not return anything that such an explanation should be displayed instead of the claim that the result sequence is empty.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<root>
<foo bar="1"/>
<foo bar="2"/>
</root>
Is the "Your query returned an empty sequence." for XQuery the intended result?
I understand that an XQuery returning attribute nodes without any parent is not serializable as XML but I think if that if a serialization problem is the reason that the query does not return anything that such an explanation should be displayed instead of the claim that the result sequence is empty.
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Using an XQuery //foo/@bar gives "Your query returned an empty sequence."
Hi,
Thank you for reporting this.
"Your query returned an empty sequence." is a bit of a generic warning that Oxygen returns when there is no result.
The error should be (as shown by Saxon in the command line):
I've logged this on our issue tracking tool to be addressed in a future version of Oxygen.
Regards,
Adrian
Thank you for reporting this.
"Your query returned an empty sequence." is a bit of a generic warning that Oxygen returns when there is no result.
The error should be (as shown by Saxon in the command line):
Code: Select all
SENR0001: Cannot serialize a free-standing attribute node (bar)
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: 102
- Joined: Tue Aug 19, 2014 12:04 pm
Re: Using an XQuery //foo/@bar gives "Your query returned an empty sequence."
Post by Martin Honnen »
I wonder whether there is an option or should be an option to have oXygen indicate (like oXygen does in the case of using XPath instead of XQuery) that the query selected a sequence of attribute nodes and display each node in the sequence, instead of attempting a serialization. I very much would welcome such a feature.
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Using an XQuery //foo/@bar gives "Your query returned an empty sequence."
I've logged a feature request for this. However, it seems impractical to implement this for XQuery since such a script is unusable in practice. IMHO, for XQuery the correct behavior would be to raise an error.I wonder whether there is an option or should be an option to have oXygen indicate (like oXygen does in the case of using XPath instead of XQuery) that the query selected a sequence of attribute nodes and display each node in the sequence, instead of attempting a serialization. I very much would welcome such a feature.
In addition, this is already available for the XPath engine. If you want XPath results for complex scripts, why not simply switch to XPath 3.0, which already does what you want?
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: 102
- Joined: Tue Aug 19, 2014 12:04 pm
Re: Using an XQuery //foo/@bar gives "Your query returned an empty sequence."
Post by Martin Honnen »
In general XQuery is more powerful and expressive than pure XPath so when I query a document I prefer directly doing that with XQuery. For the simple path //foo/@bar obviously it does not matter.
As for implementing that, I can't judge that in terms of practicality other than that http://saxonica.com/html/documentation/ ... l#iterator() seems to offer that feature for Saxon.
As for implementing that, I can't judge that in terms of practicality other than that http://saxonica.com/html/documentation/ ... l#iterator() seems to offer that feature for Saxon.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Using an XQuery //foo/@bar gives "Your query returned an empty sequence."
Hi,
Just to update this thread, Oxygen 19.0 should have a fix for the problem.
Regards,
Radu
Just to update this thread, Oxygen 19.0 should have a fix for the problem.
Regards,
Radu
Radu Coravu
<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