Self-knowledge in xquery
Friday, 10 June 2016 · 4 messages · last reply 11 Jun 2016
FB
France Baril10 Jun 2016 02:36 #
When I'm in xquery and I need to reference something through the rest interface. Can I know from xquery my host/port or domain, or do I have to leave that information for myself somewhere in a config file.
Case:
- I keep an indexable version my .xsd in a DB so I can query it to provide guidance to users in the GUI.
- Validation won't work with my .xsd because it won't resolve the includes if I just open the main .xsd file.
- I keep a binary copy of my .xsd in a different DB so I can reference it though rest and therefore validate content, but I need to know my base url. So far I've been leaving that information in a config file that I query, but as I have multiple BaseX instances in implies that I enter my host:port in .basex and then again in my indexable config file.
I'm trying to reduce duplication here.
Thanks,
France
--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
CL
Carl Leitner10 Jun 2016 03:17 #
Check here for the $baseurl on where we get that info:
https://github.com/openhie/openinfoman/blob/master/repo/csd_webapp_config.xqm One problem is that if you are sitting behind a proxy, you will get something that is not resolvable. To this end we built in our debian packaging the ability to overwrite this "configuration" module.
Let me know if you want more details.
Cheers,
-carl
Quoted text · France Baril · 28 lines
On Jun 9, 2016 6:36 PM, "France Baril" <france.baril at architextus.com> wrote: > When I'm in xquery and I need to reference something through the rest > interface. Can I know from xquery my host/port or domain, or do I have to > leave that information for myself somewhere in a config file. > > Case: > > - I keep an indexable version my .xsd in a DB so I can query it to > provide guidance to users in the GUI. > - Validation won't work with my .xsd because it won't resolve the > includes if I just open the main .xsd file. > - I keep a binary copy of my .xsd in a different DB so I can reference > it though rest and therefore validate content, but I need to know my base > url. So far I've been leaving that information in a config file that > I query, but as I have multiple BaseX instances in implies that I enter my > host:port in .basex and then again in my indexable config file. > > I'm trying to reduce duplication here. > > Thanks, > > France > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com >
CG
Quoted text · France Baril · 3 lines
> When I'm in xquery and I need to reference something through the rest > interface. Can I know from xquery my host/port or domain, or do I have to > leave that information for myself somewhere in a config file.
You can; please have a look at the Request Module [1]. But Carl’s proposal is probably close to what you are looking for!
[1] http://docs.basex.org/wiki/Request_Module
Quoted text · France Baril · 20 lines
> I keep an indexable version my .xsd in a DB so I can query it to provide > guidance to users in the GUI. > Validation won't work with my .xsd because it won't resolve the includes if > I just open the main .xsd file. > I keep a binary copy of my .xsd in a different DB so I can reference it > though rest and therefore validate content, but I need to know my base url. > So far I've been leaving that information in a config file that I query, but > as I have multiple BaseX instances in implies that I enter my host:port in > .basex and then again in my indexable config file. > > I'm trying to reduce duplication here. > > Thanks, > > France > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com
FB
France Baril11 Jun 2016 03:39 #
Awesome! Thanks! I had searched for self, host and domain in the documentation. Apparently, I needed to search for hostname. Terminology!
Quoted text · Christian Grün · 38 lines
On Fri, Jun 10, 2016 at 12:05 AM, Christian Grün <christian.gruen at gmail.com> wrote: > > When I'm in xquery and I need to reference something through the rest > > interface. Can I know from xquery my host/port or domain, or do I have > to > > leave that information for myself somewhere in a config file. > > You can; please have a look at the Request Module [1]. But Carl’s > proposal is probably close to what you are looking for! > > [1] http://docs.basex.org/wiki/Request_Module > > > > I keep an indexable version my .xsd in a DB so I can query it to provide > > guidance to users in the GUI. > > Validation won't work with my .xsd because it won't resolve the includes > if > > I just open the main .xsd file. > > I keep a binary copy of my .xsd in a different DB so I can reference it > > though rest and therefore validate content, but I need to know my base > url. > > So far I've been leaving that information in a config file that I query, > but > > as I have multiple BaseX instances in implies that I enter my host:port > in > > .basex and then again in my indexable config file. > > > > I'm trying to reduce duplication here. > > > > Thanks, > > > > France > > > > -- > > France Baril > > Architecte documentaire / Documentation architect > > france.baril at architextus.com >
--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
Written for BaseX 8.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery