Using document() function in xsl - first iteration is OK; second iteration is Empty.

I am processing an input xml file (say input.xml) via (report.xsl) to generate
a report.
report.xsl in turn loads another *xml file (schema.xml) through document() function
so as to process the input.xml. <schema.xml> contains some look-up information
dictating how <input.xml> need to be processed.
Here is how I am referencing the "schema.xml" in the "report.xsl".
<xsl:variable name="schemaFile" select="document('schema.xml')"/>
<xsl:variable name="schemaRoot" select="$schemaFile/Schema"/>
<xsl:variable name="schemaList" select="$schemaRoot/SchemaFactors"/>
When I run the report first time (my appserver is weblogic 7.0), everything is
working fine. I see the results I wanted.
However, when I run the report for the second time during the same session, I
am getting "schemaList" as empty.
The values of "schemaFIle" and "schemaRoot" appear to be correctly loaded in both
the cases. The problem is with "schemaList" variable which is coming out empty
during the second iteration.
can any of you please throw some pointers on why this is happening and how to
resolve this?

Hello,
Sounds like a bug. If you have a small test case, could you provide
that to our outstanding support group (http://support.bea.com or
[email protected]), it would certainly help tracking this down.
Thanks,
Bruce
venkata wrote:
>
I am processing an input xml file (say input.xml) via (report.xsl) to generate
a report.
report.xsl in turn loads another *xml file (schema.xml) through document() function
so as to process the input.xml. <schema.xml> contains some look-up information
dictating how <input.xml> need to be processed.
Here is how I am referencing the "schema.xml" in the "report.xsl".
<xsl:variable name="schemaFile" select="document('schema.xml')"/>
<xsl:variable name="schemaRoot" select="$schemaFile/Schema"/>
<xsl:variable name="schemaList" select="$schemaRoot/SchemaFactors"/>
When I run the report first time (my appserver is weblogic 7.0), everything is
working fine. I see the results I wanted.
However, when I run the report for the second time during the same session, I
am getting "schemaList" as empty.
The values of "schemaFIle" and "schemaRoot" appear to be correctly loaded in both
the cases. The problem is with "schemaList" variable which is coming out empty
during the second iteration.
can any of you please throw some pointers on why this is happening and how to
resolve this?

Similar Messages

  • 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

  • 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

  • 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

  • How to use mathematical functions in XSL mapping

    Hi,
    I am using Jdeveloper 10.1.3.3. I need to insert mathematical functions like "multiply,divide,power" etc in my mapping. But in the XSL i am getting all string functions and very few math functions for number.
    I am newbie in Jdev. Please if anyone can share how this can be done.
    Thanks

    Hi,
    The RfcAdapter trys to find a Sender Agreement for this RFC call but the lookup failes. The values used for this lookup are:
    Sender Party/Sender Service: The values from Party and Service belonging to the sender channel.
    Sender Interface: The name of the RFC function module.
    Sender Namespace: The fix RFC namespace urn:sap-com:document:sap:rfc:functions
    Receiver Party/Receiver Service: These fields are empty. This will match the wildcard
    Regards,
    Suryanarayana

  • How to use key() function in XSL Mapper file?

    I would like to use the XSLT key() function in an XSL stylesheet in the XSL Mapper designer, but I can find no way to include the <xsl:key> element.
    key() should be supported as it is available in the component palette, but I can't find a way to add <xsl:key> in the designer, and if I add it manually the designer tells me it is not supported.
    This is with Jdeveloper JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660 on Linux.
    Any help appreciated, thanks.

    The usual practice is to leave the XSLT as such. A person skilled in XSLT would know to open the XSLT in source mode if the design view is not supported. Almost most of AIA XSLTs are such and one has to only open them in source view.
    You might want to document this into some document/guide which the person might refer before actually making the changes!
    Cheers,
    - AR

  • How to use document() function in PL/SQL XSLT parser ?

    The "XDB Developers Guide" documentation says on page 12-18
    >
    The application can use DBUriType objects:
    To make references, such as import or include, to related XSL stylesheets. You can encode these references within the XSL stylesheet itself.
    following this i added string like this to my stylesheet
    <xsl:apply-templates select="document('/ORADB/SCOTT/STYLESHEET_TAB/ROW[ID=1]/STYLESHEET/text()')" mode="include"/>
    <xsl:cinclude href="/ORADB/SCOTT/STYLESHEET_TAB/ROW[ID=1]/STYLESHEET/text()"/>
    But when XSLT processor reaches this, it fails.
    I also even tried like this
    <xsl:include href="/ORADB/SCOTT/STYLESHEET_TAB/ROW[ID=1]/STYLESHEET/text()"/>
    but result is the same ;(((
    Generally - is there ANY way XSLT processor can deal with stylesheet which contains
    DBURI references to another stylesheets stored in XMLTYPE columns ?
    I'm currently in charge to develop a content management system for a huge corporate site,
    so i'm VERY interested to know - does this feature really exists on Oracle 9.2 ?
    Please ansver ASAP.

    BTW: following this link
    xsl:include within XSL stylesheet stored in XMLType column
    i've encountered that this theme has been asked but none from Oracle staff has answered on it yet ;(((((((

  • XSLT mapping error using document function

    Hello,
    We migrated from XI 3.0 to PI 7.1. XSL is made use of for mapping. We are encountering this error of 'File not found' when we use the document funcion to look into an xml file. The xml file along with the xsl map is zipped and uploaded. I am not sure of why this is happening in PI 7.1. What is the cause. Looking forward to your early replies with solutions.
    Kind Regards,
    InduShekar

    Check the file contents and see whether the content is same as that of the older version.  You can export the same file from xi and pi and  see both are same and having same contents. Check the file is imported in the right namespace.

  • Use DOM as an argument of  XSLT document() function

    I have in memory several DOM documents. I have not stored in file system the XML files that are represented by these DOMs. I want to process with a stylesheet
    all of these DOMs (as DOMSource's) using document() function from the stylesheet. How can I refer to the secondary DOMs from document function if I haven't the files?
    F.e.
    <xsl:value-of select="document('file.xml')/.../..."/> file.xml only exists loaded in memory as DOM.
    Can anybody help me?? Thanks

    Thank you DrClap but I'm not sure about the use of URIResolver:
    if my xslt:
    <xsl:value-of select="document('file1.xml')\...\..."/>
    <xsl:value-of select="document('file2.xml')\...\..."/>
    I must define my own class that implements URIResolver and write my own resolve method, isn't it?
    class Resuelve implements URIResolver{
         private Document doc1;
         private Document doc2;
         public Resuelve(Document doc1, Document doc2){
              this.doc1 = doc1;
              this.doc2 = doc2;
         public Source resolve(String href, String base){
              if(base.equalsIgnoreCase("file1.xml")){
                   Source s1 = new DOMSource(doc1);
                   return s1;
              else if(base.equalsIgnoreCase("file2.xml")){
                   Source s2 = new DOMSource(doc2);
                   return s2;
              else{
                   return null;
    I suppose that XSLT processor use automatically resolve method. I don't understand the href parameter...
    Is this class correct? if not, can you show me an example please?
    Thank you very much

  • XSLT document function issue

    I have XSL transformation using document() function to combine xml docs, using Oracle 10.2.0.2.
    <xsl:for-each select="document('/export/home/myunixdirectory/Products.xml')/PRODUCTS">
    When I run DBMS_XSLPROCESSOR.processXSL(proc, ss, document_in); I get error
    ==============
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    ==============
    Products.xml is valid, tried it with no unix directory specified, etc., no luck. Also have commented out section related to document function and code works, so it is related to this document processing in the Oracle XSL processor. The transformation works in XMLSPY (pointing to files on local drive).
    Any ideas on how to get this to work?

    Here's more info in case anyone wants take a crack at guessing what's wrong. I've tried a bunch of different methods for document() function, at this point I am nearly convinced it is not supported by the Oracle XSL processor.
    Products.xml...
    <?xml version="1.0" encoding="UTF-8"?>
    <PRODUCTS>
         <PRODUCT>
              <BRAND_CODE>11111</BRAND_CODE>
              <BRAND_NAME>SOMETHING HERE</BRAND_NAME>
              <GRADE>P</GRADE>
         </PRODUCT>
    </PRODUCTS>
    XSL file (simplified)…in same directory as Products.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
         <xsl:variable name="geterrorwhenrun" select="document('Products.xml')"/>
         <xsl:template match="/REGION">
              <REGION>
                   <xsl:attribute name="xsi:noNamespaceSchemaLocation">any.xsd</xsl:attribute>
              </REGION>
         </xsl:template>
    </xsl:stylesheet>
    Error I get...
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    PL/SQL Code...
    -- parse xsl file
    DBMS_XMLPARSER.parse(p, xslfile);
    -- get document
    xsldoc := DBMS_XMLPARSER.getDocument(p);
    -- make stylesheet
    ss := DBMS_XSLPROCESSOR.newStylesheet(xsldoc, xslfile);
    proc := DBMS_XSLPROCESSOR.newProcessor;
    DBMS_XSLPROCESSOR.showWarnings(proc, true);
    docfrag := DBMS_XSLPROCESSOR.processXSL(proc, ss, document_in);
    -- GET ERROR on line above, however if I comment out the geterrorwhenrun variable line, transform works

  • Document() function problem in Cocoon

    Hi,
    I have a problem using document() function in xslt. Transformation is done via Cocoon. I know that document() function is problematic in Cocoon, but I think still it is possible to use document() in Cocoon or?
    Here is the simple code:I am getting Java NullPointerException.
    <xsl:variable name="myfile"
    select="document('file:///c:/Temp/temp.xml')" />
    <xsl:value-of select="$myfile/document/doc/@id" />
    If document() function is not possible in Cocoon, can anyone suggest me another way?
    thanks

    Are you sure that you can access a local file?

  • Format-dateTime function in xsl

    Hi,
    I am trying to convert String format to specific date time format(YYYY-MM-DD HH24:MI:SS:FF).
    I am using below function in xsl:
    <xsl:value-of select='xpath20:format-dateTime(/ns0:Transmission/ns0:TransmissionBody/ns0:GLogXMLElement/ns0:ShipmentStatus/ns0:EventDt/ns0:GLogDate,"[Y0001][M01][D01][H01][m01][s01]")'/>
    But it is not returning any value.
    Source format is String(value= 20101020155400).
    Target is dateTime(Expected Value= 2010-10-20 01:55:40.0).
    Any suggestions will be helpful.
    Thanks

    Hi Arik....
    At last i got it. :)
    Followed the below steps.
    Step1:
    Created a String variable "currentDateTimeValue" in BPEL.
    Step2:
    I have used the below code in JavaEmbedding in BPEL.
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();
    //Date Pattern looks lil weird. But some Web service accepts only this format.
    sdf.applyPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'-00:00'");//2012-04-14T16:24:00.578-00:00
    String formattedDate = sdf.format(new java.util.Date());
    addAuditTrailEntry("Formatted datetime string is: " + formattedDate);
    setVariableData("currentDateTimeValue", formattedDate);
    Step3:
    Created a Simple XSD with an element "DateElement" of String type.
    Step4:
    Assigned "currentDateTimeValue" value to "DateElement" element, in Assign activity.
    Step5:
    Now added this DateElement in Transformation activity, as a second source variable. Mapped this data to the required target element in my XSL.
    uh-huh I got the output...
    Thanks a ton ARIK :D u r really helpful...
    Regards,
    Sudheer

  • 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

  • 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.

  • How can I get INSTID_B for the documents which are stored using Store Business Document functionality

    Dear experts,
    I had activated the functionality of Store Business document and successfully stored documents in external server.
    My client have a custom function module which is used to send emails.In that FM they used SO_DOCUMENT_READ_API1, SO_DOCUMENT_SEND_API1 function modules.They passed Instance Ident(SRGBTBREL->INSTID_B)(eg: FOL33000000000004EXT39000000000026) as export parameter to the FM 'SO_DOCUMENT_READ_API1' and get the attachment details and content.
    Here my problem is I do not have entries in the table SRGBTBREL for the documents which are stored using the Store Business Document functionality and without INSTID_B I am unable to use the FM 'SO_DOCUMENT_READ_API1' to get the document details and content. Please help me to find INSTID_B for documents which are stored using Store Business Document functionality or please let me know if there is any other way to use FM 'SO_DOCUMENT_READ_API1' for documents which are stored using Store Business Document.
    Thanks in advance.
    Regards,
    Kiran

    Hi Kiran,
    You can use the following method to get the information. For example if you want to get BO documents for a customer
    CALL METHOD cl_binary_relation=>read_links
       EXPORTING
         is_object           = ls_lpor
         it_relation_options = lt_relat
       IMPORTING
         et_links            = lt_links.
    then fill  ls_por-instid with a customer number (KUNNR), ls_por-typeid = 'KNA1' and ls_por-catid = 'BO'.
    Table  lt_relat should contain a line option  for each document type (for example 'I' 'EQ' 'NOTE', 'I' EQ 'ATTA', 'I' EQ 'URL', ...
    In table lt_links you will get your information.
    Maybe some other methods of class CL_BINARY_RELATION may also solve your issue.
    Regards,
    Klaus

Maybe you are looking for

  • Upgraded to 8.3, now auto fill is not working. I have checked, rechecked my info, saved passwords, etc. to no avail. Is this bug in 8.3. Never did this until I upgraded.

    Upgraded IPad to to 8.3, now auto fill is not working. I have checked, rechecked "my info", "saved passwords", etc. to no avail. Is this bug in 8.3. Never did this until I upgraded. Wife is not happy I upgraded!

  • Wireless connection unstable on Leopard

    Hi, I just got a new iMac as part of a free upgrade because my local store could not seem to fully repair my previous iMac and I am having issues staying connected to the internet while using Leopard. Everything usually starts off fine but it seems t

  • Managed Servers on another machine

              I'm having problems getting a managed server running on           another machine with NT. For simplicity, I'm using the           'mydomain' that comes in the install. From the           'mydomain' directory, I just:           startWebLogi

  • Database scale error

    When trying to change the scale of our SQL database from S1 to S2 in the new portal I get the following error: Database scale error Database scale operation from S1 Standard to S2 Standard failed for <DBNAME>. ErrorCode: BadRequest ErrorMessage: The

  • Edited Raw images converting....

    I am using CS2 for windows....I edited my RAW (nef for nikon) files in Camera Raw, then open in photoshop. I finish editing and save as jpeg, all seems fine. Then I reopen to look again through My Documents/My pictures and the images are back the way