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

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
             || '&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

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

  • 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

    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;
    }

  • Performance issue in Store Business Document functionality in ME52N

    Hi Guys,
    I have a problem in the Services for object in the transaction ME52N.
    In Services for object
    Create->Store Business document functionality when i try to drag&drop the PDF type file it is taking longer time.
    Please provide some input to improve the performance.
    Regards,
    Ramesh

    Hi Ramesh,
    Could you explain the architecture of your DMS and ERP landscape.
    How these servers are placed ?
    Regards,
    Deepak Kori

  • Error with single quotes in open document function

    Hi all,
    I have an issue with the special characters using the open document function. I'm passing a name, and I'm using the URLEncode function, but it doesn't work for single quotes, it shows a javascript error. I tried with HTMLEncode and it works for single quotes, but not for the other special characters like @,+. I tried with both functions at the same time but it doesn't work either.
    Please let me know if you know how to solve it.
    Thanks,
    Marcela

    Hi Prashant,
    I did not work it works for single quotes only, but not for other special characters.
    This one doesn't work for single quotes
    ="<a href='../../scripts/openDocument.aspx?sType=wid&sDocName=Report_Name&sWindow=NEW&sReportName=Company Details&lsSPartner Id=" + [Partner Id] +"&lsSPartner Name=" + URLEncode([Partner Name]) +"'>View catalog</a>"
    This one doesn't work for special characters
    ="<a href='../../scripts/openDocument.aspx?sType=wid&sDocName=RP-DSPP-Company_Catalog_CORETEAM&sWindow=NEW&sReportName=Company Details&lsSPartner Id=" + [Partner Id] +"&lsSPartner Name=" + [Partner Name] +"'>View catalog</a>"
    Thank you,
    Marcela

  • 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

  • Printed Document function not working

    I have a user who is trying to use the Printed Document
    function of RoboHelp to convert html files into one continuous
    document, put together in a book form, complete with a table of
    contents. The process errors out giving her error messages like
    --> "Warning: The Word Document became corrupt when attempting
    to append a malformed topic: (then it lists an htm file here)". Can
    anyone tell me what could be causing this error or if something
    might be missing from the installation?
    Thank you!

    Welcome to the forum
    You'll like this. A number of possibilities.
    See Printed Documentation Issues on my site for one
    possibility.
    The other is quite simply insufficient RAM. Yeah I know what
    RH says on the box but Word has its own requirements. I have a
    layout that gives this error on a 2gb ram machine but works quite
    happily on 3gb.
    A way of checking that it is RAM is to create two copies of
    the print layout. Leave one alone. In number two trash half the
    topics. In three trash the other half. If two and three then
    generate OK, there is clearly no problem topic so by my
    calculations it has to be RAM.

Maybe you are looking for