Xsl:import or xsl:include for ESB projects ?

I have an XSLT stylesheet transformer in a routing service on the ESB, and it uses an <xsl:import> of another stylesheet. I have forced the auxiliary stylesheet into the project zip for deployment alongside the main stylesheet, but the XSLT engine cannot resolve the imported file, the error is either:
"No protocol" if I just use "foo.xsl"
"FileNotFound if I try "file:foo.xsl"
The XSLT engine should import a relative URI wrt the main stylesheet, but it appears it cannot handle relative URIs, and what it's really expecting is a file: or classpath: protocol.
Any ideas what URI incantation I need for it to locate the imported stylesheet ?
Mik

A bit of reverse engineering of the error message, reveals the shocking fact that I have to use this URI:
<xsl:import href="esb:///ESB_Projects/MyProject_esb/foo.xsl" />
So the stylesheets have to be modified from the original form used outside the ESB, and even changed depending on the project which contains them !
Please tell me there's a better way ?
Mik

Similar Messages

  • Jdeveloper, creation of a transformation for ESB project

    When I create a transformation, in a Routing Service, using a WSDL that has a operation that returns a string type (for example string called: status), the XSL is created but when I got to the desing of the XSL so i can create the mappings, i cannot define any mapping in the UI because it displays the error message: invalid reference status. Similar error happens when I create a JMS adapter, when I try to specify a schema to use that is sinde the wsdl, it displays the error, then i cannot save my changes so no JMS adapter can be created. Do you guys had experimented similar issue?

    User,
    I suggest you ask on the [url http://forums.oracle.com/forums/forum.jspa?forumID=320]SOA Suite Forum
    Best,
    john

  • xsl:include in XSL Workshop

    I am trying to use <xsl:include> for some proxy stylesheet. I use the form
    <xsl:include href="filename.xsl" />
    I get the following error when process the stylesheet:
    'Bad URI found while including/importing file: no protocol: filename.xsl'
    Currently I am just working with the workshops, I have not deployed the xsl stilesheets yet to the server.
    Everything works as expected in XMLSpy.
    Does anybody have an example of a working <xsl:include>?

    what about putting that file in the respository? or set up the XMLDIR and put it there? I have never done it but just a though.
    Ben

  • Xsl:include and xml:import

    I want to use another stylesheet within the original one.
    the documentation just said how to declare an
    xsl:include or xsl:import element as top level, but no examples about how to call the imported or included stylesheet.
    I'll appreciate any examples you can provide to me .
    Thanks
    Chris

    I've done this, and the way i think about it is that each "imported" XSL document combines (or are appended) into the XSL document that imports the other XSL documents. As such, all of the template matching that is occuring has to be consistent with the way the XML tags are matching up with XSL templates.
    It is important that the templates in each imported XSL document will match up to the XML tags that the templates are designed to transform.
    In other words, if i have an employee list <emp>, and an XSL template matching the <emp> element, i can produce a transformation on the list itself. now, i can define a transformation for a child element of <emp> by "importing" the XSL document that defines the template match for the child element (for example, "emp/lastName" can be what the second XSL document matches on).
    Long story short, if you can paste the imported XSL into the importing XSL and things still work, then you can separate them out into multiple modular XSL files for inclusion.
    -dave
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Christos Kouros ([email protected]):
    I want to use another stylesheet within the original one.
    the documentation just said how to declare an
    xsl:include or xsl:import element as top level, but no examples about how to call the imported or included stylesheet.
    I'll appreciate any examples you can provide to me .
    Thanks
    Chris<HR></BLOCKQUOTE>
    null

  • CAN'T CREATE or Modify ESB PROJECT ROUTER TRANSFORM/XSL FILE

    I have a problem that started today. I did not have a problem last Friday. I am working on an ESB Project/program using JDeveloper 10.3.1.2. I
    have a router service that has 2 routing rules. Today when I went to edit the transforms/XSL files it will not show the design view and gives me the error message: "Required attribute version missing from element xsl:stylesheet". In the source view I can see that in any one of my xsl files it has "version="1.0". I tried to delete and recreate the transform files and I still get the same problem (only this time it will not even save the mappings). If I try to validate the XML file Jdeveloper hangs and has to be killed. I tried rebooting my machine and that did not help. I went to another project that I hadn't worked on in 2 weeks and tried to look at some routing service transforms and got the same error message when I tried to display them.
    I don't know what is going on. Anyone ever have this problem?
    Nick

    Strange but the problem seems to have just gone away on its own!

  • Xsl:include xsl:import and clob

    I can use xslprocessor.processXSL to perform transformation where the XML and XSL are in CLOBs.
    However, is it possible to perform transformation if the XML and XSLs are in CLOBs and the XSL have xsl:include and xsl:import?
    Thanks and Regards,
    Andy

    It will be supported in later release.

  • Problems faced when using xsl:include and extension functions

    I am Working in XML and XSLT using Oracle's XML Parser V2.
    Previously i had worked in Microsoft technology using MSXMLParser.
    I am facing some problems in XSLT. They are as below...
    1. Using <xsl-include href="Somexsl.xsl">
    the oraclexmlparser processor is giving the error : XSL-1002: Error while processing include XSL file (no protocol: Submenu.xsl).
    * Can u tell me why i am getting this error, and what is the fix for this.
    The same case with <xsl:import> too.
    2. In case i have to write some functions in the previous WD of xsl i used these statements
    <?xml version='1.0'?>
    <!DOCTYPE PageRoot SYSTEM "../../Common/dtd/PageNavBar.dtd">
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/TR/WD-xsl"
    xmlns:html="http://www.w3.org/TR/REC-html40"
    result-ns="">
    <xsl:script xmlns:xsl="uri:xsl"><![CDATA[
    var strWebContentPath = "/SurSITE/Content/";
    var strWebImagePath = "/SurSITE/sursitegraphics/";
    function IncScript()
    return "<script language='javascript' src='/SurSITE/Includes/avalidations.js'></script>";
    ]]>
    </xsl:script>
    To call the function i used this
    <xsl:eval no-entities='true'> IncScript();</xsl:eval>
    * Can u tell me how do i do this now, i tried with the code above using the current name space (<xsl:stylesheet version="1.1"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />)
    Please use the example given above.
    I will be very greatfull to u if u can give me some suggestion or help for the above said problems.
    Thanking you and eagerly waiting for your reply(s).
    null

    The current version is "1.0" not "1.1"
    You haven't included the code for what your <xsl:include>
    statement looks like, which seems to be what it's complaining
    about...
    XSLT 1.0 has no <xsl:eval>, this is a microsoft specific tag
    from a pre-XSLT-1.0 version.
    XSLT 1.0 has no <xsl:script> element either.

  • XSL mapping in ESB flow

    I created an ESB flow that uses a file adapter service to read a simple xml file in and map required data to a Soap service. I was forced to map all fields for the input to the soap service, either by "hard coding" values in the xsl or modifying the schema of the incoming file to include all fields and then add mappings. If I didn’t map something to all the fields, the flow would complain and not invoke the soap service. The error message would reference: expected field1 and found field2. All elements are defined as Nillable=true in the wsdl, so I’m not sure why we would be required to map to it. Even if the data being mapped is null, it requires the mapping exist.
    I just wanted to make sure there is not another setting that I’m missing somewhere or if this is expected behavior I’m not aware of.

    I guess I am expecting that if I don't map anything to the target within the XSL Mapper, it will create the empty tag similar to how the test application does in OAS or JDeveloper. For example: The payload created in ESB leaves the tag out completely if that field is not mapped. When testing a webservice, you have the capability of checking whether to include a field/node or not before invoking, if you uncheck not to include, the tag is still created, its simply empty. I would have expected similar behavior in ESB mapping. Below the fields effectiveDate and version are not mapped and in the JDev test they are unchecked, so are considered "not included".
    Here is the payload created from XSL Mapper in ESB:
    <ns1:addAddressBookElement xmlns:ns1="http://oracle.e1.sbf.JPR01000/types/">
    <ns1:entityTypeCode>E</ns1:entityTypeCode>
    <ns1:businessUnit>ESB137</ns1:businessUnit>
    <ns1:entityName>Test ESB Flow for Iteration3</ns1:entityName>
    <ns1:entityAddress>
    <ns1:address>
    <ns1:postalCode>80121</ns1:postalCode>
    <ns1:addressLine3/>
    <ns1:mailingName>ESB Test</ns1:mailingName>
    <ns1:countyCode/>
    <ns1:addressLine4/>
    <ns1:countryCode>US</ns1:countryCode>
    <ns1:addressLine2/>
    <ns1:stateCode>CO</ns1:stateCode>
    <ns1:city>Denver</ns1:city>
    <ns1:addressLine1>123 Main</ns1:addressLine1>
    </ns1:address>
    <ns1:entity>
    <ns1:entityLongId/>
    <ns1:entityTaxId/>
    <ns1:entityId>0</ns1:entityId>
    </ns1:entity>
    </ns1:entityAddress>
    <ns1:phones>
    <ns1:phoneNumberType>HOM</ns1:phoneNumberType>
    <ns1:phoneAreaCode>303</ns1:phoneAreaCode>
    <ns1:phoneNumber>333-333</ns1:phoneNumber>
    </ns1:phones>
    </ns1:addAddressBookElement>
    and here is the payload created from testing the WebService in JDev.
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body xmlns:ns1="http://oracle.e1.sbf.JPR01000/types/">
    <ns1:addAddressBookElement>
    <ns1:entityTypeCode>E</ns1:entityTypeCode>
    <ns1:businessUnit>30</ns1:businessUnit>
    <ns1:effectiveDate xmlns:ns2="http://www.w3.org/2001/XMLSchema-instance" ns2:nil="true"/>
    <ns1:entityName>Test No Date</ns1:entityName>
    <ns1:entityAddress>
    <ns1:address>
    <ns1:postalCode>80121</ns1:postalCode>
    <ns1:addressLine3 xmlns:ns3="http://www.w3.org/2001/XMLSchema-instance" ns3:nil="true"/>
    <ns1:mailingName>Test no date</ns1:mailingName>
    <ns1:countyCode xmlns:ns4="http://www.w3.org/2001/XMLSchema-instance" ns4:nil="true"/>
    <ns1:addressLine4 xmlns:ns5="http://www.w3.org/2001/XMLSchema-instance" ns5:nil="true"/>
    <ns1:countryCode>US</ns1:countryCode>
    <ns1:addressLine2></ns1:addressLine2>
    <ns1:stateCode>CO</ns1:stateCode>
    <ns1:city>Denver</ns1:city>
    <ns1:addressLine1>121 Main</ns1:addressLine1>
    </ns1:address>
    <ns1:entity xmlns:ns6="http://www.w3.org/2001/XMLSchema-instance" ns6:nil="true"/>
    </ns1:entityAddress>
    <ns1:version xmlns:ns7="http://www.w3.org/2001/XMLSchema-instance" ns7:nil="true"/>
    <ns1:phones>
    <ns1:phoneNumberType>HOM</ns1:phoneNumberType>
    <ns1:phoneAreaCode>303</ns1:phoneAreaCode>
    <ns1:phoneNumber>334-5769</ns1:phoneNumber>
    </ns1:phones>
    </ns1:addAddressBookElement>
    </soap:Body>
    </soap:Envelope>

  • How to configure the Oracle XSL Mapper for ‘schemaLocation’ attribute?

    In the Transformation_1.xsl I need to have the ‘schemaLocation’ attribute defined as such:
    <inc:CaseIncidentReport xsi:schemaLocation="http://caseincidentreport.com/1.0.4 CaseIncidentReport.xsd">
    This is fine as long as long as I don’t switch to the Design tab. When I switch to the Design tab, Oracle XSL Mapper regenerates the XSL file and renders the root element as
    <inc:CaseIncidentReport>
    Can some one tell me how to configure Oracle XSL Mapper for ‘schemaLocation’ attribute? I am using BPEL Designer/JDeveloper Version 10.1.2.1.0 (Build 1915)
    Thanks,

    What do you mean by normal import? Where can I include the 'schemaLocation' attribute in the Designer? I have no trouble adding the shemaLocation in the source tab but when I switch to the design tab it always stripe it off.
    How do I file an enhancement request? I see the the XSL Mapper needs improvements.
    Thanks,
    Nathan

  • Getting error can not find xsl file at esb:///esb_projects/...

    Hi,
    I have one esb project 'A' that is invoking another esb 'B' that contains transformation. Routing rules are defined from server deployed service no soap service call. So in esbsvc file it puts xsl url as esb:///esb_projects/....
    When i deploy A and test it, i get error unable to find xsl file in path esb:///esb_projects/...
    I tried to look into this issue, it looks like all files are stored under temp_xxx_localhost directory.
    did any one find solution for it?
    Note: this issue will come only if you have transformation at B service.

    Have you checked the logs in enterprise manager on deployment?
    Can you run esb B independently? Again via the em choose the web service end point to test.
    I have not had a problem with a missing xsl. You can create test cases for xsl transformations within JDeveloper which will enable to test the validity of you transformation. But, it sound like you are already beyond this point.

  • Importing Word docs from a RH for Word project

    I have a HUGE RH for Word project that I'm trying to convert
    to RHTML (RH Office X5). We generate CHM with this project, and
    we've got map ids for all topics. I've been to Peter Grainge's site
    to get some ideas, but I don't think they're going to work. There
    are so many Word files and topics (537 and 2,974, respectively)
    that the more I think about it, the more I think that a conversion
    to RH HTML might not be worth it.
    When I tried to import all of the Word documents and also
    convert the TOC (converting the Index isn't an option since it
    never worked with our large number of Word docs) and use the
    HTMLHelp.css (using the Import wizard), RH HTML crashed twice after
    40 minutes.
    So, I created a new RH HTML project and tried to import just
    one Word doc from the RH for Word project, and selected the same
    wizard options. As I expected, the Word doc imported, but even
    though I told RH to split the topics on Heading 2, it also copied
    in the characters (#S+@) that preceded every topic heading and
    incorporated them into the Topic Title. AND, RH HTML did not
    "convert" the TOC - it was blank.
    In another post I saw a reference to this patch -
    http://www.adobe.com/support/security/bulletins/apsb07-10.html.
    I'm not sure it's related, although when I examined my second
    failed import attempt, the imported topics were visible in the
    project folder only by using Windows Explorer - RoboHelp HTML did
    not display them from within RoboHelp.
    Does anyone know if this is the patch that will fix this
    issue as well?
    By the way, based on the number of questions I've seen posted
    about RH for Word 7 with zero replies, I'm thinking I'm going to
    run into issues as well, even if we leave it in RH for Word when we
    upgrade to version 7. It seems that its size is an issue for RH
    HTML.
    Thanks,
    Jim
    Thanks,
    Jim

    Hi Jim,
    just as an encouragement: we sucessfully converted a HUGE RH
    for Word project (4,300 topics) to RH HTML a while ago, including
    TOC, index and everything. I must admit though that we had all
    those topics in only 25 word documents. Maybe you can reduce the
    number of documents by moving the topics? There will always be
    problems you run into and afterward, we had to go through every
    single topic and check the formatting, but I guess you'd always
    have to do this. But I think it's worth it, working in HTML is so
    much more convenient.
    Good luck!
    Kathrin

  • Xsl:include not resolving no matter HOW I load the xslt

    I cannot get *<xsl:include>* to work with XMLTRANSFORM in a PL/SQL environment in Oracle 11.2.0.3. I am exclusively working inside the database.
    I have a base XSLT which includes another XSLT using xsl:include. I want to load the base XSLT as an XMLTYPE and have it transform another XML document, as if the entire XSLT were one large document.
    I have loaded the base (base.xslt), the extension (include_with_base.xslt), and the combination of the two (entire_thing.xslt) in the XDB catalog. base.xslt has this statement inside its xsl:stylesheet node, attempting to include the other xslt:
    *<xsl:include href="/public/include_with_base.xslt" />*
    I have the xslts stored in XDB. This verifies they are intact:
    1. The base xslt which has the xsl:include statement in it loads just fine.
    select xdburitype('/public/base.xslt').getXML() from dual;
    2. The extension which is the target of the include reference in the base xslt loads just fine.
    select xdburitype('/public/include_with_base.xslt').getXML() from dual;
    3. The combination of the two, where I cut-and-paste all children of xslt:stylesheet from include_with_base.xslt into the xslt:stylesheet node of base.xslt also loads just fine.
    select xdburitype('/public/entire_thing.xslt').getXML() from dual;
    However, when I try to execute a transformation of some test xml using base.xslt, it fails:
    select XMLTRANSFORM(xdburitype('/public/xml_input.xml').getXML(), xdburitype('/public/base.xslt').getXML()) FROM dual;
    When I try to execute the same transformation of the same test xml using entire_thing.xslt, it works:
    select XMLTRANSFORM(xdburitype('/public/xml_input.xml').getXML(), xdburitype('/public/entire_thing.xslt').getXML()) FROM dual;
    When I perform the transformation using altovaxml and the two xslts are in the same disk directory (and I use a relative reference with no path information rather than an absolute reference like I show in the examples above), the transformation works just fine.
    What can I do to make XMLTRANSFORM work with an XSLT that has an essential <xsl:include ... /> reference in it?
    Edited by: user11359697 on Apr 15, 2013 1:49 PM

    For fun, here's an implementation of what I would call the "poor man" include.
    The query takes the URI of the main stylesheet as input and recursively replaces all xsl:include directives with the content of the corresponding stylesheet.
    It supports relative URIs.
    Test case :
    */public/include1.xsl*
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:include href="./include2.xsl"/>
      <xsl:template name="test">
        <TEST/>
      </xsl:template>
    </xsl:stylesheet>
    {code}
    */public/include2.xsl*
    {code:xml}
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template name="test2">
        <TEST2/>
      </xsl:template>
    </xsl:stylesheet>
    {code}
    */public/main.xsl*
    {code:xml}
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:include href="./include1.xsl"/>
      <xsl:template match="/">
        <xsl:call-template name="test"/>
      </xsl:template>
    </xsl:stylesheet>
    {code}
    and the query that rebuilds the complete stylesheet :
    {code}
    SQL> select xmlserialize(document      -- for display purpose
      2           xmlquery(
      3           'declare namespace xsl = "http://www.w3.org/1999/XSL/Transform"; (::)
      4            declare function local:include($href as xs:string) as element(xsl:stylesheet)
      5            {
      6              copy $d := fn:doc($href)/xsl:stylesheet
      7              modify (
      8                for $i in $d/xsl:include
      9                return replace node $i
    10                       with local:include(resolve-uri($i/@href, $href))/child::*
    11              )
    12              return $d
    13            }; (::)
    14            local:include($main_xsl)'
    15           passing '/public/main.xsl' as "main_xsl"
    16           returning content
    17           )
    18         indent
    19         )
    20  from dual;
    XMLSERIALIZE(DOCUMENTXMLQUERY(
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template name="test2" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <TEST2/>
      </xsl:template>
      <xsl:template name="test" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <TEST/>
      </xsl:template>
      <xsl:template match="/">
        <xsl:call-template name="test"/>
      </xsl:template>
    </xsl:stylesheet>
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Xsl:include return incorrect base url

    I am using FOP to generate PDF file in servlet.
              I have 2 stylesheets (e.g. a.xsl and b.xsl), they are located in <myapplication>\webapp\application\stylesheet.
              In a.xsl, it includes b.xsl:
              <xsl:include href="a.xsl"/>
              When I test the stylesheet in the command line (dos prompt), it runs fine. However, when I run it in weblogic (6.0), there is an error:
              org.xml.sax.SAXParseException: File "file://C:/bea/wlserver6.0/b.xsl" not found.
              The base url for b.xsl should be the same as a.url. I believe there is a bug in weblogic, isn't?
              Is there anyone who knows how to resolve this exception?
              Thanks.
              - Christina
              

    'set' is a reserved word. So is your column 'values'. Always avoid using reserved words.
    MySQL :: MySQL 5.5 Reference Manual :: 9.3 Reserved Words

  • Xsl:include from classpath

    We are using the XML SDK for Java. We've being trying to use the <xsl:include> tag to include stylesheets with header and footer templates into other stylesheets.
    I get the following error when I try to parse the stylesheet with my xml at run time on the server using the XMLProcessor class:
    XSL-1002: Error while processing include XSL file (no protocol: /common.xsl)
    The only way we can get the <xsl:include> to work is to use the fully qualified URL. For example:
    <xsl:include href="http://localhost/common.xsl"/>.
    Does anybody know how to get the processor to include using the classpath rather than making another request to the web server?
    null

    The transformer won't search the classpath, because that isn't an XSLT concept. If you want your program to control where an xsl:included document is to be loaded from, then you need to write a class that implements URIResolver and set your TransformerFactory to use it. You'd do that like this:SAXTransformerFactory factory = (SAXTransformerFactory) TransformerFactory.newInstance();
    factory.setURIResolver(new BasicURIResolver());(That's an example from code that I wrote.) That class that implements URIResolver simply has to take the href that it's given and do its own classpath search, like this:private static class BasicURIResolver implements URIResolver {
       * @see URIResolver#resolve(String, String)
      public Source resolve(String href, String base) throws TransformerException {
        String url = // some calculation from its parameters
        InputStream is = this.getClass().getResourceAsStream(url);
        return new StreamSource(is);
    }The "resolve" method will be called for every xsl:include, and I had to do some debugging to see what actually gets passed in its parameters. If you want the regular processing to take place instead of your own classpath search then I believe you can return null.
    You might want to invent your own convention, e.g. <xsl:include href="cp://myXSL.xsl"/>, to distinguish those XSLs for which you want to search the classpath.
    By the way, I believe the default, if you don't specify any path information at all, is for the transformer to search in the same directory as the containing XSL.
    PC&#178;

  • XSL Include

    When using XSL Include, is it possible to include HTML files as well? I would like to have a common footer on all of my xsl stylesheets and was hoping xsl-include would do the trick. It will bring in the text, but it strips all the <> tags and leaves me with just plain text. Is there something I can do to the include file to preserve all the HTML tags upon inclusion via xsl-include?

    What you can do is:
    1. Create named templates for
    "header" and "footer".
    2. Put these templates in an .xsl file
    called common.xsl
    3. <xsl:include href="common.xsl"/>
    in the stylesheet where you want
    to use the common header and
    footer.
    4. Add <xsl:call-template name="header"/>
    and <xsl:call-template name="footer"/>
    at the appropriate places in your
    new stylesheet.

Maybe you are looking for