4 Replies Latest reply: Nov 20, 2012 12:44 AM by Eric Elzinga RSS

    A Filter problem of XQuery Transformation in OSB

    936963
      in a project, i use XQuery Transformation of OSB to realize filter function,but have some trouble.
      in the XQuery Transfornation,i use xuquer's FWR expression
      " <ns0:name>
      { for $cp in doc("D:\osbspace\Test\XQUERY\book.xml")/bookstore
      where $cp/book= data($getGreeting1/ns1:name)
      return 2
      }
      </ns0:name>
      "
      to get the "book.xml", can only use Absolute path("D:\osbspace\Test\XQUERY\book.xml"),but
      i want to use Relative path like"../XQUERY/book.xml",and it report abnormal"Error retrieving resource 'file://book.xml'".

      I have tride in the XMLSpy,the ative path is worked,why can't it(Relative path) be used in OSB's XQuery Transformation?

      Anyone can help me? Sorry for my bad English.
        • 1. Re: A Filter problem of XQuery Transformation in OSB
          vladodias
          Hi,

          Have a look at this one... Search for "relative URL"... Not sure if that will work on OSB...
          http://www.xquery.com/tutorials/xquery_tutorial/path-expressions.html

          Please let me know if you can make it work...

          Cheers,
          Vlad
          • 2. Re: A Filter problem of XQuery Transformation in OSB
            936963
            HI,

            I have tried,
            Use XMLSpy,Both of the absolute URL and the relative URLs are worked!
            and use the Base URI is also worked.

            But in osb the relative URLs is not worked,use Base URL get ERROR" {bea-err}SYS001: This functionality has not been implemented (sorry)",

            So far,in osb can only use absolute URL,it is not well portability.
            • 3. Re: A Filter problem of XQuery Transformation in OSB
              vladodias
              933960 wrote:
              use Base URL get ERROR" {bea-err}SYS001: This functionality has not been implemented (sorry)",
              Yep, I was afraid of something like that... At least this confirm it was not implemented...

              You'll probably have to include some java code in... Have a look at custom functions...
              http://docs.oracle.com/cd/E23943_01/dev.1111/e15866/custom_xpath.htm#OSBDV1725

              Cheers,
              Vlad
              • 4. Re: A Filter problem of XQuery Transformation in OSB
                Eric Elzinga
                you could use the doc() function, i haven't tested this with a "file://" uri in it
                http://www.xenta.nl/blog/2010/12/23/oracle-service-bus-using-external-domain-value-mappings-dvm/

                otherwise you could copy/paste the xml in a xquery file and assign this in your process (and as input variable of your 'other' xquery file which does the xpath expressions on it)
                but this is more or less a not-so-wonderful workaround