Using xsl document function in transform xsl

I'm trying to use an external xml document in an xsl transform that's used in a Transform activity in an 11g BPEL process:
<xsl:variable name="plants" select="document('plantTransposeLookup.xml')/plants"/>
I need to load up the document to use it in a lookup to get replacement values for a key.
This works fine in JDev, but not when I deploy it to the server.
The error I get when I run it is:
The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: XML-22021: (Error) Error parsing external document: 'no protocol: plantTransposeLookup.xml'.. Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
I've also gotten:
The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: XML-22021: (Error) Error parsing external document: 'Unsupported feature: 'document(''), when stylesheet built using InputStream, Reader'.
I've also tried using the ora:doc function:
<xsl:variable name="plants" select="ora:doc('plantTransposeLookup.xml', 'plants')"/>
......but this doesn't work in JDev and is also erroring off on the server with:
The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: XML-22016: (Error) Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.. Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
Does anyone know how to actually import an xml doc into a mapper??? I must be doing something stupid.
Thanks for any help.

In OSB, document() function needs absolute path of the XML file. So if you want to access the XML document for lookup, you need to put the XML file on the server itself and use the path of the XML file.
Although this is not a correct approach for managing lookups in OSB. The resource of XML Document type are not to be used for such use cases. What you can do is create a XQuery which can server as DVM.
Here is an example on how to use DVMs in OSB:
https://blogs.oracle.com/christomkins/entry/domain_value_maps_in_oracle_se
If you dont want to use XQuery and want to rely only on XSLT, then within the same XSLT document create a separate template which can store all the lookup data.

Similar Messages

  • Use of document function in XSL

    We have an existing XSL document which uses a separate XML document for mapping of enumerated values. So in the XSL document, we have a line in our XSL as follows:
    <xsl:variable name="enum-doc" select="document('enumerations.xml')"/>
    Followed by a load of:
    <xsl:key name="a-name" match="//enum[@name ='a-name']/enumeration" use="@value"/> etc.
    We would like to use the existing XSL in BPEL. Is this possible? We have been able to deploy the mapping XML file with our BPEL process, but the XML mapping file is not beinig picked up by our XSL, so in our output we have a lot of missing enumerated values.
    Any suggestions?
    Thanks,
    ma7asw

    We managed to resolve the problem (We were using the wrong namespace in the XML mapping file).
    So to confirm, it is possible to use the document function in an XSL transform within a BPEL process.
    ma7asw

  • How to use xsl document() function with LiveCycle XSLT processor

    Hello,
    I would like to use LiveCycle XSLT processor to merge xml documents by using the xsl document() function.
    However, I have not, yet, found  clear reference information on the specifics of how to accomplish in LC. For instance if you have
    a transformation that does merging using a standalone xml editor (such as Oxygen), than what is required to accomplish the same
    using the LiveCycle XSLT service.  How do you specify the URI of the XML document that is specified as an input in the xsl document() function. Your insight is appreciated.   Regards

    Hello Steve,
    I checked the reference that you cited (XSLT Transformation).   The reference omits discussing how to use xlst document() function within a stylesheet.  I think that probably means that feature of xslt technology is not directly available through LiveCycle.  When I find a workaround, I'll post an update...for the user community that might encounter the same issue.  Thank you for your response and insight.  Regards, jb1809

  • How to use query-database() function in transformation?

    Hi All,
    How to use query-database() function in transformation?
    It is giving four fields but if i write select query in sqlquery field it is saying select node is not found....
    plz help me out
    Regards
    Pavankumar
    Edited by: [email protected] on Jul 29, 2009 2:49 AM

    Hi,
    To answer your query:-
    http://abhishek-soablog.blogspot.com/2008/08/orclquery-database.html
    Cheers,
    Abhi...

  • Problem in using query-database() function in Transformation

    Hi All,
    I am using JDev and SOA 10.1.3.4.
    I have an async process.
    In that I am doing a transformation in which source is InputVariable and target is result.
    In Transformation I am using query-database function to fetch a record from DB and am assigning that to result.
    *<xsl:value-of select='orcl:query-database(concat("select ename from emp where empid=",/ns1:DBXSLProcessRequest/ns1:input),false(),false(),"jdbc:oracle:thin:scott/tiger@localhost:1521:abcd")'/>*
    I am not getting any error but query-database is not returning any thing I maen it is returning null.
    If i run that query in SQL prompt it is returning the empname.
    Please help me out.
    Regards
    PavanKumar.M

    Hi Pavan
    I tried following in BPEL transform actvity's XSL file, and it works fine and returns the sysdate for me.
    <xsl:value-of select='orcl:query-database("select sysdate from dual",false,false,"jdbc/myDS")'/>
    Can you try above in new XSL file of Transform activity and let me know its gives you the result? if it works you can start making changes according to your requirement.
    steps to follow:
    1.create connection pool in EM, and make sure its working fine by using test on connection pool.
    2.create Datasource and point to above created connection pool. and restart the oc4j_soa
    3.rename the xsl file name of transform activity in BPEL and use above query-database function.some times xsl files are cached even if you make changes it will not take effect so for testing if you rename it will be good.
    Thanks
    Seshagiri.Rayala
    http://soabpel.wordpress.com/

  • Looking for example - abap xslt - that uses xslt document() function

    Hello,
    I'm looking for an example that shows the use of abap xslt with the xslt document() function.  Using the xslt document() function seems like a straightforward way to use xslt to create a result xml document by processing the content of two or more
    source documents.  For example, if source document A.xml and aux.xml are available in  memory as xstringand using stylesheet ztransformwhat would be the argument for the document() function to associate aux.xml.  Thanks for any insight.
    Regards,
    jb10809

    Hi,
    Sorry, perhaps I should have been clearer! The function that I picked just to test what you need to do just happened to return a string that contains SPAN tags with style attributes. The actual function code is:
    create or replace FUNCTION out_string_fn
       RETURN VARCHAR2
    IS
       CURSOR emp_cur
       IS
          SELECT ename
            FROM emp;
       v_string   VARCHAR2 (4000);
    BEGIN
       v_string := ' ';
       FOR c IN emp_cur
       LOOP
          v_string :=
                v_string
             || '&lt;SPAN style="font-weight:bold;color:green"&gt;'
             || c.ename
             || '&lt;/SPAN&gt;'
             || ', &lt;/br&gt;&lt;/br&gt;';
       END LOOP;
       RETURN v_string;
    END;And this returned a naff list in green (see [http://apex.oracle.com/pls/otn/f?p=55041:57] and click the Test button) - but it does show that you can style the validation error messages
    Andy

  • Using pl/sql functions for transformation

    How can I use pl/sql functions in the transformation mapping field for my interface?
    I have a name field where firstname and lastname are concatenated via a space-character and I would like to extract this 'name' field to 2 separate database attributes.
    This means that I need to use a function that uses SUBSTRING and INSTR to be able to get the firstname and lastname separatly out of the name-field.
    The INSTR-function isn't known inside the expression editor in ODI so I'm wondering how I can use my own function?

    Hi Romanna,
    Are you sure? Where did you do your transformation?
    -Source, Staging area or Target
    I try this on Oracle target...
    FIRST_NAME = substr(MYTABLE.FIRST_LASTNAME, 1, instr(MYTABLE.FIRST_LASTNAME, ' ')-1)
    LAST_NAME = substr(MYTABLE.FIRST_LASTNAME,instr(MYTABLE.FIRST_LASTNAME, ' ')+1)

  • URI format for using XSL document function.

    Hi Tim,
    >>but I am not able to figure out where I should place the xml file. What are best practices for choosing a location for the xml file?
    You can place the xslt code and xml file in a single folder, zip it an import it into PI as an external definition. I think this should work
    Regards
    Suraj

    Thank you for your reply.    But my requirements are such that they need to be independent, and not be in the same imported archive (ie ZIP file).    In my case the XSLT code is a standard product that is the same across multiple installations,  but each installation may required some installation specific cross reference values that would be maintained in the XML file.    So I need them separated so if I make updates to my XSLT and distribute it, I do not wipe out the installation specific settings that have been made to the XML file.

  • Getting error while using user-defined function in transform activity

    Hi
    I designed one user-defined function to add 2 nos following the
    link:http://docs.oracle.com/cd/E16764_01/integration.1111/e10224/bp_xslt_mpr.htm .
    Under this i followed the portion creating user-defined function.
    After deploying,i'm getting an error stating:"<summary>
    An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc("xsl/Transformation_1.xsl", $inputVariable.payload).
    </summary>
    <detail>
    XPath expression failed to execute.
    An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc("xsl/Transformation_1.xsl", $inputVariable.payload).
    The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: oramds:/deployed-composites/PO/HelloWorld_rev1.0/xsl/Transformation_1.xsl<Line 6, Column 104>: XML-22045: (Error) Extension function error: Class not found '
         Missing class: addition.add
    can anybody help me in this regard     
    Thanks
    Avinash

    Did you copy the jar file of your java classes to MIDDLEWARE_Home/user_projects/domains/soa_domain/lib?
    http://georgie-soablog.blogspot.com/2010/06/soasuite-11g-implement-user-defined.html
    hope this helps

  • Code sample for using change document function modules

    Can someone send me some sample code for using function modules CHANGEDOCUMENT_READ_HEADER and CHANGEDOCUMENT_READ_POSITIONS?  I'm specifically looking for changes that occured to the standard price field in the material master (MBEW-STPRS) and I need to pull the most recent price change for a given material.  I'm not sure how to write the code efficiently since I don't have a date to pass (again, since we're looking for the most recent change.)
    Thanks!

    hi check this..
    CHANGEDOCUMENT_READ_HEADERS
    Example:
    CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
    EXPORTING
    objectclass = 'EINKBELEG'
    objectid = l_objectid
    username = space
    TABLES
    i_cdhdr = lt_cdhdr.
    LOOP AT lt_cdhdr WHERE udate IN s_aedat.
    CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
    EXPORTING
    changenumber = lt_cdhdr-changenr
    TABLES
    editpos = lt_editpos.
    LOOP AT lt_editpos WHERE fname = 'LOEKZ'
    AND f_new = 'L'.
    p_desc = text-r01. " Cancel Contract
    ENDLOOP.
    ENDLOOP.
    CHANGEDOCUMENT_READ_POSITIONS
    Example:
    CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
    EXPORTING
    objectclass = 'EINKBELEG'
    objectid = l_objectid
    username = space
    TABLES
    i_cdhdr = lt_cdhdr.
    LOOP AT lt_cdhdr WHERE udate IN s_aedat.
    CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
    EXPORTING
    changenumber = lt_cdhdr-changenr
    TABLES
    editpos = lt_editpos.
    LOOP AT lt_editpos WHERE fname = 'LOEKZ'
    AND f_new = 'L'.
    p_desc = text-r01. " Cancel Contract
    ENDLOOP.
    ENDLOOP.
    Check this link.
    http://www.sap-img.com/mm001.htm
    <REMOVED BY MODERATOR>
    venkat.
    Edited by: Alvaro Tejada Galindo on Mar 18, 2008 4:05 PM

  • Use of Document Area/Document Space in KPro

    Hi,
    I hope this is the correct forum for my question. If not, suggestions are welcome.
    We are using KPro to store documents for quality notifications.
    While configuring content repositories (Tx OAC0) and content categories (Tx OACT) I found the field "Document Area" (sometimes referred to as "Document Space"). The documentation on that topic is not very helpful. Could anyone tell me, what's the use of a document area/space? Examples would be very helpful.
    Thanks,
    Marcus.

    We managed to resolve the problem (We were using the wrong namespace in the XML mapping file).
    So to confirm, it is possible to use the document function in an XSL transform within a BPEL process.
    ma7asw

  • Using document function in xsl template - not working in BI Publisher

    Hi,
    I have a requirement where I need to display the data in one xml file based on the contents of a second xml. I am using Oracle BI Publisher 10.1.3.4.1 and template used for report generation is xsl-fo.
    1) ReportData.xml - contains the data xml
    2) ReportFilter.xml - contains the display information.
    I need to display the tags in the ReportData.xml based on the presence , absence of different tags in ReportFiler.xml
    I guess one of the option is to declare 2 datasource as use concatenated datasources. However , I am trying to use the "Document" function that is available in xsl transformation to reference the display xml.
    I have tried the different options for using the document function
    *1) <xsl:variable name="filterCheck" select="document('ReportFilter.xml')"/>*
    Errors out saying : XML-22021: (Error) Error parsing external document: 'Access not allowed : file:/
    C:/OracleBI/oc4j_bi/bin/ReportFilter.xml '.
    *2) <xsl:variable name="filterCheck" select="document('file:///C:/OracleBI/xmlp/XMLP/DemoFiles/ReportFilter.xml')" />*
    Errors out saying ; Caused by: oracle.xdo.parser.v2.XPathException: Access not allowed : file:/C:/Or
    acleBI/xmlp/XMLP/DemoFiles/ReportFilter.xml
    *3) <xsl:variable name="filterCheck" select="document('C:/OracleBI/xmlp/XMLP/DemoFiles/ReportFilter.xml')" />*
    Errors out saying : Caused by: java.net.MalformedURLException: unknown protocol: c
    at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:153
    *4)<xsl:variable name="filterCheck" select="document('file:/C:/OracleBI/xmlp/XMLP/DemoFiles/ReportFilter.xml')" />*
    Errors out syaying : Caused by: oracle.xdo.parser.v2.XPathException: Access not allowed : file:/C:/Or
    acleBI/xmlp/XMLP/DemoFiles/ReportFilter.xml
    I have placed the document I need to access in all the 3 locations mentioned above
    ie in my
    *1) C folder*
    *2) C:/OracleBI/oc4j_bi/bin*
    *3) C:/OracleBI/xmlp/XMLP/DemoFiles*
    Is there any special permissions that I need to grant to enable access to these files?
    Please let me know if anyone has successfully made the document function to reference other xml documents in BI Publisher.
    Regards
    Sujith
    Edited by: user10979469 on Dec 8, 2009 11:48 AM

    Tim,
    Thanks a lot for the reply. Set the option to enable external document access and it works perfectly.
    Just for other who are looking at this post.
    Go to the Report in BI Publisher
    Click on Configure link on the top right
    Go to the Section FO Processing
    Disable external references - Server value is "True" . Set it to "False".
    Apply changes.
    Restarted the oc4j, just to be on safer side (not sure if this is required)
    The document function will open documents from any location on your machine.
    Thanks again Tim
    Regards
    Sujith

  • Error using custom xpath function with XSL transformations in BPM

    Hi,
    We have created a custom xpath function for use with SOA Suite and BPM. This has been built as per specified within the http://docs.oracle.com/cd/E29597_01/dev.1111/e10224/bp_appx_functs.htm#SOASE11100. We have also reviewed the Oracle Sample for mapper-107-ExtensionFunctions (sample demonstrates the use of user-defined extension functions). This has been registered with jDeveloper and SOA within the oracle.soa.ext_11.1.1 (run ant to include in oracle.soa.ext.jar)
    We ideally want to use this is BPM within an xsl. However when consuming this function is either BPEL or BPM using an xsl, the xsl fails with an error such as:
    XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc("xsl/Transformation_1.xsl", $inputVariable.payload). The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: oramds:/deployed-composites/default/gwCustomXpathUtil_rev1.0/xsl/Transformation_1.xsl<Line 9, Column 113>: XML-22043: (Error) Extension function error: Method not found 'getWeekDayDate'. Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
    In an Assign it operates fine and returns the expected result. We have included a combination of both of the Config files (ext-mapper-xpath-functions-config.xml and ext-soa-xpath-functions-config.xml) in the META-INF folder, however neither allow the use of this function in the XSL.
    I believe there may be an issue getting the custom xpath functions within XSL files. Hence I have also raised an SR. Has anyone experiences of this?
    Our SOA / BPM suite environment is using 11.1.1.6.4 and has the following patches applied:
    13801175
    14406487 (11.1.1.6.4 SOA Bundle)
    13896993
    13088538
    Regards Dave
    Edited by: DavidGaskell on Mar 14, 2013 10:08 PM

    Hi All,
    I am also facing the same issue...Experts can you please help us.
    hi DavidGaskell, did you find any resolution, if so can you share it with me.....
    Thanks,
    RR

  • Performance xsql:xml-include vs. xsl:document(...)  !

    Dear Steve,
    I have html markup file stored in XHTML format which is, of
    course, XML. Also, I put <marker id="some_name"/> in all places
    where I want XSLT injections.
    My XSLT is something like this:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" indent="yes"/>
    <xsl:variable name="markup" select="document('MyMarkup.xml',/)"/>
    <xsl:template match="@* | node()">
    <xsl:copy>
    <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="/">
    <xsl:for-each select="$markup">
    <xsl:apply-templates select="html"/>
    </xsl:for-each>
    </xsl:template>
    <xsl:template match="html">
    <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="markup[@id='script']">
    <!-- do something here -->
    </xsl:template>
    </xsl:stylesheet>
    Now, here is the question. What is most efficient way to use
    this Markup technique?
    Is it <xsql:include-xml href=MyMarkup.xml/> in XSQL page
    and XSL processing the composite document or xsl:document
    function as I described?
    What is cached by XSQL servlet, if anything?
    The "markup" technique provides clear separation of labor and
    layers.
    And it is crucial to have it perform well. I think, that it
    would be very easy to cache xsql:include-xml document once and
    for all sessions or have a special attribute in this tag to
    explicitly ask for this.
    Sincerely,
    David

    ( I can't use
    <xml:transform>
    because this expects the xsl file as a parameter )But you know the name of the xsl file, so that shouldn't be a problem, correct...?
    But as to your question, the xml file is a static file, so the jsp:include will copy its contents (it acts like <%@ import %> in this case...). The jsp will only process the page if it detects it as a dynamic page, ie Servlet or JSP.
    Perhaps you can make an intermediary JSP that transforms the xml... I have never tried it, but would:
    //Intermediary JSP:
    <jsp:forward page="./stocks2.xml" />
    //then in the primary JSP
    <jsp:include page="./intermediary.jsp"/>It might fool the jsp:include into thinking the content is dynamic, while the jsp:forward would take care of processing the XML. That assumes that once the jsp:forward is done that the rest of the primary jsp will be handled... not sure if that is the case though...

  • Use document() function in xslt

    Hi I want to use the xslt function document() to import a data file into the transformation.
    However I don't seem to be able to import the xml file onto the osb. can this be done ?
    Basically can you use the document() function?
    I've tried googling and searching the docs but i think i'm missing something basic :-)
    Thanks in advance

    Not an answer to the particular point but i've got round the issue by adding a stage which inserts the data xml into the xml document being transformed.
    I then supress the data injected from being copied to the output tree and use a variable which references the data nodes rather than a variable referencing
    an external doc variable name="myvar" select="//injecteddatanode" /> rather than <variable name="myvar" select="document("path/doc.xml")
    The question still stands though : how do you import an xml doc which can then be used by the document function in a transform

Maybe you are looking for

  • Apple Personal LaserWriter LS test page

    Without using a Mac, how does one get an Apple Personal LaserWriter LS to print a test page? There's one on eBay I'd like the seller to test before I make a bid and I can't find anything on Apple's KB. TIA.

  • Java VM hangs when I start Derby Server

    Hey everyone, Help will be much appreciated so cheers in advance. I've made a desktop app through Netbeans that runs fine within the IDE but can't get it to work from outside (unless I've connected to the server from within Netbeans first so guessing

  • How to set sound device(sound card)

    i have 2 sound cards one - integrated on MB and one on PCI. I want with Java to use in some cases first in some cases second. How could I set one of them for usage? Am I need JMF or ther e is any other general setting to change preffered sound device

  • AirTunes to Apple TV is slightly out of sync with other AirTunes devices

    I've noticed that AirTunes playback through Apple TV is slightly out of sync with the audio output from my Macbook and the AirTunes via my two Airport Express Base Stations. The audio from Apple TV is about a second delayed, causing a mismatch betwee

  • Query Fecha

    Colegas, ¿Cómo le hago para que en una consulta me den las facturas de clientes del mes de enero? Es decir en WHERE qué es lo que le tengo que poner sin necesidad de usar: y ??? Saludos y Gracias