XQuery imports using catalog
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 2
- Joined: Tue Feb 09, 2010 4:28 am
XQuery imports using catalog
We've got a backend system that can properly resolve XQuery imports and would like to use xml catalogs to do a testing resolution is there a way to properly use the XML Catalogs feature of oxygen to do this.
For example I have a file in an eclipse project at
Project1/my/xquery/file.xql
and a module at
Project2/my/xqm/my.xqm
I want to put a catalog at
Project2/catalog.xml
that can reference the xqm when doing operations in file.xql
file.xql looks like
I would like to use a catalog like
however neither the system or public is matching and yes this catalog is added as a catalog in the oxygen preferences.
Thank you for your help Paul Ryan
For example I have a file in an eclipse project at
Project1/my/xquery/file.xql
and a module at
Project2/my/xqm/my.xqm
I want to put a catalog at
Project2/catalog.xml
that can reference the xqm when doing operations in file.xql
file.xql looks like
Code: Select all
xquery version "1.0";
import module namespace my="urn:my-functions" at "customprotocol:///files/*/xqm/my.xqm";
Code: Select all
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.1//EN" "http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public publicId="urn:my-functions"
uri="my/xqm/my.xqm"/>
<system systemId="customprotocol:///files/*/xqm/my.xqm"
uri="my/xqm/my.xqm"/>
</catalog>
Thank you for your help Paul Ryan
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XQuery imports using catalog
Hello,
In catalog.xml you have to use uri instead of system:
Let me know if it still does not work.
Regards,
Adrian
In catalog.xml you have to use uri instead of system:
Code: Select all
<uri name="customprotocol:///files/*/xqm/my.xqm"
uri="my/xqm/my.xqm"/>
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: 2
- Joined: Tue Feb 09, 2010 4:28 am
Re: XQuery imports using catalog
That works for finding the resource however because I have the namespace declared in both the xql and an included xqm with the exact same at it is complaining about a duplicate.
I have file.xql:
util.xqm:
And I'm getting an error in oxygen in file.xqm about duplicates of the functions from my.xqm.
F [Saxon-PE XQuery 9.2.0.3] XQuery static error in #...string($uri)) }; declare#: Duplicate definition of function my:function (see line 10 in file:/Users/me/workspaces/Project2/xqm/my.xqm)
And there are no duplicates, plus the error goes away if I don't import from the top or let the import from the bottom drive the top (e.g. take away the at).
I have file.xql:
Code: Select all
xquery version "1.0";
import module namespace util="urn:my-functions" at "customprotocol:///files/*/xqm/util.xqm";
import module namespace my="urn:my-functions" at "customprotocol:///files/*/xqm/my.xqm";
Code: Select all
module namespace util="urn:my-utils";
import module namespace my="urn:my-functions" at "customprotocol:///files/*/xqm/my.xqm";
F [Saxon-PE XQuery 9.2.0.3] XQuery static error in #...string($uri)) }; declare#: Duplicate definition of function my:function (see line 10 in file:/Users/me/workspaces/Project2/xqm/my.xqm)
And there are no duplicates, plus the error goes away if I don't import from the top or let the import from the bottom drive the top (e.g. take away the at).
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XQuery imports using catalog
It's in the XQuery specification:
http://www.w3.org/TR/xquery/#doc-xquery-ModuleImport
Regards,
Adrian
http://www.w3.org/TR/xquery/#doc-xquery-ModuleImport
So just use different namespaces.It is a static error [err:XQST0047] if more than one module import in a Prolog specifies the same target namespace.
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