XQuery import module relative path

I'd like to use library modules in queries, with the modules stored in one or more configurable places. If I put them in files, and provide the full path to the file like so:
import module namespace pi = 'http://ceridwen.us/2006/mymodule' at 'file:///path/to/module/file'
It works fine so long as the path given is absolute. I've tried several variations on relative paths, including using 'declare base-uri' (which didn't seem to do anything) and XmlQueryContext::setBaseURI (which didn't help find the module file and caused the context to not be able to find the container). I've also tried giving paths relative to pwd and to the environment home. No luck.
It would be even cooler if I could store the modules in a bdb database... but that would require adding a resolver somewhere. Is there a way to use an XmlResolver for this?
Regards,
John Ralls

John,
documentation: Well, if it's right then I'm reading it wrong. I guess that shouldn't be a surprise.
base-uri: OIC.
XmlResolver: Hmm. I added this:
class Resolver : public DbXml::XmlResolver {
public:
     Resolver() : DbXml::XmlResolver() {}
     virtual ~Resolver() {}
     DbXml::XmlInputStream* resolveEntity(DbXml::XmlTransaction* txn,
                         DbXml::XmlManager& mgr,
                         const std::string& systemID,
                         const std::string& publicID) {
     std::cout << "Resolver::resolveEntity: Got systemID " << systemID
          << ", publicID " << publicID << std::endl;
     return NULL;
to my header and
Resolver* rslv = new Resolver();
this->registerResolver(*rslv);
to the constructor of my DbXml::XmlManager-derived manager class.
The resolveEntity() function doesn't output. What's wrong?
(FWIW, the signature of resolveEntity in the documentation and that in the header(XmlResolver.hpp) differ: The latter doesn't have the std::string& result parameter. I tried both ways, and neither produced the output message.
resolveModule: Yes, I think that that would be clearer.
Regards,
John Ralls

Similar Messages

  • Does OSB support XQuery import module feature ?

    In OSB version 11.1 and Oracle Weblogic Server Version: 10.3.6.0
    I need to create library of XQuery functions (reusable components), to achieve this, I need to use XQuery import module feature.
    When I tried to use it, I got this error message ‘Module feature not supported (sorry)’ …
    Does OSB support XQuery import module feature ?

    You may like to refer Eric's blogpost -
    http://www.xenta.nl/blog/2011/10/19/oracle-service-bus-the-number-of-parameters-for-registered-xquery-resource-system1_to_fault-does-not-match-that-given-to-it-at-runtime/
    Basically, if you are not using a parameter in XQuery then it will not be registered.
    Regards,
    Anuj

  • Custom Module Templates - Relative Path...

    I haven't seen this come up on the forums yet so I hope this isn't a repeat question. I'm having problems with a template not being applied to the module and I am wondering if it's a pathing issue. Based on what I had read about this new feature I had used a path relative to the root of the website, not a path relative to the file. But when that didn't work I moved the template to the folder and used the path relative to the file. It still ignored the custom .tpl file.
    My other thought is it's an issue specific to the module. It's the {module_favorites} which uses by default the small_product.html file from the Layouts/OnlineShop folder. Maybe this module isn't capable of using the custom path?
    Since this is a secure zone file I can't give a sample for anyone to look at, but if anyone has any ideas I would love some help...
    Curtiss (@bcfanboy)

    http://helpx.adobe.com/business-catalyst/partner/using-custom-templates-modules.html
    Paths should have the / at the start
    {module_blogsitepost,2 template="/ModuleTemplates/Custom/MyTemplate.tpl"}
    Just double checking and getting the knowledgebase updated as well with a list of modules this works on.

  • SQL Server 2012 Import-Module 'sqlps' breaks the "Test-Path" PowerShell cmdlet

    I've run into something that is "very" frustrating with the new SQL Server 2012 PowerShell module.  When I Import the module, it breaks the "Test-Path" cmdlet when trying to test a UNC path to a directory.
    For example:  
    "Test-Path -path \\server\dirname" returns true as expected before the sqlps module is imported.  But after you import the SQL Server module "Import-Module 'sqlps' –DisableNameChecking" the same Test-Path
    now returns false.
    If I run the following in Windows PowerShell ISE I see the following results:
    Test-Path -path "\\server\directoryname"
    Import-Module 'sqlps' –DisableNameChecking
    Test-Path -path "\\server\directoryname"
    True
    False
    Anyone have any idea what's going on?
    UPDATE: after more testing, it looks like the problem happens with any cmdlet that references a UNC.  The New-Item has the same problem.  Before importing 'sqlps', New-Item is able to create a directory at the UNC path specified, but ater importing
    'sqlps', the New-Item fails.
    Thanks!

    Hi Mikea730,
    Sqlps.exe doesn't take advantage of a couple of these nice PowerShell V2 cmdlets without doing a bit of configuring in your environment. 
    Please refer to the following references to make some configuration in your server
    http://www.maxtblog.com/2010/11/denali-get-your-sqlpsv2-module-set-to-go/
    http://www.simple-talk.com/sql/database-administration/practical-powershell-for-sql-server-developers-and-dbas-%E2%80%93-part-1/
    http://sev17.com/2010/07/making-a-sqlps-module/
    Thanks,
    TechNet Subscriber Support
    If you are
    TechNet Subscription user and have any feedback on our support quality, please send your feedback
    here.
    Iric Wen
    TechNet Community Support

  • Import Module Woes

    I'm having some problems trying to import one module into another.
    Here's the beginning of a module:
    module namespace bar='http://ceridwen.us/2006/bar';
    import module namespace foo='http://ceridwen.us/2006/foo' at 'file://relative_path/to_foo';
    Module bar is imported into the main module with
    import module namespace bar='http://ceridwen.us/2006/bar' at 'file://relative_path/to_bar';
    Module bar declares functions which use functions from module foo.
    I have registered an XmlResolver which handles the relative path URI; it worked fine when there was only one library module. With the import module line in module bar, trying to prepare a query which imports bar throws "Cannot locate the requested module".
    If the import module line in bar is changed to an absolute path, then the error is "No namespace for prefix foo".
    If the main module prolog imports foo in the second case, xquery throws XQST0034.
    Everything works if the main module prolog imports foo and bar, and bar doesn't import foo.
    In the first case, it's evident that my XmlResolver isn't being called. I don't understand what's going on in the second case.
    The third and fourth case appear to me to violate the requirement that module imports aren't transitive.
    Are these bugs, or do I misunderstand the draft recommendation and XmlResolver docs?
    Regards,
    John Ralls

    Hi John,
    It looks like you are hitting a few module bugs that we have fixed in the development version of DB XML. The XmlResolver not being called in the first case, and the transitiveness of module imports are both incorrect.
    I don't understand why you are getting a namespace error in the second case - but there is good news about that. The development version of DB XML will also give you much better error reporting, including more accurate file, line, and column information in the majority of cases.
    I don't know that I can suggest a work around apart from only using one level of modules for the moment. We are actively working on getting the next version of DB XML out the door as I speak...
    John

  • Relative path for HTML file

    Hi ,
    This is my requirement. In the ESS Personal information overview page, I can add a HTML file to the additional information section.
    I have created a HTML file by creating a web module and enterprise application and deployed the same through NWDI.
    I declare a resource wher ei mention the path. Here i specifed the complete path of the html file ... like
    http://hostname:portname/addinfo/addinfo.html.  Which i know is a wrong thing to do since when i move the html filel to the production system it will still be accessing the html file in the dev system.
    How do i give the relative path here so that the html file accessed is from the production system when we  go-live.
    Please suggest.
    regards
    sam

    Hi,
    One simpler solution is to use an AppIntegrator iView, as explained in the weblog <a href="https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2786">Integrating your Web Front-ends into the SAP Enterprise Portal using the Application Integrator</a>. It worked well for us.
    You can remove the user authentication part in the portalapp.xml if you don't need it.
    Regards,
    Martin

  • Relative path for servlet property file.

    I have the following java file. When I use the absolute path for the configFile, it works. I would like to know how I could use it as relative path as in installation, the name of the directory could change.
    How do I fix the problem? Thank you.
    ---------------------- LoadProperties.java ----------------
    import java.util.*;
    import java.io.*;
    public class LoadProperties {
    private String driver="";
    private String dbURL="";
    private String login="";
    private String password="";
    static public void main(String[] args) {
    LoadProperties lp = new LoadProperties();
    } // main
    public LoadProperties() {
    //String configFile = "C:/1LMS/web-app/WEB-INF/config/db.properties";
    String configFile = getClass().getResource("config/db.properties").toString(); <--- This line could not find the db.properties file.
    Properties Prop = new Properties();
    try {
    FileInputStream configStream = new FileInputStream(configFile);
    Prop.load(configStream);
    configStream.close();
    } catch(IOException e) {
              System.out.println("Error: Cannot laod configuration file ");
    driver =Prop.getProperty("driver");
         dbURL = Prop.getProperty("dbURL");
         login = Prop.getProperty("login");
    password = Prop.getProperty("password");
    printResult();
    } //Load Property
    private void printResult() {
         System.out.println("Driver = " + driver);
         System.out.println("dbURL = " + dbURL);
         System.out.println("Login = " + login);
    System.out.println("PSWD = " + password);
    } // class

    hi there,
    had the same problem... you need to use following API:
    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String)
    In your case something like that:
    // get the servlet context
    ServletContext context = getServletContext();
    // directory name where the file is located
    String realPath = context.getRealPath("/config");
    // get real path to your file
    String propertyPath = real+"filename.txt";
    hope that helps!!
    minu

  • Relative path of XSL in RTF

    Hello,
    I want to use common xsl file in RTF template. I will hardcode the path of the xsl file. Path should be relative path. Can anyone tell me how can I import xsl file into RTF template using relative path. e.g relative path may be BIP web cerver path. Currently I am using <?import: http://xp1111.xxx.co.in:9704/abc.xsl?> but it is not relative path.
    Thanks,
    Amit D.

    Hi Tim,
    I am using BIP 10.1.3.3.2. I am able to access system variable CURRENT_SERVER URL.
    Steps:
    <?param@begin:CURRENT_SERVER_URL?>
    <xsl:value-of select="$ CURRENT_SERVER_URL"/>
    CURRENT_SERVER_URL is getting printed in BI Publisher. Value displayed is http://xx4697.xxx.co.in:9704/xmlpserver.
    Now we are importing xsl into RTF template. File aaa.xsl is stored at [BIP_Installation_Directory\oc4j_bi\j2ee\home\default-web-app]
    We have hardcoded the path for XSL in RTF. The path is <?import: http://xx4697.xxx.co.in:9704/aaa.xsl?>
    As we want to set dynamic path we changed hardcoded xsl path to <?import: {$CURRENT_SERVER_URL}/../aaa.xsl?> but it is not working. Sometimes BIP is taking local path of MyDocuments folder and sometimes Desktop path. If I put that XSL file in MyDocuments folder or Desktop, it is working fine. But ideally it should refer [BIP_Installation_Directory\oc4j_bi\j2ee\home\default-web-app] path.
    Thanks,
    Amit D

  • Using Relative Path instead of Full Path OMBPlus

    Can we use relative paths in OMBPlus scripts instead of full paths. For example all my OMBplus (tcl) scripts are in folder;
    C:\tfsroot2\Interfaces and Extracts\branches\Interfaces and Extracts1.1\000 - OWB Prototype\deploy\ora.stg
    and the MDX file I would like to deploy is in
    C:\tfsroot2\Interfaces and Extracts\branches\Interfaces and Extracts1.1\000 - OWB Prototype\deploy\ora.stg\scripts\dwextract\tables
    but when I try to use
    OMBIMPORT MDL_FILE '../scripts/dwextract/tables/$tblName.mdx'
    instead of
    OMBIMPORT MDL_FILE 'C:/tfsroot2/Interfaces and Extracts/branches/Interfaces and Extracts1.1/000 - OWB Prototype/deploy/ora.stg/scripts/dwextract/tables/$tblName.mdx'
    It does not work.
    I use
    call "C:\OraHome_1\owb\bin\win32\OMBPlus.bat" "C:\tfsroot2\Interfaces and Extracts\branches\Interfaces and Extracts1.1\000 - OWB Prototype\deploy\ora.stg\OMB_DEPLOY_TBL.tcl" XTRCT_WRK_INPUT_FILE
    in order to execute.
    I think it is because It set the OMBPlus.bat location is a base folder. Any way to overcome this issue and use relative paths instead of the full path?

    OK, a couple of things. First, you need to remember that TCL treats back-slashes as an escape character. Always use forward slashes in your paths, or double up the back slashes .
    So, this should work:
    CD "C:\tfsroot2\Interfaces and Extracts\branches\Interfaces and Extracts1.1\000 - OWB Prototype\deploy\ora.stg"
    call OMBPlus.bat "C:\\tfsroot2\\Interfaces and Extracts\\branches\\Interfaces and Extracts1.1\\000 - OWB Prototype\\deploy\\ora.stg\\OMB_DEPLOY_TBL.tcl" XTRCT_WRK_INPUT_FILEor this:
    CD "C\tfsroot2\Interfaces and Extracts\branches\Interfaces and Extracts1.1\000 - OWB Prototype\deploy\ora.stg"
    call OMBPlus.bat "C:/tfsroot2/Interfaces and Extracts/branches/Interfaces and Extracts1.1/000 - OWB Prototype/deploy/ora.stg/OMB_DEPLOY_TBL.tcl" XTRCT_WRK_INPUT_FILEAs an FYI for OMB, if you are prone to doing a lot of scripts and so building libraries of common functions, you can also easilly use the "file" command in order to determine the current directory at runtime so you can plunk your script anywhere with it's required libraries and it will be able to source them at runtime.
    For example, all our scripts have this basic bit of code at the beginning so we can pass them between developers and it doesn't matter where anyone put their script directory - the scripts will find the libraries as long as they are co-located:
    #  Get Current Directory and time
    set dtstmp     [ clock format [clock seconds] -format {%Y%m%d_%H%M}]
    set scrpt      [ file split [file root [info script]]]
    set scriptDir  [ file dirname [info script]]
    set scriptName [ lindex $scrpt [expr [llength $scrpt]-1]]
    set cnfg_lib "$scriptDir/ombplus_config.tcl"
    set owb_lib  "$scriptDir/omb_library.tcl"
    set sql_lib  "$scriptDir/omb_sql_library.tcl"
    #  Import Lbraries
    #      Assumes that owb_config, omb_library, and omb_sql_library are in the same directory as this
    #      script.
    #get config file
    if [catch { set retstr [ source $cnfg_lib ] } errmsg] {
       puts "**********************************************************************"
       puts "* Libraries are missing from the current directory. Exiting.... *"
       puts "**********************************************************************"
       return -code 2
    #get standard library
    source $owb_lib
    source $sql_lib
    #  Set Logfile
    #    This will overwrite anything set in the config file.
    set LOG_PATH "$scriptDir/logs"
    file mkdir $LOG_PATH
    set    SPOOLFILE  ""
    append SPOOLFILE $LOG_PATH "/log_"  $scriptName "_" $tabName "_" $dtstmp ".txt"
    # Now the main script body goes from here.Cheers,
    Mike
    Edited by: zeppo on Aug 4, 2009 7:02 AM
    Edited by: zeppo on Aug 4, 2009 7:03 AM

  • Insertion of relative path of dtd failing with XMLType

    Hi
    We are using Oracle10g as the database and want to insert an xmltype data in the table.
    The problem is with the xml contains one relative path of the dtd file, which is existed in the local file system.
    Code snippet follows,
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE worksheet SYSTEM "../../Core/Library/worksheet.dtd">
    <worksheet name=".*">
    <import file="FormListsAdminStandard.xrl"/>
    <layouts>
    <formlayout name="STANDARDADMIN" layout="Flow" location="top" >
    <page name="first">
    <input name="applicationKey" displayName="Application Key" type="comboBox" listName="Application_Key_List" width="80" height="20"/>
    <input name="eventPeriod" displayName="Event Period" type="textBox" width="80" height="20"/>
    <input name="period_in_days" displayName="Period in days" type="numberBox" width="80" height="20"/>
    <input name="noOfdays" displayName="Number of days" type="numberBox" width="80" height="20"/>
    </page>
    </formlayout>
    </layouts>
    </worksheet>
    Please let me know any ideas
    Thanks in advance
    Sirisha

    Writing this function yet again, hoped there was an easy way to get the parent directory directly (as a property?)
    I followed Luca's link, but the VIs referred to there don't take LLBs into account (they'll strip parent EXE but not a parent LLB.)
    The attached VI handles LLBs and outputs VI prefix, "Is EXE?", and immediate parent-path as well.
    Message Edited by Dynamik on 11-15-2005 11:59 PM
    Message Edited by Dynamik on 11-16-2005 12:01 AM
    Message Edited by Dynamik on 11-16-2005 12:02 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    Util.VI.ParentDirectory.vi ‏38 KB

  • Webutil.client_host relative path

    Hi, I'm upgrading an old 6i client application. There are some calls to host commands that contain relative paths.
    ..\import\start.batFrom 10G using client_host these files are not found. Probably the paths are not relative to the location of the fmx file?
    Edited by: Rene W. on Jan 29, 2009 1:07 AM
    Solved, should have left "host' instead of client_host in this particular instance.

    Hi, yes I realized that after posting my question. We start a couple of conversion tools before loading data into the database. Advantage of the webforms is that files can be uploaded to the AS and conversion can run from there. No need to have the conversion tools on all the clients anymore.

  • How to use relative paths in Captivate 8 / Cómo usar URL's relativas en Captivate 8

    Hello, I have developed a bunch of courses which will be migrated to a new site and I am having trouble changing the absolute paths into relative URL's to resources such as PDF files inserted into the scorm packages. I cannot find information on how to use relative paths in Captivate. Please help. Thank you.

    I have the same issue with relative links using Captivate 8.  I am trying to load Captivate modules into an LMS using relative links to document files within the LMS.  The links work fine during a site page test so not an issue in the LMS, but from the Captivate module they aren't working....
    Help?

  • Imported modules missing titles

    Hello, all,
    Hopefully, someone has experienced this issue before and can shed some light on the subject, and, hopefully, a viable solution...
    This is a different title issue than I've previously posted (these modules all had correct titles, and no mysterious rewrite of the resources path)...
    We have an application, Main, that acts as a "host" for indiviual nested modules/apps (JAR files)... For instance, Main has the MainModel and MainViewController, and the running app displays Acquisitions, Disposals, and RAP Application modules as tabs. We've placed the paths to the individual ApplicationResources_en.properties, separated by commas, in the "Imported Resource Bundles" property under "Internationalization" in the JHS App Def Editor.
    We had titles showing up, and then one day they stopped, for all but one (RAP Application)... We've been trying to diagnose the issue (hopefully, we just changed a setting on accident), but everything appears to be set up correctly, and we still need to keep merging/importing modules as they are completed in order to meet the deadline...
    We added Management, and RAP still had the only titles... Once we added Work Assignment, though, only the Work Assignment tab would show titles. Then we added Hotline, but Work Assignment still had the only titles... Maybe it's just coincidence, but it seems the last tab name in the alphabet gets titles...
    We're experimenting with a workaround (will post it, if it resolves the issue), but we'd really prefer to get the process to work as described in the documentation...
    Once again, thank you for any replies/advice/assistance...
    Happy Thoughts,
    --DaveB
    "Most people are about as happy as they make up their minds to be."
    --Abraham Lincoln                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Thanks, Steven!
    One of our other developers found that little nugget of knowledge in his research of the issue... Once we deployed them all without the JhsCommon-beans.xml, all was well... :-)
    We also had some server log warnings popping up about duplicate pageDef identifiers for all of the UIShell and PopupShell pageDefs that JHS generates. We fixed that issue by givng them all unique names in each module's DatBindings.cpx before deploying the module(s) as JAR files and importing the libraries...
    I was coming back here to post the solution, but you beat me to it... Many thanks for the reply, though!
    Happy Thoughts,
    --DaveB
    "Most people are about as happy as they make up their minds to be."
    -- Abraham Lincoln

  • TestStand API: Set relative path

    Dear NI community!
    Could someone help, please, with the following - is there is some option to set file path to code modules, inside test sequence, to have relative, but not absolute path? I add programmatically code modules to sequence steps, but currently they have absolute path. Is it possible to change it to relative with TestStand API?
    Thanks in advance.
    Solved!
    Go to Solution.

    I was wrong. It's possible to manually cut path to file (according to Search Directories of TestStand). Then code modules will be added with relative pathes. But one should be careful - path should be cut correctly.
    For example, I have full path
    E:\Development\source code\supplementary\TestVIs\Code Modules\Service\Print.vi
    My Search Directory is 
    E:\Development\source code\supplementary\TestVIs\
    So, I need to cut like this:
    Code Modules\Service\Print.vi
    and without slash at the beginning!
    Then it will be OK.

  • Import-Module 'sqlps' -DisableNameChecking is returning a bunch of warnings I do not want to see in output. How do I supress them?

    Hi All,
    I find that with SQL 2012 and SQL 2014 I get the following types of WARNING: messages displayed when I import the sqlps module.
    WARNING: The local computer does not have an active instance of Analysis Services.
    WARNING: Could not obtain SQL Server Service information. An attempt to connect to WMI on 'Microsoft.WindowsAzure.Commands.SqlDatabase.Types.ps1xml' failed with the following error: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
    I've tried adding -WarningAction SilentlyContinue and I've tried piping the output to null by adding | Out-Null but I still get this garbage that I don't care about on the servers I'm running these scripts on.  Do any of you know how to suppress these
    warnings?
    Joe
    Joe Moyle

    Hi
    These errors have nothing to do with the loading of the SQLPS CmdLets/Functions/etc...... They are because of a general failure when you try and locate the Azure modules and therefore this only occurs when you install the Azure PowerShell modules.... let
    me explain
    But before I do, a warning, DO NOT MODIFY THE FILES I MENTION!!!
    When you run: Import-Module SQLPS
    PowerShell loads up the Module Mainfest C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\SQLPS\SQLPS.PSD1
    This references the script file SqlPsPostScript.PS1 in the same path..... here is where the problem lies.
    This script has a step which is designed to import the SQLASCmdlets module and it is this step which is throwing the warnings. However, again it has nothing to do with the SQL module. The problem actually even happens if you just run: Get-Module -ListAvailable
    Now this is where we get stuck as the Azure SQL module is a Binary Module (aka it loads .dlls). Best option is to live with the warnings, because if you suppress them and another module starts to give you warnings then you won't know something is going wrong.
    And finally I just checked and there is a new Azure PowerShell SDK released on the 2nd October so it would be worth downloading that as this might be fixed.
    P.S. I am going to blog about this and will update with a link when I do.

Maybe you are looking for

  • Shadows doesn't work. How to fix it?

    When I go to Edit > Adjust > Shadows and start the slider to brighten the photo, the screen goes blank. This is a much-used feature. I haven't used the Macbook for a few months, and I've updated software; it worked before. I want to improve some pix

  • T400s heat at the bottom of the display frame

    recently, i noticed that the center bottom of the display frame is very warm, while the other parts are quite cool. is this related to the driver of the graphic card? I recently installed tha driver provided by Lenovo (ver. 8.15.10.1855). before this

  • Thumb Wheel not working...

    well... i leave my ipod in my glove box of my car so it's out of the way and hooked up to my headunit of my stereo. since it's been in there... when i take it out to put new songs on it, i can't scroll through the songs to look, only hook it up and l

  • How to use select max and min query..

    hi gurus, we have got a custom report for develoment. the report has to fetch the max and min salarys department wise.... how to pick up max & min sal ansal from table pa0008.

  • Blank Java Windows

    Hi All, Just a quick one that relates to my previous post. I'm having a lot of trouble using the database configuration tools because a lot of the screens that appear are blank. They obviously have information and buttons on them (if I click in the r