Oracle SOA Suite : import in xsl from mds location

In one of my xsl transformations i needed to import a generic xsl from the mds store.
For this i created a new jdeveloper application with a soa sar deployment descriptor and jar descriptor in it.

Contents of the jar :

	SharedMDSResources/generic.xsl

When i browse the mds repository i see the SharedMDSResources folder in the root of the tree (instead of in the apps folder).

For testing i deployed the jar manually in the EM.


In my xsl i use the next import :

  <xsl:import href="oramds:/SharedMDSResources/generic.xsl"/>

Resulting in the next stacktrace :

The following exception occurred while attempting to execute operation copy at line 389
<exception class="com.collaxa.cube.xml.xpath.XPathException">
<parsererror style="display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black">
<h3>This page contains the following errors:</h3>
<div style="font-family:monospace;font-size:12px">
error on line 7 at column 1: Extra content at the end of the document
</div>
<h3>Below is a rendering of the page up to the first error.</h3>
</parsererror>
XPath expression failed to execute.
An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc('xsl/format_dates.xsl', $csvXml).
The XPath expression failed to execute; the reason was: XML-22000: (Fatal Error) Error while parsing XSL file (oramds:/deployed-composites/default/mycomposite_rev1.0/xsl/my_process.xsl<Line 3, Column 46>: XML-22002: (Fatal Error) Error while processing include XSL file (oramds:/SharedMDSResources/generic.xsl).)..
Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
<stack>
<f>com.collaxa.cube.xml.xpath.BPELXPathUtil.evaluate#262</f>
<f>com.collaxa.cube.engine.ext.bpel.common.BPELWMPHelper.evalFromValue#339</f>
<f>com.collaxa.cube.engine.ext.bpel.v1.wmp.BPEL1AssignWMP.__executeStatements#137</f>
<f>com.collaxa.cube.engine.ext.bpel.common.wmp.BaseBPELActivityWMP.perform#158</f>
<f>com.collaxa.cube.engine.CubeEngine._performActivity#2463</f>
<f>com.collaxa.cube.engine.CubeEngine.performActivity#2334</f>
<f>com.collaxa.cube.engine.CubeEngine.handleWorkItem#1115</f>
<f>com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal#73</f>
<f>com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage#220</f>
<f>com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory#328</f>
<f>com.collaxa.cube.engine.CubeEngine.endRequest#4350</f>
<f>com.collaxa.cube.engine.CubeEngine.endRequest#4281</f>
<f>com.collaxa.cube.engine.CubeEngine.createAndInvoke#679</f>
<f>com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke#654</f>
<f>com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke#293</f>
<f>sun.reflect.GeneratedMethodAccessor944.invoke</f>
<f>...</f>
</stack>
</exception>

Problem

Since i deployed the jar manually from within the EM the SharedMDSResources folder will not be created in the apps-dir but in the root of the tree.
The oramds imports can only import from within the apps folder structure.

Solution

When manually creating the jar archive make sure the contributor has the apps-directory already in the path

Path : d:\SharedMDS\apps\SharedMDSResources\

After the import the mds repository will contain the path ‘oramds:/apps/SharedMDSResources/generic.xsl’

Or keep the jar as it was (folder/file structure = SharedMDSResources/generic.xsl) and use the scripts from for example Edwin and setup the ‘mds.reposistory’ correctly (ending with the apps-directory in it).

example topfragment of a xslt we currently use (this is not the xslt mentioned in the blog, but just a working example with oramds import)

<xsl:stylesheet version="1.0"
                xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
                xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
                exclude-result-prefixes="xsl hr xp20 oraext dvm">
    <xsl:import href="oramds:/apps/sharedResources/generic.xsl"/>
    <xsl:output method="xml" indent="yes"/>
    <!-- -->
    <xsl:param name="param1"/>
    <xsl:param name="param2"/>
    <!-- -->
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

5 Responses to “Oracle SOA Suite : import in xsl from mds location”

commenter

Hi Eric,

Did you manage to deploy xsl which includes xsl from oramds? Can you send me an example?

Many thanks,
Yuke

commenter

Hi Yuke,

Yes we do that in some of our composites and they deploy just fine.

I added this part “topfragment of the xslt” in the blog.

commenter

Hi Eric,

Thanks for your prompt response.

I also manage to get it working now, following your instructions. However, I wonder if you encountered the following issue with included XSL template being copied into the project when switched to design view.

https://community.oracle.com/thread/3520665

If that’s a Jdeveloper feature, wonder if there is a way to turn it off.

Many thanks,
Yuke

commenter

Hi Yuke,

What’s the filelocation of the xsl in which you do the oramds import ? Is this xsl in the soa content folder ?
I mostly use xmlspy to do my xslt testing and when it’s all done i change it to oramds imports

commenter

Hi Eric,

No, it isn’t. The XSL’s are in a different project. If you do your XSLT development in XMLSpy, then it would not be a problem. It will only become an issue when you view your XSL in design view in Jdeveloper, as described in the Oracle thread. It’s just bizzare.

Anyway, thanks for your help.

Cheers,
Yuke

Leave a Reply:

Name (required):
Mail (will not be published) (required):
Website:
Comment (required):
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>