XSLT document function - bug?

I have an XSLT stylesheet which loads several XML documents, by using the XSLT document() function.
The XSLT document() function works fine using Saxon processor and Firefox. Also it works fine in Safari 3 when the XSLT stylesheet is processed as a stylesheet referenced from an XML-file.
But, when processing the XSLT stylesheet from Javascript, in Safari 3, using xsltProcessor.transformToDocument() the document() function does not load the files. It can be added, that I am running everything from the local harddrive.
Anyone has similar experience or some workaround?
There is a similar post http://discussions.apple.com/thread.jspa?threadID=1559485&tstart=1 about Safari-Windows, but no resolution to the problem.
Message was edited by: Tomas Jonsson
Message was edited by: Tomas Jonsson

I have now made an example to demonstrate this bug. Firefox 3 will do the right thing, Safari 3 and 4 both have the same problem.
http://www.tomasjonsson.eu/docbugtest/docbugtest.html

Similar Messages

  • 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
             || '<SPAN style="font-weight:bold;color:green">'
             || c.ename
             || '</SPAN>'
             || ', </br></br>';
       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

  • XSLT document() function in PL/SQL XDK

    I'm using the PL/SQL XDK (9.2.0.2.0) to do XSLT transformations but having
    no success using the XSLT document() function.
    I just get the error
    ORA-20100: Error occurred while processing: XSL-1021: (Error) Error parsing
    external document: 'wrongmachine.mycompany.com'.
    Can the document function access an external xml file using http from pl/sql?
    eg. http://amachine.mycompany.com/xmldocs/myxml.xml
    I've tried setting the ref parameter of the newStylesheet function, assuming
    this sets up the base uri for the stylesheet
    xslss := xslProcessor.newStylesheet
    (xmldoc => xsl_doc,
    ref => 'http://amachine.mycompany.com/xmldocs');
    I've also used the setBaseDir on both the DOMDocument and the stylesheet
    xmlparser.setBaseDir(p => xsl_parser,
    dir => 'http://amachine.mycompany.com/xmldocs');
    I've tested the XSL stylesheet in Saxon and it works fine.
    Other XSL transformations also work fine using the Oracle XDK but none that use
    document()
    'wrongmachine.mycompany.com' is not even the machine the code is executing on!?
    Is this set up in an installation script?
    Any ideas/examples on how document() can be used in the pl/sql XDK?
    Thanks
    John Holder

    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 document() function not working properly

    I have this XSLT:
    <xsl:copy-of select="document($file1)/employee/address/*"/>
    I have this java which is setting the parameter for $file1
    transformer.setParameter("file1",file.getAbsolutePath());I printed out the value of $file1 in the XSLT style sheet using:
    <xsl:message><xsl:value-of select="$file1"/></xsl:message>
    The Path it prints out is the correct path, let say its c:\myfile\file1.xml
    When it reaches the doument($file1) function, it seems that the path is getting changed.
    To give you an example, if $file1 = "c:\myfile\file1.xml" and my XSLT file is located at c:\xsl\myXSl.xsl then the path that document() gets is:
    c:\C:\xsl\myfile\file1.xml
    This causes the following error to occur:
    (The filename, directory name, or volume label syntax is incorrect)
    Why is document() inserting the path where the XSL file which it is in into the path of the file I'm trying to open? I am using the Xalan API to transform this XML.
    Have anyone seen anything like this before?
    Thanks
    Al

    When I looked up some Internet pages that described the document() function, they all said it required a URI as its parameter. A Windows file path is not a URI. However it's possible to get a URI from a File object, so you might want to try that.

  • 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

  • XSLT document() function

    I am using the Oracle XML parser, and I am finding that some funny things are happening when I try to use the document(object, node-set?) function, as defined in the XSLT specification. For some reason, my xmlns path is being prepended to any file path I use in the "object" argument, so I can't access any local files:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"/>
    <xsl:value-of select="document('local_file')"/>
    ... results in the following error message:
    oracle.xml.parser.v2.XSLException: XSL-1021: Error parsing external document: 'http://www.w3.org/XSL/Transform/local_file';
    Furthermore, if I try to use the "node-set" (2nd) argument, I get invalid expression errors.
    Any suggestions?
    Thanx, Kat.

    Hi,
    There could be a problem with the way the XSLStylesheet is being created. If you are using the command line version, it could be a
    problem in the parser. If you are using programmatic construction of the XSLStylesheet, be careful that that the second argument 'URL ref' is used to get absolute paths from relative paths. Check what you are setting this second arg
    to. Let us know if you experience additional problems.
    Thanks,
    Oracle XML Team
    null

  • Secondary XML source via document() function

    Has anyone used the XSLT document function in an XSL-FO template where the file is an URL. We are trying to do this to get extra information for the PO output in an EBS installation without horrible customisations
    eg
    <xsl:text>Person : <xsl:value-of select="document('http://dbsdev11.uk.baa.com:8031/OA_HTML/test.xml')/xxpo:PO_DATA/xxpo:PERSON_ID"/></xsl:text>
    where test.xml is:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xxpo:PO_DATA xmlns:xxpo="http://uk.baa.com/oracle/apps/po/info">
    <xxpo:PERSON_ID>120</xxpo:PERSON_ID>
    <xxpo:SERVER_PORT>8031</xxpo:SERVER_PORT>
    </xxpo:PO_DATA>
    and the URL http://dbsdev11.uk.baa.com:8031/OA_HTML/test.xml resolves quite happily when pasted into a browser.
    But nothing comes back when previewing the template in EBS. PDF is produced but Person value is not populated.
    Is the document function supported??
    Rgds
    James M

    Hi Jame
    Document() is supported but what you are trying to do with it is not, i.e.
    document('http://dbsdev11.uk.baa.com:8031/OA_HTML/test.xml')/xxpo:PO_DATA/xxpo:PERSON_ID"/
    will not work. You need to load the doc to a variable and then reference the PERSON_ID element.
    Something like:
    Variable Declaration
    ==================
    <xsl:variable name="news" select="document('http://rss.news.yahoo.com/rss/topstories')"/>
    Value
    ========================
    <?$news/rss/channel/title?>
    regards
    Tim

  • 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

  • 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

  • Resolving url after document() function has been called by the xslt

    I am having problems resolving a URI when document() function in my xslt is called. The xml document that is being called has a reference to a dtd that is in another location of the webserver. When document() is called it downloads the xml document then tries to download the referenced dtd from the same location. I get an error kinda like this.
    file:///C:/dev.xsl; Line 15; Column 62; Can not load requested doc: File "http://dev.server.com/templatedata/lhj/story/data/dcr4.5.dtd" not found.
    The DTD is in a different location on the server and that is why it can not find it. I have tried resolving the URL but have been unsucessfull. See my java solution that does not work. How can I fix this? Any assistance will be greatly appreciated
    Java solution
    try {
    TransformerFactory tFactory = TransformerFactory.newInstance();
    tFactory.setURIResolver(new XMLURIResolver());
    Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile));
    File f = new File(xmlFile);
    FileReader fr = new FileReader(f);
    InputSource inputSource = new InputSource(fr);
    transformer.transform(new SAXSource(inputSource),
    new StreamResult(new FileOutputStream(outPutPath)));
    Vince.

    here is the resolver. The if in never excuted.
    public class XMLURIResolver implements URIResolver{
    public static final String DTD_HREF = "dcr4.5.dtd";
    public Source resolve(String s, String s1) throws TransformerException{
    System.out.println("s = "+ s);
    System.out.println("s1 = " + s1);
    InputStreamReader isr = null;
    try{
    if (s.indexOf(DTD_HREF) != -1){
    System.out.println("Fetching DTD....");
    URL url = new URL("http://mydomain/xml/validation/dcr4.5.dtd");
    isr= new InputStreamReader(url.openStream());
    return new SAXSource(new InputSource(isr));
    }catch(MalformedURLException mue){
    System.out.println(mue);
    }catch(IOException ioe){
    System.out.println(ioe);
    return null;
    }

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

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

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

  • 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

Maybe you are looking for

  • Difficulty placing an image in targeted spot

    Hi, I've just inserted the bottom image onto my homepage (creative corner) on this test page to get the placement correct. As you can see, it is not flush with the left hand side, therefore is is breaking the table and pushing the two columns apart.

  • Forwarded meeting request shows as 'sent on behalf'

    When a user forwards a meeting request to someone else it shows as 'sent on behalf'. This means when the recipient replies it goes to the original meeting organizer. Is there any way to prevent this or is this by design? Can we disable it for certain

  • Why is my Mac is super slow with removable hard drive plugged in?

    I have all our photos on our 1tb HD and every time I plug it in I get the spinning pinwheel for any task. Help!!

  • Adobe Reader 500 user limitation clarification

    Adobe Acrobat 8 allows extending features to 500 unique Adobe Reader users. Features such as saving form data and commenting. Does this have anything to do with submitting form data through email? Say I create a fillable form and have a submit button

  • Pvoide the link from where i can get oracleasmlib-2.0.2-1.i386.rpm

    Dear All, I need oracleasmlib-2.0.2-1.i386.rpm for my redhat el4. Please provide the link to get this rpm. I checked OTN but this rpm is not available there. If there is any alternative RPM available of it then please let me know. Thanks regarsds, Sw