Processing multiple XML docs in an XSL

Hi,
i have two xml files whose elements' contents have to be compared, i want it to be done in a single xsl but the problem being here is, how do i use both the XMLs in a single XSL, is the "import" attribute or "include" attribute appropriate for the purpose..??
Best Regards,
Shekhar

Sir, many thanx for your effort.
We need to produce a properties file by processing two XML documents
in the main XSL sheet. One of the XMLs holds the value of a variable which is held by some element of the second XML file.
Say for example:
XML1:
<test>
<name>DATE</name>
<value>xx_date</value>
</test>
XML2:
<test1>
<name>xx_date</name>
<value>19-12-2006</value>
</test1>
Now, we have generated the properties file from XML1 and the output is DATE = xx_date, we are unable to replace this "xx_date" with "19-12-2006" from XML2. As suggested, we used XPath document() to access both the documents, but we don't know how to go about simultaneous processing.
Kindly give your valuable suggestion ASAP.

Similar Messages

  • Transforming single XML doc to Multiple XML docs

    I have a XML file with the structure shown below stored in the system.
    For now, I am just showing the empty elements for now -
    <DEPT>
    <ID>
    <NAME>
    <EMPLOYEE>
    <FIRST_NAME>
    <LAST_NAME>
    <PROJECT>
    <PROJ_NAME>
    <PROJ_ID>
    </PROJECT>
    <PROJECT>
    <PROJ_NAME>
    <PROJ_NAME>
    </PROJECT>
    <ADDRESS>
    <STREET>
    <CITY>
    </ADDRESS>
    <EMPLOYEE>
    </DEPT>
    I wish to load this file into multiple Oracle 8i database tables like DEPT,EMPLOYEE, PROJECT, ADDRESS
    which are master details, using XSU PLSQL API.
    My Problems/doubts are:
    1. I tried creating Object views but because of limitation of creating repeating collections
    in Oracle 8i I can not use that. It works only for one level of repetition.
    So I found out that it can be done by breaking xml to multiple xml documents.
    How can I convert this xml into multiple xml documents so that I can insert into different tables. Please provide your guidance and sample code for xslt file if possible.
    2. If I use XSLT how can I apply XSLT to external XML document that I am receiving (I cannot modify it).
    I found example of this using ORAXSL command line utility. But I wish to know if it's possible
    to appy XSLT within PLSQL procedure. If not, is ORAXSL only the way to do it.
    Thanks for the help. If possible pls provide Sample code
    Thanks

    Please refer to Steve Muench's book: Building Oracle XML Applications. It has good example for your case.
    Inside database, you can use xslprocessor PL/SQL package for XSLT transformation

  • How can I process an xml/xsl file pair that require the Internet Explorer dom?

    My personal navigation device (GPS) generates xml files that contain a record of where I have been, together with when I was there, how fast I was driving at the time, etc. taken at approx. 5 second intervals. This xml file has an xml-stylesheet with type="text/xsl" but that stylesheet is written to the Internet Explorer dom standard. The stylesheet interfaces with google maps to display a map that shows my path and it also displays tables of data including distances that are computed from latitude/longitude pairs. I can supply a small sample xml file and the xsl file as well if they are needed to diagnose my problem. I cannot find any browser other than Internet Explorer that handles these files satisfactorily. I prefer to process them from a Linux environment but with the Internet Explorer requirement I cannot do so. The browsers that I have tried and that have failed are Firefox, Opera, Konqueror, Chrome, Epiphany, Midori, Arora, and Links.
    One line in the xls file in particular gives grief in the browsers like Firefox that at least attempt to do more than display the raw xml file:
    xmlns:cymath="urn:smiletime-cybarber-net:math"
    A comment in the xls file says this about the problem:
    "Tested and currently only compatible with Internet Explorer version 6 or version 7 (as this script includes JScript functions called by XSL, msxsl:script extension is required; also, the produced XHTML document embeds javascript functions exploiting the IE DOM).
    "In order to provide compatibility with Firefox, other than checking the compatibility of the IE DOM, the cymath:distCosineLaw function still needs to be ported."

    You may get an answer, but it is not really the sort of subject covered by this forum, I suggest you try [http://forums.mozillazine.org/viewforum.php?f=49 Mozilazine] and if you solve the problem post back again.

  • JSP, XML, XSLT: applying XSL on JSP-generated XML doc

    Hello,
    I am currently trying to figure out how to do the following:
    let's consider (that's not entirely hypothetical :) ) a web application working with JSP (on apache/tomcat 3.1) and oracle BC4J Application modules.
    The JSPs call oracle webbeans to perform updates and retrieve data from an 8.1.6 database.
    Now I'm thinking of moving to a combination of JSP, XML and XSL, which (hopefully) would allow to customize the application depending on the user's browser, language etc...(that's the point isn't it?)
    It doesn't seem to be a problem to produce XML from a jsp, send it directly to the client browser, which in turn goes to look for the proper XSL file and does all the transformation stuff.
    However this only works with I.E 5 for the moment right? and most website need to support various kinds of browsers...
    The need is:
    * When a non XML-capable browser is detected, apply the proper XSL(s) on the server side before sending the result back, in html/wml/whatever...
    * For XML-capable browsers, produce raw XML, maybe apply some XSL(s), and eventually send the result to the browser which handles the rest of the XSL stuff itself.
    Therefore, I'd like to:
    - Have the jsp produce the raw xml data (maybe adding extra tags, to indicate the browser and/or the language that the jsp engine has detected).
    - Pass the output to a first XSLT engine which would take care of the language stuff
    - Feed the result into a second XSLT engine to handle browser specificities for instance...
    - Send the final output to the client browser.
    Now, there are 2 problems:
    * 1/ I have seen various engines capable of chaining XSL transforms, and it is easy to produce XML from a jsp, but I don't know how to feed a jsp's output into an XML engine. is that possible? how?
    * 2/ I'm a bit concerned about the cost of applying three (or more) process stages, does anyone have insight on the performance issues this could raise?
    bonus question ;) : is there a simpler approach?
    Thanks a lot in advance, Remi
    null

    Hello,
    I am currently trying to figure out how to do the following:
    let's consider (that's not entirely hypothetical :) ) a web application working with JSP (on apache/tomcat 3.1) and oracle BC4J Application modules.
    The JSPs call oracle webbeans to perform updates and retrieve data from an 8.1.6 database.
    Now I'm thinking of moving to a combination of JSP, XML and XSL, which (hopefully) would allow to customize the application depending on the user's browser, language etc...(that's the point isn't it?)
    It doesn't seem to be a problem to produce XML from a jsp, send it directly to the client browser, which in turn goes to look for the proper XSL file and does all the transformation stuff.
    However this only works with I.E 5 for the moment right? and most website need to support various kinds of browsers...
    The need is:
    * When a non XML-capable browser is detected, apply the proper XSL(s) on the server side before sending the result back, in html/wml/whatever...
    * For XML-capable browsers, produce raw XML, maybe apply some XSL(s), and eventually send the result to the browser which handles the rest of the XSL stuff itself.
    Therefore, I'd like to:
    - Have the jsp produce the raw xml data (maybe adding extra tags, to indicate the browser and/or the language that the jsp engine has detected).
    - Pass the output to a first XSLT engine which would take care of the language stuff
    - Feed the result into a second XSLT engine to handle browser specificities for instance...
    - Send the final output to the client browser.
    Now, there are 2 problems:
    * 1/ I have seen various engines capable of chaining XSL transforms, and it is easy to produce XML from a jsp, but I don't know how to feed a jsp's output into an XML engine. is that possible? how?
    * 2/ I'm a bit concerned about the cost of applying three (or more) process stages, does anyone have insight on the performance issues this could raise?
    bonus question ;) : is there a simpler approach?
    Thanks a lot in advance, Remi
    null

  • Conversion of xml doc using xsl

    hai,
    i have a following xml document.i have to write a xsl template which only the content
    between the <FUSIONHUB_MESSAGE> AND </FUSIONHUB_MESSAGE> TAGS.
    CAN ANY BODY GIVE THE TEMPLATE FOR ME ?
    I HAVE WRITTEN A TEMPLATE WHICH IS NOT WORKING PROPERLY.
    HERE IS THE XML DOC:
    <?xml version="1.0"?>
    <FUSIONHUB>
    <FUSIONHUB_INFO>
    <FUSIONHUB_COMPANY_ID>s0001 </FUSIONHUB_COMPANY_ID>
    <FUSIONHUB_REC_COMPANY_ID>r0001</FUSIONHUB_REC_COMPANY_ID>
    <FUSIONHUB_MESSAGE_CATEGORY_CODE>m1</FUSIONHUB_MESSAGE_CATEGORY_CODE>
    </FUSIONHUB_INFO>
    <FUSIONHUB_MESSAGE>
    <SALESORDER>
    <ROW num="1">
    <S_ORDER_NO>o19001</S_ORDER_NO>
    <CLIENT_NO>c00001</CLIENT_NO>
    </ROW>
    <ROW num="2">
    <S_ORDER_NO>o19002</S_ORDER_NO>
    <CLIENT_NO>c00002</CLIENT_NO>
    </ROW>
    </SALESORDER>
    </FUSIONHUB_MESSAGE>
    </FUSIONHUB>
    i just want the output like this:
    <FUSIONHUB_MESSAGE>
    <SALESORDER>
    <ROW num="1">
    <S_ORDER_NO>o19001</S_ORDER_NO>
    <CLIENT_NO>c00001</CLIENT_NO>
    </ROW>
    <ROW num="2">
    <S_ORDER_NO>o19002</S_ORDER_NO>
    <CLIENT_NO>c00002</CLIENT_NO>
    </ROW>
    </SALESORDER>
    </FUSIONHUB_MESSAGE>
    null

    I think your question is wrong.
    XML parser is supposed to check for well-formness of a document, meaning make sure all the tags are open/closed properly. Optionally a parser can perform validations on a document based on its DTD. If there is no DTD available there is no validations required.
    null

  • Need help on processing XML doc using Java store procedure

    I am currently working on project to read, parse XML document and store data in XML document into database columns. I use JAVA API-OracleXMLSave in my java store procedure to do it, which use URL of XML doc to read, parse doc and store the data to database columns. My java store procedure works fine when XML doc is saved in server, but got "ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: No such file or directory" if XML doc is in client's PC instead of in server. I think the problem comes from the URL that created using OracleXMLSave
    --createURL(fileName) based on the filename. what will be the filename if XML document located in Client PC like C:\myprojects\xmldoc.xml?
    Thank you in advance if anyone can give some hints.

    I am currently working on project to read, parse XML document and store data in XML document into database columns. I use JAVA API-OracleXMLSave in my java store procedure to do it, which use URL of XML doc to read, parse doc and store the data to database columns. My java store procedure works fine when XML doc is saved in server, but got "ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: No such file or directory" if XML doc is in client's PC instead of in server. I think the problem comes from the URL that created using OracleXMLSave
    --createURL(fileName) based on the filename. what will be the filename if XML document located in Client PC like C:\myprojects\xmldoc.xml?
    Thank you in advance if anyone can give some hints.

  • XML doc with multiple namespaces

    Hi,
    a little stupid question...
    Is it possible to get a xml file that assigns two different namespaces and I don't want to use a prefix?
    example:
    xml doc uses namespace xmlns:a="someuri" and xmlns:b="otheruri"
    <?xml version="1.0" encoding="UTF-8"?>
    <Root xmlns="someuri" xmlns:b="otheruri">
    <test/>
    <b:rest/>
    </Root>
    Some way to get prefix b out of it?
    Thanx

    okay, it was a stupid question...
    solution:
    <?xml version="1.0" encoding="UTF-8"?>
    <Root xmlns="someuri" xmlns:b="otheruri">
    <test/>
    <rest xmlns="otheruri"/>
    </Root>

  • Adding Extra Page to a PDF doc generated from XSL & FOP

    Hi, I am using XSLTC and FOP for tranforming XML to PDF.Using the JAXP 1.3 API to do this.
    I am getting the xml through a web-service and using stylesheets and FOP to convert it to PDF.However my problem is that i want to add a extra page at the end of every PDF that i am creating.
    This extra page at the end of every PDF is a kind of info-page whose content might change.
    Can i possible create a xml doc and a corresponding xsl stylsheet to create this page and somehow merge it with my original PDF Document.I am keen on keeping the generation of this page(i.e XML and corresponding stylesheet) to be seperate
    Can anyone please suggest a way of doing this?

    HI ...though i have resolved this issue i am facing another problem and any insight from all you people would be good help.
    Basically the scenario is standard ...Webservice --- which could possibly return multiple XML strings which are required to be rendered into PDFs.
    These Strings are received in a JSP along with other values like as follows.
    eg :
    Name : XYZ0 Age : 57 Profile : PDFLink0[/u
    Name : XYZ1 Age : 45 Profile : [u]PDFLink1[/u
    On Clicking the links a PDF is supposed to be rendered.
    Presently i have a Servlet which calls my PDF component and renderes a PDF based on primarily XML String and other params etc....
    The Issue is all these PDF links in my JSP page are Hrefs and am wondering how could i pass my XML String nd other params to my Servlet.
    One option could be as a Query String but i dont want to take that approach .I would rather prefer a Single Object(Created and populated in the JSP itself) and passed to the Servlet.
    Could anyone give any inputs....as to possible ways this could be done.
    Thanks

  • Using XSU to process multiple record sets

    Have a design question about XML, Java and Oracle's XSU. This is a common task when importing external data that should be of general interest.
    I have an incoming XML document with multiple records with a known DTD. Before the records can be inserted into the database, part of
    the record must be used to do a lookup for a foreign key. The resulting foreign key is then combined with the other part of the
    record to create a valid input record for the database.
    My question is what's the most efficient way to do this? I assume the general approach must go something like:
    begin
    while (records in xml doc)
    1. parse the incoming XML to extract the next record
    2. if the lookup data change, do a lookup for this record using XSL
    3. combine the resulting foreign key with the data to create
    an insert query
    4. add the insert query as a document fragment to a second XML document.
    use XSU to insert the second XML doc with multiple records.
    end
    I've figured out how to do most of this, except for step 1 above: is there an easy way to extract the next record from an XML doc if I know the row nodes and the DTD? Or do I just have to traverse all the XML nodes until I hit my next row tag?
    Appreciate any suggestions; this is a handy discussion list!
    --Rick Casey
    Rick Casey, Graduate research assistant CADSWES, http://cadswes.colorado.edu
    University of Colorado at Boulder [email protected] 303.492.0892
    null

    Yes, typical behavior is that when you have multiple outputs it will create a one row IllumDoc to wrap them all together with OuputParameter=* (and the xml will be ignored unless it is the only output property or you've requested it by name).
    How about just using "/Lighthammer/Illuminator?QueryTemplate=xxxx/yyyy&Content-Type=text/xml" or "/Lighthammer/Runner?Transaction=xxxx/yyyy&OutputParameter=OutputXML" which will both return your multi-rowset output?
    I may be mistaken, but I believe the XacuteResponse was simplified to not include the Rowsets outer node because certain systems had problems digesting the layers, in fact you don't get the <Columns/> section either in the single Rowset.
    Rick - any feedback to this SOAP simplification from Xacute?

  • How to configure for Multiple XML

    Hi,
    We were successful in working with single xml as a input. Now we are using multiple xml as a input for a single transaction. With the references and the suggestion in documents(working with xml files.pdf) related to Documaker we have changed configuration settings in FSISYS.INI and AFGJOB.JDT.
    Down below we have mentioned those changes.
    Input Extract file has been changed as F_Sch.DAT; following is the content in the extract file
    COM_LOB_1111 .\INPUT\F_SCH1.xml
    COM_LOB_1111 .\INPUT\F_SCH2.xml
    COM_LOB_1111 .\INPUT\F_SCH3.xml
    F_SCH1.xml,F_SCH2.xml,F_SCH3.xml
    <?xml version="1.0"?>
    <global>
         <lm>
              <COM>COM</COM>
              <LOB>LOB</LOB>
              <TRANSACTIONID>121212</TRANSACTIONID>
         </lm>     
         <Foodcard>
              <Accname>Alex</Accname>
              <Email>[email protected]</Email>
              <Accid>1234123412341234</Accid>
              <Accno>1234123412341234</Accno>
              <Accaddr1>address1</Accaddr1>
              <Accaddr2>address2</Accaddr2>
              <Accaddr3>address3</Accaddr3>
         </Foodcard>     
    </global>
    Changes to FSISYS.INI
    < ExtractKeyField >
    Key = 1,3
    SearchMask = 1,COM_LOB_1111
    < TRN_FIELDS >
    COM = 1,3,N
    LOB = 5,3,N
    PolicyNum = 9,3,N
    < DATA >
    ExtrFile = C:\FAP\DLL\Computer\INPUT\F_Sch.DAT
    AFGJOB.JDT
    ;ImportXMLFile;2;SCH=1,COM_LOB_1111 15,19
    Inspite of those changes that made, we were not able to generate the output using three xml as a input.
    ***error details.***
    [04:16:29PM] Warning: Company - LOB - Transaction
    [04:16:29PM] Warning: DM17115: : The DownLoadFAP option is set to Yes, this option should be set to No for optimal performance. Check the RunMode control group, DownLoadFAP option.
    [04:16:29PM] Error: Company - LOB - Transaction
    [04:16:29PM] Error: DM12041: : FAP library error: Transaction:<>, area:<DXMLoadXMLRecs>
    code1:<48>, code2:<0>
    msg:<XML Parse Error: The 1 chars before error=<C>, the 20 chars starting at error=< >>.
    [04:16:29PM] Error: Company - LOB - Transaction
    [04:16:29PM] Error: DM12041: : FAP library error: Transaction:<>, area:<DXMLoadXMLRecs>
    code1:<48>, code2:<0>
    msg:<syntax error at line 1 column 0>.
    [04:16:29PM] Error: Company - LOB - Transaction
    [04:16:29PM] Error: DM10292: in <RULXMLExtract()>: Unable to <DXMLoadXMLRecs()>.
    [04:16:29PM] Warning: Company - LOB - Transaction
    [04:16:29PM] Warning: DM13023: in RCBSendToErrBatch(): Unable to assign the transaction to the error batch. The SentToManualBatch field is not defined in the TrnDfdFile.
    [04:16:29PM] Error: Company - LOB - Transaction
    [04:16:29PM] Error: DM10947: in NoGenTrnTransactionProc(): Unable to RULLoadXtrRecs(pRPS).
    [04:16:51PM] Error: Company - LOB - Transaction
    [04:16:51PM] Error: DM12018: in RPDoBaseFormsetRulesForward(): Unable to <WINNOGENTRNTRANSACTIONPROC>().
    [04:16:51PM] Error: Company - LOB - Transaction
    [04:16:51PM] Error: DM12066: in RPProcessOneTransaction(): Unable to RPDoBaseFormsetRulesForward(pRPS, RP_PRE_PROC_A).
    [04:16:51PM] Error: Company - LOB - Transaction
    [04:16:51PM] Error: DM12064: in RPProcessTransactions(): Unable to RPProcessOneTransaction(pRPS). Skipping the rest of the transactions for this Base. See INI group:< GenDataStopOn > option:TransactionErrors.
    [04:16:51PM] Error: Company - LOB - Transaction
    [04:16:51PM] Error: DM12004: in RPProcessOneBase(): Unable to RPProcessTransactions(pRPS).
    [04:16:51PM] Error: Company - LOB - Transaction
    [04:16:51PM] Error: DM12001: in RPProcessBases(): Unable to RPProcessOneBase(pRPS). Skipping the rest of the Bases for this batch run. See INI group:< GenDataStopOn > option:BaseErrors.
    [04:16:51PM] Error: Company - LOB - Transaction
    [04:16:51PM] Error: DM12127: in RPRun(): Unable to RPProcessBases(pRPS).
    [04:16:51PM] Error: An error occurred during processing.
    Kindly let us know in case of any solution for this issue.
    Regards,
    Balaji R.

    It looks like it is unable to load your XML files. Depending on how your configuration is laid out, you may want to list full path names in your extract file - we make use of the same technique in 11.5, which I would imagine isn't terribly different in this respect from 12.0. Our configuration is such that we run Gendata at one level, read an extract file in the deflib folder, and the input files are in an input folder, so each entry in the extract file is C:\fap\mstrres\sampco\input\input1.xml.
    Not sure if that is analogous to your setup or not, but based on the errors, either it can't find the file, so it is a pathing issue, or the file contents are invalid.
    Tony

  • Conversion from xml to csv using xsl

    hi i am converting from xml to csv using xsl i am getting the extra junk character(space) in the csv file.below i written the xml file and xsl file
    xml file
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <?xml-stylesheet type="text/xsl"?>
    <DOCUMENTS>
         <FILE>
         <DOCUMENT>
              <BUSINESS>finance</BUSINESS>
              <PROGRAM>CM</PROGRAM>
              <PROJECT>Testing Area</PROJECT>
              <NAME>121940~1.doc</NAME>
              <TEXT>SQL</TEXT>
              <LINK>http://www.sql.org/</LINK>
         </DOCUMENT>
         <DOCUMENT>
              <BUSINESS>finance</BUSINESS>
              <PROGRAM>CM</PROGRAM>
              <PROJECT>Testing Area</PROJECT>
              <NAME>121940~1.doc</NAME>
              <TEXT>Information</TEXT>
              <LINK>http://google.com/</LINK>
         </DOCUMENT>
         <DOCUMENT>
              <BUSINESS>finance</BUSINESS>
              <PROGRAM>CM</PROGRAM>
              <PROJECT>Testing Area</PROJECT>
              <NAME>121940~1.doc</NAME>
              <TEXT>Configuration</TEXT>
              <LINK>http://msdn.microsoft.com/</LINK>
         </DOCUMENT>
         </FILE>
    </DOCUMENTS>
    xsl file
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="text" indent="yes"/>
    <xsl:template match="DOCUMENTS">
    <xsl:text>Business,Program,Project,DocumentName,Textforlink,Hyperlink</xsl:text>
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="FILE">
    <xsl:value-of select="DOCUMENT/BUSINESS"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="DOCUMENT/PROGRAM"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="DOCUMENT/PROJECT"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="DOCUMENT/NAME"/>
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="DOCUMENT">
    <xsl:value-of select="','"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="TEXT"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="LINK"/>
    </xsl:template>
    </xsl:stylesheet>
    for converting to csv i am using java program.
    please go through it.

    <xsl:value-of select="','"/>That's not the correct way to output a literal comma. Just write the comma directly, or use xsl:text. And don't put in those line breaks either. You can reduce the rule for FILE to something like this:
    xsl:template match="FILE">
    <xsl:value-of select="DOCUMENT/BUSINESS"/>, <xsl:value-of select="DOCUMENT/PROGRAM"/>, <xsl:value-of select="DOCUMENT/PROJECT"/>, <xsl:value-of select="DOCUMENT/NAME"/>
    <xsl:apply-templates/>
    </xsl:template>

  • Repository event handler doesn't work when inserting an xml-doc via ftp

    Hi,
    I want to add a 'schemaLocation'-attribute to an XML-document when I load it in the repository. Therefore, I use the precreate-repository event and created a Repository Event Handler (see code extract below).
    Everything works fine if I type the following code in SQL Plus:
    Declare
    v_return BOOLEAN;
    Begin
    v_return:=DBMS_XDB.createresource('/public/xml/test.xml', XMLType(bfilename('XMLDIR', 'test.xml'),nls_charset_id('AL32UTF8')));
    end;Unfortunately, when I try to insert an XML-document via ftp into the /public/xml folder it doesn´t work as expected and no 'schemaLocation'-attribute is added to the new resource.
    What's the reason for this strange behavior and how can I solve it?
    For your information: I use the Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Thank you very much for your help!!!
    Repository Event Handler code extract:_
    create or replace
    PACKAGE BODY schemalocation AS
    PROCEDURE handlePreCreate (eventObject DBMS_XEVENT.XDBRepositoryEvent) AS
    XDBResourceObj DBMS_XDBRESOURCE.XDBResource;
    var XMLType;
    l_return BOOLEAN;
    l_xmldoc dbms_xmldom.DOMDocument;
    l_docelem dbms_xmldom.DOMElement;
    l_attr dbms_xmldom.DOMAttr;
    c1 clob;
    node     dbms_xmldom.DOMNode;
    txid varchar2(100);
    dDoc DBMS_XMLDOM.DOMDocument;
    nlNodeList DBMS_XMLDOM.DOMNodeList;
    BEGIN
    XDBResourceObj := DBMS_XEVENT.getResource(eventObject);
    dbms_lob.createTemporary(c1,TRUE);
    var:=DBMS_XDBRESOURCE.getcontentxml(XDBResourceObj);
    l_xmldoc := dbms_xmldom.newDOMDocument(var);
    l_docelem := DBMS_XMLDOM.getDocumentElement(l_xmldoc);
    ------ add schemaLocation attribute
    l_attr := DBMS_XMLDOM.createAttribute(l_xmldoc, 'xsi:schemaLocation');
    DBMS_XMLDOM.setValue(l_attr, 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd');
    l_attr := DBMS_XMLDOM.setAttributeNode(l_docelem, l_attr);
    DBMS_XMLDOM.WRITETOCLOB(l_xmldoc, c1);
    ------- get the value of the TxId-tag
    dDoc := DBMS_XMLDOM.NEWDOMDOCUMENT(c1);
    nlNodeList := DBMS_XMLDOM.GETELEMENTSBYTAGNAME(dDoc, 'TxId');
    node := DBMS_XMLDOM.ITEM(nlNodeList, 0);
    txid:= dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(node));
    l_return:=DBMS_XDB.createresource('/public/ok/'||txid||'.xml', XMLType(c1));
    END;

    Marco,
    Here's an example of the problem :
    create or replace package handle_events
    as
      procedure handlePreCreate(p_event dbms_xevent.XDBRepositoryEvent);
    end;
    create or replace package body handle_events
    is
    procedure handlePreCreate (p_event dbms_xevent.XDBRepositoryEvent)
    is
      XDBResourceObj dbms_xdbresource.XDBResource;
      doc XMLType;
      res boolean;
    begin
      XDBResourceObj := dbms_xevent.getResource(p_event);
      doc := dbms_xdbresource.getContentXML(XDBResourceObj);
      select insertchildxml(
        doc
      , '/root'
      , '@xsi:schemaLocation'
      , 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd'
      , 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
      into doc
      from dual;
      res := dbms_xdb.CreateResource('/public/xml/result.xml', doc);
    end;
    end;
    declare
    res boolean;
    begin
    res := dbms_xdb.CreateFolder('/public');
    res := dbms_xdb.CreateFolder('/public/tmp');
    res := dbms_xdb.CreateFolder('/public/xml');
    end;
    declare
    res            boolean;
    resconfig      xmltype;
    my_schema      varchar2(30) := 'DEV';
    resconfig_path varchar2(300) := '/public/ResConfig.xml';
    resource_path  varchar2(300) := '/public/tmp';
    begin
      resconfig  := xmltype(
    '<ResConfig xmlns="http://xmlns.oracle.com/xdb/XDBResConfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/XDBResConfig.xsd http://xmlns.oracle.com/xdb/XDBResConfig.xsd">
      <event-listeners set-invoker="true">
        <listener>
          <description>My event handler</description>
          <schema>'||my_schema||'</schema>
          <source>HANDLE_EVENTS</source>
          <language>PL/SQL</language>
          <events>
            <Pre-Create/>
          </events>
          <pre-condition>
            <existsNode>
              <XPath>/r:Resource[r:ContentType="text/xml"]</XPath>
              <namespace>xmlns:r="http://xmlns.oracle.com/xdb/XDBResource.xsd"</namespace>
            </existsNode>
          </pre-condition>
        </listener>
      </event-listeners>
      <defaultChildConfig>
        <configuration>
          <path>'||resconfig_path||'</path>
        </configuration>
      </defaultChildConfig>
    </ResConfig>'
      res := dbms_xdb.CreateResource(resconfig_path, resconfig);
      dbms_resconfig.addResConfig(resource_path, resconfig_path, null);
    end;
    /Giving the following input XML file :
    <?xml version="1.0" encoding="utf-8"?>
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>This works :
    SQL> declare
      2    res boolean;
      3  begin
      4    res := dbms_xdb.CreateResource('/public/tmp/test.xml',
      5               xmltype(bfilename('TEST_DIR','test.xml'), nls_charset_id('AL32UTF8')));
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
    as clob indent size = 2)  result
      2  from dual
      3  ;
    RESULT
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
    urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd
    "/>With the same document loaded via FTP, we get :
    SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
    as clob indent size = 2)  result
      2  from dual
      3  ;
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00283: document encoding is UTF-16-based but default input encoding is not
    Error at line 1
    no rows selectedand the content looks like :
    < ? x m l   v e r s i o n = " 1 . 0 "   e n c o d i n g = " u t f - 8 " ? >
    < r o o t   x m l n s : x s i = " h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a - i n s t a n c e " / >As a workaround, I've found that serializing and re-parsing the document solves the problem :
      select insertchildxml(
        xmltype(doc.getclobval())
      , '/root'
      , '@xsi:schemaLocation'
      , 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd'
      , 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
      into doc
      from dual;
    ...We then get the expected result after FTP transfer :
    SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
    as clob indent size = 2)  result
      2  from dual
      3  ;
    RESULT
    <?xml version="1.0" encoding="UTF-8"?>
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
    urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd
    "/>The workaround also works for the DOM version presented above.
    Any ideas?

  • Multiple Pages docs merged into one?

    Say someone was working on a large book project where each chapter is its own Pages document, to keep file sizes down.  Assume further all chapters are done in Page Layout mode.
    After all the chapters have been proofread and corrected, is there a way to MERGE all the pages docs into one?  I know one can merge multiple .PDF docs together using Preview's Thumbnails view, but that does nothing for page numbering - which DOES work in Page Layout mode by the way.
    Any thoughts about how to do a mass merge of two or more Pages docs?
    thanks
    OS/X 10.8.2 Pages 09, 4GB memory

    Hopeful,
    With all docs set to View Thumbnails, Copy and Paste thumbnails from one Doc's Thumbnail Pane to the other's.
    I this case I suppose you would begin the process by creating a blank document for the compilation and systematically moving all the chapters to that new one.
    Jerry

  • Converting XML in WML using XSL Processor from XMLParser v2

    When trying to concert an XML doc into WML, it seems like the XSL Processor is removing some WML tags. Below are the XML doc and XSL doc I am using :
    The XML DOC
    <?xml version="1.0"?>
    <ROWSET>
    <ROW id="1">
    <NAME>RestaurantName</NAME>
    <ADDRESS>RestaurantAddress</ADDRESS>
    <PHONE_TYPE>Fixed</PHONE_TYPE>
    <PHONE>0112345678</PHONE>
    <PRICE>60</PRICE>
    <MENU>Salad, Pizza</MENU>
    <DESCRIPTION>Very good restaurant</DESCRIPTION>
    </ROW>
    <ROW id="2">
    <NAME>SecondRestaurantName</NAME>
    <ADDRESS>SecondRestaurantAddress</ADDRESS>
    <PHONE_TYPE>Fixed</PHONE_TYPE>
    <PHONE>0187654321</PHONE>
    <PRICE>60</PRICE>
    <MENU>Salad, Fish</MENU>
    <DESCRIPTION>Godd restaurant</DESCRIPTION>
    </ROW>
    </ROWSET>
    The XSL DOC
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <WML>
    <CARD>
    <xsl:apply-templates/>
    </CARD>
    </WML>
    </xsl:template>
    <xsl:template match="ROWSET">
    <xsl:for-each select="ROW">
    <xsl:value-of select="NAME"/>
    <xsl:value-of select="ADDRESS"/>
    Phone : <xsl:value-of select="PHONE"/>
    Price of the menu : <xsl:value-of select="PRICE"/>
    You can order : <xsl:value-of select="MENU"/>
    <xsl:value-of select="DESCRIPTION"/>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    The
    tag are removed by the XSL Processor ; In fact it seems that any tag contained within <xsl:template match="ROWSET"> and </template> is removed. This does not occurs with other XSL processor (such as lotusxsl).
    Is there something I'm doing wrong ??

    Your examples works correctly for me using the XSLT engine that comes with release 2.0.2.6 of the Oracle XML Parser "v2" for Java.
    Are you working with this latest release?

  • Problem inserting XML doc (character set)

    Hi all,
    I'm having trouble trying to insert XML either "posting" it (xsql) or "putting" it
    (OracleXML putXML).
    The error that I get: "not supported
    oracle-character-set-174".
    The environment is:
    Oracle 8i 8.1.5
    (NLS_CHARACTERSET EL8MSWIN1253 for greek)
    JDK 1.2.2
    Apache Web Server 1.3.11
    Apache JServ 1.1
    XSQL v 0.9.9.1 and
    XMLSQL, XML parser v2 that comes with it.
    I had dropped all java classes and reloaded
    them using oraclexmlsqlload batch file.
    But still getting the same error.
    The thing that is that I am
    able to insert XML doc that was generated
    with an authoring tool called W4F that extracts data from HTML pages and map them to
    XML document, even with greek characters
    in it. But when XML is generated using
    an editor or the servlet like the following:
    newschedule.xsql like
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="latestschedules.xsl"?>
    <page connection="dtv" xmlns:xsql="urn:oracle-xsql">
    <xsql:insert-request date-format="DD'/'MM'/'YYYY" table="schedule_details_view"
    transform="request-to-newschedule.xsl"/>
    <xsql:query table="schedule"
    tag-case="lower" max-rows="5" rowset-element="latestschedules"
    row-element="schedule">
    select *
    from schedules
    order by schedule_id desc
    </xsql:query>
    </page>
    request-to-newschedule.xsl like
    <?xml version = '1.0'?>
    <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <xsl:for-each select="request/parameters">
    <ROW>
    <SCHEDULE_ID><xsl:value-of select="Schedule_id_field"/></SCHEDULE_ID>
    <DESCRIPTION><xsl:value-of select="Description_field"/></DESCRIPTION>
    <DETAILS>
    <DETAILS_ITEM>
    <STARTING_TIME><xsl:value-of select="Starting_Time_field_1"/></STARTING_TIME>
    <DURATION><xsl:value-of select="Duration_field_1"/></DURATION>
    </DETAILS_ITEM>
    <DETAILS_ITEM>
    <STARTING_TIME><xsl:value-of select="Starting_Time_field_2"/></STARTING_TIME>
    <DURATION><xsl:value-of select="Duration_field_2"/></DURATION>
    </DETAILS_ITEM>
    <DETAILS_ITEM>
    <STARTING_TIME><xsl:value-of select="Starting_Time_field_3"/></STARTING_TIME>
    <DURATION><xsl:value-of select="Duration_field_3"/></DURATION>
    </DETAILS_ITEM>
    <DETAILS_ITEM>
    <STARTING_TIME><xsl:value-of select="Starting_Time_field_4"/></STARTING_TIME>
    <DURATION><xsl:value-of select="Duration_field_4"/></DURATION>
    </DETAILS_ITEM>
    <DETAILS_ITEM>
    <STARTING_TIME><xsl:value-of select="Starting_Time_field_5"/></STARTING_TIME>
    <DURATION><xsl:value-of select="Duration_field_5"/></DURATION>
    </DETAILS_ITEM>
    </DETAILS>
    </ROW>
    </xsl:for-each>
    </ROWSET>
    Hope that someone could help me on this ...
    Any advice is highly appreciated.
    Thanks in advance
    Nicos Gabrielides
    email: [email protected]

    Hi,
    How about applying an XSL on the existing XML doc to create another XML doc to filter out the table column not found in the target db table, so that all the columns are matched and then use putXML to load?
    Hope that helps.
    OTN team@IDC

Maybe you are looking for

  • Adding to the end of a file

    hi guys, im tryin to open a file then add changes to the end of it, at the mo im using the following but it doesnt add to the end, any ideas? try { BufferedReader br = new BufferedReader(new FileReader("H:\\new folder\\TransactionFile.txt"));      Bu

  • Making a US account to download ps4 games...?

    Just wondering if this is allowed? or will it be patched ?  as curretly there is a offer of £8 for the last of us remastered digital code but it will only work on a US account...

  • HT204088 how to refund a purchase?

    Dear All, I don't know why a magazine subscription has been purchased. I want to refund my money back. Could anyone please help me? Regards, M.

  • How to run thrid party exe

    Hi, I'm new to netbeans, I'm trying to make a GUI to that it can run a third-party command-line exe. the command that I'm trying to work on is as follows: clic mp3play.gd -i c:\test.mp3 where: clic is the main exe. mp3play.gd  -i is the parameter tes

  • Lost ical entries

    Reinstalled system software on my eMac recently. It wiped out all the ical calendar entries. I recently bought an ibook and transferred everything from the eMac, icncluding the calendar, so I have backup data. However when using Migration Assistant f