default database context for collection()
Issues related to W3C XQuery.
-
- Posts: 18
- Joined: Fri Jan 09, 2009 9:18 pm
default database context for collection()
I work with BaseX but would love to be able to edit all my queries with oXygen. However, I do not know how to emulate the "current database context" (which is automatically set by BaseX to the currently open database) inside oXygen.
The immediate problem is that if I run collection() in BaseX, I receive what I need, but collection() executed via Oxygen's Saxon predictably returns an empty sequence. Now, two questions:
1. is there any way to change that and let Saxon know (via oXygen's transformation scenarios or such) that it should treat something as the default context for collection()
and/or
2. is there a way to achieve this effect when using BaseX integrated with oXygen via XQJ? On this scenario, I get a hint about "default collection" -- would that be my way out?
Thanks in advance!
ad.1, my error message is
ad.2, the error message is
The immediate problem is that if I run collection() in BaseX, I receive what I need, but collection() executed via Oxygen's Saxon predictably returns an empty sequence. Now, two questions:
1. is there any way to change that and let Saxon know (via oXygen's transformation scenarios or such) that it should treat something as the default context for collection()
and/or
2. is there a way to achieve this effect when using BaseX integrated with oXygen via XQJ? On this scenario, I get a hint about "default collection" -- would that be my way out?
Thanks in advance!
ad.1, my error message is
Code: Select all
System ID: /home/piotr/projects/KorAP/SVN/XML_test_data/tools/xq/tmp/temp3.xq
Scenario: temp3
XQuery file: /home/piotr/projects/KorAP/SVN/XML_test_data/tools/xq/tmp/temp3.xq
XML file: /home/piotr/projects/KorAP/SVN/XML_test_data/WPD/example/00001/metadata.xml
Engine name: Saxon-EE XQuery 9.3.0.5
Severity: error
Description: An empty sequence is not allowed as the value of variable $ms
Start location: 22:0
URL: http://www.w3.org/TR/xpath20/#ERRXPTY0004
Code: Select all
System ID: /home/piotr/projects/KorAP/SVN/XML_test_data/tools/xq/tmp/temp3.xq
Scenario: XQuery with BaseX-XQJ connection
XQuery file: /home/piotr/projects/KorAP/SVN/XML_test_data/tools/xq/tmp/temp3.xq
Engine name: BaseX connection
Severity: error
Description: FODC0002 Stopped at line 22, column 50:
[FODC0002] No default collection available.
Start location: 22:50
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: default database context for collection()
Hello,
We have not yet tested the latest version of BaseX via XQJ. In the past the BaseX XQJ implementation was limited to the XQuery engine(the database cold not be accessed via XQJ). But, I believe that in more recent versions of BaseX there has been some developement effort to also offer acces to the inner database.
We will have to test the latest version of BaseX with Oxygen and will let you know what we found out.
Regards,
Adrian
We have not yet tested the latest version of BaseX via XQJ. In the past the BaseX XQJ implementation was limited to the XQuery engine(the database cold not be accessed via XQJ). But, I believe that in more recent versions of BaseX there has been some developement effort to also offer acces to the inner database.
We will have to test the latest version of BaseX with Oxygen and will let you know what we found out.
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: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: default database context for collection()
Hello,
1. Regarding Saxon's default collection for collection(). You can set it in a Saxon configuration file and use this configuration file in the transformation scenario(Document > Transformation > Configure Transformation Scenario, Edit) in the Advanced options(button with small cogwheel next to the Transformer combo).
e.g. saxonConfig.xml
More details about the Saxon configuration file can be found here:
http://www.saxonica.com/documentation/c ... n-file.xml
2. We have tested BaseX 7.02(the XQJ implementation) with Oxygen v13.2.
We did not find a way to set the default collection. You can only configure a username and a password in the XQJ connection parameters.
So, collection() always fails with:
However, if you use the database name as the collection argument, it should work fine: collection('databaseName')
If there's a way to set the default collection for the BaseX XQJ implementation, it might be hidden in the BaseX documentation.
Regards,
Adrian
1. Regarding Saxon's default collection for collection(). You can set it in a Saxon configuration file and use this configuration file in the transformation scenario(Document > Transformation > Configure Transformation Scenario, Edit) in the Advanced options(button with small cogwheel next to the Transformer combo).
e.g. saxonConfig.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://saxon.sf.net/ns/configuration" edition="PE">
<global defaultCollection="file:///d:/test"/>
</configuration>
http://www.saxonica.com/documentation/c ... n-file.xml
2. We have tested BaseX 7.02(the XQJ implementation) with Oxygen v13.2.
We did not find a way to set the default collection. You can only configure a username and a password in the XQJ connection parameters.
So, collection() always fails with:
Code: Select all
[FODC0002] No default collection available.
If there's a way to set the default collection for the BaseX XQJ implementation, it might be hidden in the BaseX documentation.
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
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