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

Similar Messages

  • Using Saxon Functions Within XSLT

    Hi,
    Please let me know how to use saxon functions within XSLT.
    E.g.: If I want to implement saxon:base64Binary-to-string() function in XSLT in "xsl:value-of" function, then what will be the format for implementation.
    I have selected the Processor as Saxon 8.9.0.3 (the one available) and using xmlns:saxon="http://saxon.sf.net/" in the xsl:stylesheet tag.
    I am using Stylus Studio 2007 XML Enterprise Suite for XSLT.
    Thanks,
    Abhishek.

    Hi,
    Yes I intended to use the XLST mapping within PI...but now will have to change the plan...is there any other way to do it?....is this the problem with the SP?.....anybody who can put more light on this topic.....
    Thanks,
    Abhishek.

  • Using Translate() function of XSLT ...

    Hi guys
    I have an xml document that i am converting into an html document using XSLT. I need to replace the XML new lines(&#10) with html new lines (<br>) while the xslt transform takes place on my xml document.
    For this I have found the translate function of XSLT but I need to use it on a specific tag and not all the tags in the xml document.
    <ExampleTag>
    1 first line
    2 second line
    3 third line
    </ExampleTag>
    translate(string, replaced_text, replacement_text)
    so I need to get my tags value in the variable string which is:
    1 first line
    2 second line
    3 third line
    and replaced_text: '&#10' and replacement_text: '<br>'
    but the problem is XSLT syntax is so bad that i just cant devote enough time to learn it. Any suggestions for the syntax guys?? an example would be extremely useful.
    cheers :)

    Hey
    after a bit of struggle came up with this:
    <xsl:template match="ExampleTag">
    <xsl:variable name="string" select="."> </xsl:variable>
    translate(string, "&#10", "</br>" )
    <xsl:value-of select="$string"/>
    </xsl:template>
    but its not working :(
    any suggestions??

  • 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

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

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

  • Using summation function in xslt transformation

    Hi,
    I'm new to SOA and i'm just exploring the functions in SOA suite. I couldn't add more than one parameter in summation function.
    summation function takes only one parameter as input I hope. How to use it.
    Thanks and Regards
    Karthick

    Yes. You are right.
    Nilesh

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

  • 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

  • Error in XSLT mapping while using string functions

    Hi All,
    While using tokenize() and substring-before() functions in XSLT mapping,we are getting an error.The error message is Unexpected symbol "" So while using string functions in XSLT mapping do we have to use any header functions.
    Please through light on syntax etc.,of string functions in XSLT.
    Thanx in advance,
    Lokesh Dhulipudi
    Edited by: LOKESH DHULIPUDI on Dec 27, 2007 7:32 AM

    Hi,
    Hope you have gone thru this help:
    http://w3schools.com/xsl/default.asp
    Rgds, Moorthy

  • 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

  • Date function in XSLT

    Hi All,
    I am trying to use date function in XSLT, I am using the below code, please correct me if i am wrong
    <corecom:EffectiveDate>
    <xsl:value-of select='xp20:format-dateTime(ns0:Segment-DTM/ns0:Element-373,"[YYYY][M01][D01]")'/>
    </corecom:EffectiveDate>
    Regards
    Francis

    Hi Francis,
    It doesn't seem to be anything wrong with the code itself, but what's the content of ns0:Segment-DTM/ns0:Element-373 ???
    The xp20:format-dateTime function will work if the date on the first parameter is on ISO 8601 format...
    http://www.w3.org/TR/NOTE-datetime
    Examples
    1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.
    1994-11-05T13:15:30Z corresponds to the same instant.
    Cheers,
    Vlad

  • 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

  • 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

Maybe you are looking for

  • How can I reset the font type and size on my email. It changed after I updated to Firefox 5.0 and I can't get it back.

    After updating to Firefox 5.0 the font changed on my email. I checked, and the default setting is what I had put in before the update but it's not working. How can I get my email to use the font and type size that I chose? The one that's currently be

  • Error message when publishing

    I'm receiving the following error message when trying to publish my websites. I'm only updating them after making changes. They were previously published and working fine until now. Can't create the file "mwmac_white.png." The disk may be damaged or

  • How can I return to Win 8.1 from Win 10

    I've updated to Windows 10 TP from win 8.1 few weeks ago, but I didn't backup anything. I find win 10 slow at startup. I want to return to windows 8.1, I've tried using Win 8.1 ISO file but Windows says "Windows 8.1 setup has failed". Is there any an

  • Syncing apps crash!!!

    i have about 170 apps and an ipod touch 2g. when i try to select the sync applications option in itunes it instantly crashes. ive tried to wait but no luck please help i dont want to reinstall each and every app onto mt ipod through the mobile app st

  • Menu Bar for Struts application

    Hi All, We are developing the Struts based Web Application using Hibernate and for this we need the Menu Bar for all the pages in the application.But we are unable to write the code for the menu bar using java classes. If possible please send the cod