.xml file into .txt file using Conversion Agent

Hi All,
I am working on a sceanrio in which the input to the XI is <b>abc.xml</b> file and the output is <b>sdf.txt</b> using <b>Conversion Agent</b>. The XML data should change in txt format.
Please tell me the steps involved on XI side as i have configured the Conversion agent and deployed in XI server.
Thanks
Regards,
Vikas

Hi..
Go through this Blog..
/people/william.li/blog/2006/03/17/how-to-get-started-using-conversion-agent-from-itemfield
The module name must be
localejbs/sap.com/com.sap.nw.cm.xi/CMTransformBean.
The parameter name must be TransformationName
Might Help you...
Regards,
Colin.

Similar Messages

  • Building PDF file using Conversion Agent

    Hello Experts,
    Is it possible to build a PDF from XML using Conversion Agent?
    Best Regards,
    Artsiom Anichenka

    Hi,
    This might help you
    /people/paul.medaille/blog/2005/11/17/more-on-the-sap-conversion-agent-by-itemfield
    /people/alexander.bundschuh/blog/2006/03/14/integrate-sap-conversion-agent-by-itemfield-with-sap-xi
    /people/paul.medaille/blog/2005/11/18/conversion-agent-a-free-lunch
    /people/william.li/blog/2006/03/17/how-to-get-started-using-conversion-agent-from-itemfield
    https://websmp102.sap-ag.de/~sapdownload/011000358700001090982006E/ConvAgentDocSP16.zip
    https://websmp102.sap-ag.de/~sapdownload/011000358700004921152005E/ConversionAgent.pdf
    Regards
    Agasthuri Doss

  • Reading XML file using BAPI and then uploading that xml file data into SAP

    I am getting a xml file from Java server. I need to take
    data from this file using BAPI and need to upload into SAP using SAP.
    Please tell me how to read XML files using BAPI's.

    <b>SDIXML_DATA_TO_DOM</b> Convert SAP data (elementary/structured/table types) into DOM (XML
    <b>SDIXML_DOM_TO_XML</b>  Convert DOM (XML) into string of bytes that can be downloaded to PC or application server
    <b>SDIXML_DOM_TO_SCREEN</b> Display DOM (XML)
    <b>SDIXML_DOM_TO_DATA</b>
    data: it_table like t001 occurs 0.
    data: l_dom      TYPE REF TO IF_IXML_ELEMENT,
          m_document TYPE REF TO IF_IXML_DOCUMENT,
          g_ixml     TYPE REF TO IF_IXML,
          w_string   TYPE XSTRING,
          w_size     TYPE I,
          w_result   TYPE I,
          w_line     TYPE STRING,
          it_xml     TYPE DCXMLLINES,
          s_xml      like line of it_xml,
          w_rc       like sy-subrc.
    start-of-selection.
      select * from t001 into table it_table.
    end-of-selection.
    initialize iXML-Framework          ****
      write: / 'initialiazing iXML:'.
      class cl_ixml definition load.
      g_ixml = cl_ixml=>create( ).
      check not g_ixml is initial.
      write: 'ok'.
    create DOM from SAP data           ****
      write: / 'creating iXML doc:'.
      m_document = g_ixml->create_document( ).
      check not m_document is initial.
      write: 'ok'.
      write: / 'converting DATA TO DOM 1:'.
      CALL FUNCTION 'SDIXML_DATA_TO_DOM'
        EXPORTING
          NAME               = 'IT_TABLE'
          DATAOBJECT         = it_table[]
        IMPORTING
          DATA_AS_DOM        = l_dom
        CHANGING
          DOCUMENT           = m_document
        EXCEPTIONS
          ILLEGAL_NAME       = 1
          OTHERS             = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
      check not l_dom is initial.
      write: / 'appending DOM to iXML doc:'.
      w_rc = m_document->append_child( new_child = l_dom ).
      if w_rc is initial.  write  'ok'.
      else.                write: 'Err =', w_rc.
      endif.
    visualize iXML (DOM)               ****
      write: / 'displaying DOM:'.
      CALL FUNCTION 'SDIXML_DOM_TO_SCREEN'
        EXPORTING
          DOCUMENT          = m_document
        EXCEPTIONS
          NO_DOCUMENT       = 1
          OTHERS            = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
    convert DOM to XML doc (table)     ****
      write: / 'converting DOM TO XML:'.
      CALL FUNCTION 'SDIXML_DOM_TO_XML'
        EXPORTING
          DOCUMENT            = m_document
        PRETTY_PRINT        = ' '
        IMPORTING
          XML_AS_STRING       = w_string
          SIZE                = w_size
        TABLES
          XML_AS_TABLE        = it_xml
        EXCEPTIONS
          NO_DOCUMENT         = 1
          OTHERS              = 2.
      if sy-subrc = 0.   write  'ok'.
      else.              write: 'Err =', sy-subrc.
      endif.
      write: / 'XML as string of size:', w_size, / w_string.
      describe table it_xml lines w_result.
      write: / 'XML as table of', w_result, 'lines:'..
      loop at it_xml into s_xml.
        write s_xml.
      endloop.
      write: / 'end of processing'.
    end of code
    Hope this will be useful.
    regards
    vinod

  • Procedure for read/write an XML-File using UCCX9

    Hi Team!
    Is there someone who can explain me the procedure of reading/writing an XML-File using Cisco UCCX Rel. 9.0?
    In the last couple of days I did a lot of research on the partner community as well as reading the CRS-Editor-PDFs.
    But I can’t find a solution.
    There are some templates available but they all didn’t seem to work.
    I have two xml-files, both uploaded to “Document Management\en_us\”.
    The script itself is attached to this posting.
    I build that my script according to a sample script I found in the community.
    From my point of view I have configured my script exactly like the sample script.
    But it still doesn’t work.
    I am especially interested in where to store the the appropriate files.
    I would be very happy if there is someone who can explain me, what’s wrong there.
    Many thanks in advance.
    Kind regards
    Michael

    I'm experiencing the same issue [reading XML causes errors that say things from "no such file" to some odd Java exception.] I'm able to use a template XML file and after authenticating a user, transform the template into a proper XML file and then successfully save it to the en_US Doc Repository with updated values.
    However, no matter what I've tried or who I've asked, the READ on the XML file so that I can actually script something that does some routing based on the value of the XML file created in my first script? Ultra fail.
    I've even worked with three separate TAC IPCC engineers who were able to reproduce the issue in their test environment, but they were unable to assist. Eventually, whe pressed, I received this response from the last IPCC engineer.:
    "Hello Brad,
    Yes I know what I provided you with is what you already have achieved and this missing step is precisely what you need: how to setup the script to check the status and value of this XML document and then decide routing according to the state.   But unfortunately this is what I found internally.  The other resources are the ones you already know:  support forums, scripting guides.  The other resource with suggest to customer looking for script assistance is the Cisco Account Manager of your company, they know where to get the resources for such issues.   Then again as I mentioned before on our phone conversation TAC does not support scripting but certainly if I find something else on my side I will let you know for sure."
    I would do ponderous cartwheels of joy if someone who has this working in version 9.x [9.0.2 specifically] could share the deep magic.

  • Creating XML File Using xmldom Package

    How can I create an XML file from scratch using the PL/SQL xmldom package?
    I want to create an XML file using the xmldom package instead of building the individual tags as strings of VARCHAR2 character data. There is quite a bit of documentation regarding manipulating input XML files using DOM -- but not for creating XML files from scratch given known "tagnames" (<lastName>) and retrieved database "values" ("Smith").
    <person>
    <lastName>Smith</lastName>
    </person>
    Is there any documentation that you can recommend?
    Thank you.

    Here is an example.
    The create_file procedure creates the file.
    The other procedures are generic procs that can be used with any XML.
    PROCEDURE create_file_with_root(po_xmldoc OUT xmldom.DOMDocument,
    pi_root_tag IN VARCHAR2,
                                            po_root_element OUT xmldom.domelement,
                                            po_root_node OUT xmldom.domnode,
                                            pi_doctype_url IN VARCHAR2) IS
    xmldoc xmldom.DOMDocument;
    root xmldom.domnode;
    root_node xmldom.domnode;
    root_element xmldom.domelement;
    record_node xmldom.domnode;
    newelenode xmldom.DOMNode;
    BEGIN
    xmldoc := xmldom.newDOMDocument;
    xmldom.setVersion(xmldoc, '1.0');
    xmldom.setDoctype(xmldoc, pi_root_tag, pi_doctype_url,'');
    -- Create the root --
    root := xmldom.makeNode(xmldoc);
    -- Create the root element in the file --
    create_element_and_append(xmldoc, pi_root_tag, root, root_element, root_node);
    po_xmldoc := xmldoc;
    po_root_node := root_node;
    po_root_element := root_element;
    END create_file_with_root;
    PROCEDURE create_element_and_append(pi_xmldoc IN OUT xmldom.DOMDocument,
    pi_element_name IN VARCHAR2,
                                            pi_parent_node IN xmldom.domnode,
                                            po_new_element OUT xmldom.domelement,
                                            po_new_node OUT xmldom.domnode) IS
    element xmldom.domelement;
    child_node xmldom.domnode;
    newelenode xmldom.DOMNode;
    BEGIN
    element := xmldom.createElement(pi_xmldoc, pi_element_name);
    child_node := xmldom.makeNode(element);
    -- Append the new node to the parent --
    newelenode := xmldom.appendchild(pi_parent_node, child_node);
    po_new_node := child_node;
    po_new_element := element;
    END create_element_and_append;
    FUNCTION create_text_element(pio_xmldoc IN OUT xmldom.DOMDocument, pi_element_name IN VARCHAR2,
    pi_element_data IN VARCHAR2, pi_parent_node IN xmldom.domnode) RETURN xmldom.domnode IS
    parent_node xmldom.domnode;                                   
    child_node xmldom.domnode;
    child_element xmldom.domelement;
    newelenode xmldom.DOMNode;
    textele xmldom.DOMText;
    compnode xmldom.DOMNode;
    BEGIN
    create_element_and_append(pio_xmldoc, pi_element_name, pi_parent_node, child_element, child_node);
    parent_node := child_node;
    -- Create a text node --
    textele := xmldom.createTextNode(pio_xmldoc, pi_element_data);
    child_node := xmldom.makeNode(textele);
    -- Link the text node to the new node --
    compnode := xmldom.appendChild(parent_node, child_node);
    RETURN newelenode;
    END create_text_element;
    PROCEDURE create_file IS
    xmldoc xmldom.DOMDocument;
    root_node xmldom.domnode;
    xml_doctype xmldom.DOMDocumentType;
    root_element xmldom.domelement;
    record_element xmldom.domelement;
    record_node xmldom.domnode;
    parent_node xmldom.domnode;
    child_node xmldom.domnode;
    newelenode xmldom.DOMNode;
    textele xmldom.DOMText;
    compnode xmldom.DOMNode;
    BEGIN
    xmldoc := xmldom.newDOMDocument;
    xmldom.setVersion(xmldoc, '1.0');
    create_file_with_root(xmldoc, 'root', root_element, root_node, 'test.dtd');
    xmldom.setAttribute(root_element, 'interface_type', 'EXCHANGE_RATES');
    -- Create the record element in the file --
    create_element_and_append(xmldoc, 'record', root_node, record_element, record_node);
    parent_node := create_text_element(xmldoc, 'title', 'Mr', record_node);
    parent_node := create_text_element(xmldoc, 'name', 'Joe', record_node);
    parent_node := create_text_element(xmldoc,'surname', 'Blogs', record_node);
    -- Create the record element in the file --
    create_element_and_append(xmldoc, 'record', root_node, record_element, record_node);
    parent_node := create_text_element(xmldoc, 'title', 'Mrs', record_node);
    parent_node := create_text_element(xmldoc, 'name', 'A', record_node);
    parent_node := create_text_element(xmldoc, 'surname', 'B', record_node);
    -- write the newly created dom document into the buffer assuming it is less than 32K
    xmldom.writeTofile(xmldoc, 'c:\laiki\willow_data\test.xml');
    EXCEPTION
    WHEN xmldom.INDEX_SIZE_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Index Size error');
    WHEN xmldom.DOMSTRING_SIZE_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'String Size error');
    WHEN xmldom.HIERARCHY_REQUEST_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Hierarchy request error');
    WHEN xmldom.WRONG_DOCUMENT_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Wrong doc error');
    WHEN xmldom.INVALID_CHARACTER_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Invalid Char error');
    WHEN xmldom.NO_DATA_ALLOWED_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Nod data allowed error');
    WHEN xmldom.NO_MODIFICATION_ALLOWED_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'No mod allowed error');
    WHEN xmldom.NOT_FOUND_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Not found error');
    WHEN xmldom.NOT_SUPPORTED_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Not supported error');
    WHEN xmldom.INUSE_ATTRIBUTE_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'In use attr error');
    WHEN OTHERS THEN
    dbms_output.put_line('exception occured' || SQLCODE || SUBSTR(SQLERRM, 1, 100));
    END create_file;

  • Reading XML file using BAPI  I must use adapters .

    Reading XML file using BAPI and then uploading that xml file data into SAP using BDC.
    I cant take file on to my Application server I am getting the file dynamically from other file server and I need to use BAPis to read data from XML file.please tell me what should be my Import,Export and Tables parameterrs should be.
    Thanks

    Hi,
    Import, export and table parameters for BAPI is required, without that BAPI will not able to collect the data from XML. What you need to do is write a Zprogram and collect the data, store that data in internal table and call the BAPI by passing required parameters.
    Different Scanarios:
    1) Before calling a BAPI write some other program which collects the data from XML and create a UNIX file. Try to get the data from UNIX FILE
    2) If you see the XML tags, data will be in side that tags, try to get the data from XML tags and store that data in one SAP table. You can use the BAPI by fetching the data from table
    3)Create a table and store the data in the table. Use the table in SAP to extract the data.
    BAPI won't work without any parameters, you have to pass some parameters then the BAPI will return some values.
    Hope i am clear.
    Thanks&Regards,
    -Suresh Revuru

  • How to create new XML file using retreived XML content by using SAX API?

    hi all,
    * How to create new XML file using retreived XML content by using SAX ?
    * I have tried my level best, but output is coming invalid format, my code is follows,
    XMLFileParser.java class :-
    import java.io.StringReader;
    import java.io.StringWriter;
    import javax.xml.transform.OutputKeys;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMResult;
    import javax.xml.transform.sax.SAXSource;
    import javax.xml.transform.sax.SAXTransformerFactory;
    import javax.xml.transform.sax.TransformerHandler;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.XMLFilterImpl;
    public class PdfParser extends XMLFilterImpl {
        private TransformerHandler handler;
        Document meta_data;
        private StringWriter meta_data_text = new StringWriter();
        public void startDocument() throws SAXException {
        void startValidation() throws SAXException {
            StreamResult streamResult = new StreamResult(meta_data_text);
            SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
            try
                handler = factory.newTransformerHandler();
                Transformer transformer = handler.getTransformer();
                transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                handler.setResult(streamResult);
                handler.startDocument();
            catch (TransformerConfigurationException tce)
                System.out.println("Error during the parse :"+ tce.getMessageAndLocation());
            super.startDocument();
        public void startElement(String namespaceURI, String localName,
                String qualifiedName, Attributes atts) throws SAXException {
            handler.startElement(namespaceURI, localName, qualifiedName, atts);
            super.startElement(namespaceURI, localName, qualifiedName, atts);
        public void characters(char[] text, int start, int length)
                throws SAXException {
            handler.characters(text, start, length);
            super.characters(text, start, length);
        public void endElement(String namespaceURI, String localName,
                String qualifiedName) throws SAXException {
            super.endElement("", localName, qualifiedName);
            handler.endElement("", localName, qualifiedName);
        public void endDocument() throws SAXException {
        void endValidation() throws SAXException {
            handler.endDocument();
            try {
                TransformerFactory transfactory = TransformerFactory.newInstance();
                Transformer trans = transfactory.newTransformer();
                SAXSource sax_source = new SAXSource(new InputSource(new StringReader(meta_data_text.toString())));
                DOMResult dom_result = new DOMResult();
                trans.transform(sax_source, dom_result);
                meta_data = (Document) dom_result.getNode();
                System.out.println(meta_data_text);
            catch (TransformerConfigurationException tce) {
                System.out.println("Error occurs during the parse :"+ tce.getMessageAndLocation());
            catch (TransformerException te) {
                System.out.println("Error in result transformation :"+ te.getMessageAndLocation());
    } CreateXMLFile.java class :-
    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();
    Sax.endElement("", "basic-metadata", "basic-metadata");* In CreateXMLFile.java
    class, I have retreived the xml content in the meta_data object, after that i have converted into character array and this will be sends to SAX
    * In this case , the XML file created successfully but the retreived XML content added as an text in between basic-metadata Element, that is, retreived XML content
    is not an XML type text, it just an Normal text Why that ?
    * Please help me what is the problem in my code?
    Cheers,
    JavaImran

    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    </code><code>Sax.endElement("", "basic-metadata", "basic-metadata");</code>
    <code class="jive-code jive-java">Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();     
    * I HAVE CHANGED MY AS PER YOUR SUGGESTION, NOW SAME RESULT HAS COMING.
    * I AM NOT ABLE TO GET THE EXACT OUTPUT.,WHY THAT ?
    Thanks,
    JavaImran{code}

  • How to update XML file using XSLT

    Hi there,
    I have a "small" issue with exporting data to an XML file using XSLT.
    A two steps process is needed to import data from a non-hierarchical XML file into ABAP, change the data, and then update the XML file with new values. The problem is not trivial, since the format of the XML file is a complex one: there are many interdependent elements on the same level, pointing to each other by using id and ref attributes. Based on these values the data can be read and written into an internal table. I use XSLT and XPath for that. So the inbound process is done and seems to work correctly. I have to mention that the file contains much more data than I need. I am working only with a small part of it.
    Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT? I can pass only the internal table to the transformation, so how do I access the XML file in order to update it? I have tried to use the <B>xsl:document()</B> function to access the content of the file store locally on my PC, but it fails each time by throwing and URI exception. I have tried the absolute path without any addition and the path with the file:/// addition. Same result. Please advise.
    Many thanks,
    Ferenc
    P.S. Please provide me with links only if they are relevant for this very matter. I will not give points for irrelevant postings...

    Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT?
    XSLT approach:  check these online tutorial
    http://www.xml.com/pub/a/2000/08/02/xslt/index.html
    http://www.xml.com/pub/a/2000/06/07/transforming/index.html
    ABAP approach:
    for example you have the xml (original) in a string called say xml_out .
    data: l_xml  type ref to cl_xml_document ,
            node type ref to if_ixml_node  .
    create object l_xml.
    call method l_xml->parse_string
      exporting
        stream = xml_out.
    node = l_xml->find_node(
        name   = 'IDENTITY'
       ROOT   = ROOT
    l_xml->set_attribute(
        name    = 'Name'
        value   = 'Charles'
        node    = node
    (the above example reads the element IDENTITY and sets attribute name/value to the same)
    like wise you can add new elements starting from IDENTITY using various methods available in class CL_XML_DOCUMENT
    so how do I access the XML file in order to update it?
    you have already read this XML into a ABAP variable right?
    Sorry couldnt understand your whole process, why do you need to read local XML file?
    Raja

  • How to write as XML file using java 1.5

    hi all,
    i am trying to create an XML file using java 1.5. I took a XML creating java file which was working with java 1.4 and ported same file into java 1.5 with changes according to the SAX and DOM implmentation in java 1.5 and tried to compile. But while writing as a file it throws error "cannot find the symbol."
    can any body help me out to solve this issue.......
    thankx in advance
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.NamedNodeMap;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.DocumentHandler;
    import org.xml.sax.InputSource;
    import org.xml.sax.helpers.ParserFactory;
    import java.io.*;
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();                   
                   dbf.setNamespaceAware(true);
    DocumentBuilder db = dbf.newDocumentBuilder();                   
    Document xmlDoc =  db.newDocument();
    // this creates the xml document ref
    // parent node reference
    Element rootnd = (Element) xmlDoc.createElement("ALL_TABLES");
    // root node
    xmlDoc.appendChild(rootnd);
    Element rownd = (Element) xmlDoc.createElement("ROW");
    rootnd.appendChild(rownd);
    Element statusnd = (Element) xmlDoc.createElement("FILE_STATUS");
    rownd.appendChild(statusnd);
    statusnd.appendChild(xmlDoc.createTextNode("Y")
    FileOutputStream outpt = new FileOutputStream(outdir + "//forbranch.xml");
    Writer outf = new OutputStreamWriter(outpt, "UTF-8");
    //error is occuring here Since write method is not available in the Document class
    xmlDoc.write(outf);
    outf.flush();

    Hi,
    when I look in the JDK1.4.2 specification I don't see any write method in the Document interface.
    However, your solution is the Transformer class. There you transform your DOM tree into any output you need. Your code sould look something like this:     TransformerFactory tf = TransformerFactory.newInstance();
         // set all necessary features for your transformer -> see OutputKeys
         Transformer t = tf.newTransformer();
         t.transform(new DOMSource(xmlDoc), new StreamResult(file));Then you have your XML file stored in the file system.
    Hope it helps.

  • Error while encrypting the xml file using asymmetric cipher...pls help

    i am encryption the xml file using asymmetric cyper....
    in one class , i am generating private key and public key using "RSA" algorithm..using 1024 byte initialization...
    it is generating properly...
    and after that in second class i am encrypting the xml file using "DESede" algorithm and i am using public key of above class..
    but i am getting exceptione :
    java.security.InvalidKeyException: Invalid key length: 162 bytes
    at com.sun.crypto.provider.DESedeCipher.engineGetKeySize(DashoA6275)
    at javax.crypto.Cipher.init(DashoA6275)
    at XmlEncryption.getEncryptedData(XmlEncryption.java:147)
    at XmlEncryption.encryptCompleteXmlFile(XmlEncryption.java:123)
    at demoXmlEncApp.simulateBookSellersEnd(demoXmlEncApp.java:72)
    at demoXmlEncApp.main(demoXmlEncApp.java:29)
    so, what is that ?
    i want to use RSA algo for key generatiion and DESede for cipher initialization .
    is there any site for where source code of xml file encryption using asymmetric cipher is available?
    pls, help me.....

    Sachin,
    What sabre150 is trying to explain to you, is that encrypting data (such as an XML file) is a 2-step process. In the first step, you generate a symmetric key (such as DES, 3DES, AES) and encrypt your file with this key (and the appropriate mode and padding).
    In order to ensure that your encrypted data cannot be decrypted by unauthorized individuals, you now need to protect the symmetric key. Encrypting your symmetric key with another symmetric key does not solve the problem, since you have a chain of symmetric keys that need to be encrypted into infinity.
    Cryptographers solve this problem by encrypting the symmetric key with an asymmetric key, such as as RSA. To perform this second step, you generate an RSA key-pair, encrypt the symmetric key you generated in step 1 with the Public key of the RSA key-pair, and give the recipient of the encrypted XML file, access to the Private key of the RSA key-pair as well as the encrypted symmetric key.
    The recipient, then uses the RSA Private key to decrypt the symmetric key first, and then uses the "plaintext" symmetric key to decrypt the XML file.
    What sabre150 was also attempting to explain to you, is the traditional way of transporting an encrypted "blob" that consists of data + symmetric key. With a modern key-management system, combining the two would be unnecessary.

  • Loading xml file using owb

    Hi Gurus,
    I am new to owb and as per requirement we need to load xml files into oracle table using owb.
    below is the xml file:
    <bookstore>
    <book category="COOKING">
    <title lang="en">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>
    <book category="CHILDREN">
    <title lang="en">Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
    </book>
    <book category="WEB">
    <title lang="en">Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
    </book>
    </bookstore>
    please help me in loading above xml file using owb.

    You can leverage the XML SQL functions to extract from XML using the database, see the blog post below;
    https://blogs.oracle.com/warehousebuilder/entry/leveraging_xdb
    For example to extract information from your XML document the following SQL can be generated from OWB;
    select extractValue(value(s), '/book/author'),
    extractValue(value(s), '/book/year'),
    extractValue(value(s), '/book/price') from
    ( select XMLType('<bookstore>
    +<book category="COOKING">+
    +<title lang="en">Everyday Italian</title>+
    +<author>Giada De Laurentiis</author>+
    +<year>2005</year>+
    +<price>30.00</price>+
    +</book>+
    +<book category="CHILDREN">+
    +<title lang="en">Harry Potter</title>+
    +<author>J K. Rowling</author>+
    +<year>2005</year>+
    +<price>29.99</price>+
    +</book>+
    +<book category="WEB">+
    +<title lang="en">Learning XML</title>+
    +<author>Erik T. Ray</author>+
    +<year>2003</year>+
    +<price>39.95</price>+
    +</book>+
    +</bookstore>') adoc from dual+) r,
    table(XMLSequence(extract(r.adoc, '/bookstore/book'))) s;
    Cheers
    David

  • Pooling data from an XML file to another XML file using File Adapter

    Hi,
    I am trying to Pool data from an XML file to another XML file using File Adapter. I have added "Target Namespace" in both the XML and XSD.The problem is "At the destination given in the FileAdapter" only a blank XML file is created and it doesnot have any data.
    Kindly suggest me some methods
    Thanks in Advance.

    Ok here is a solution with external tables.
    SQL> CREATE DIRECTORY my_xml_dir AS 'E:\oracle\Log_files\UTL_AKIVATST'
    2 /
    Directory created.
    SQL> DROP TABLE my_xml_et
    2 /
    Table dropped.
    SQL> CREATE TABLE my_xml_et
    2 ( EMPNO NUMBER,
    3 EMPNAME VARCHAR2(10),
    4 JOB VARCHAR2(10),
    5 HIREDATE DATE,
    6 SAL NUMBER
    7 )
    8 ORGANIZATION EXTERNAL
    9 (
    10 TYPE ORACLE_LOADER
    11 DEFAULT DIRECTORY my_xml_dir
    12 ACCESS PARAMETERS
    13 (
    14 records delimited by "</EMP>"
    15 badfile my_xml_dir:'empxt%a_%p.bad'
    16 logfile my_xml_dir:'empxt%a_%p.log'
    17 FIELDS
    18 (
    19 filler char(2000) terminated by "<EMP>",
    20 EMPNO char(2000) enclosed by "<EMPNO>" and "</EMPNO>",
    21 EMPNAME char(2000) enclosed by "<ENAME>" and "</ENAME>",
    22 JOB char(2000) enclosed by "<JOB>" and "</JOB>",
    23 HIREDATE char(2000) enclosed by "<HIREDATE>" and "</HIREDATE>",
    24 SAL char(2000) enclosed by "<SAL>" and "</SAL>"
    25 )
    26 )
    27 LOCATION ('emp.xml')
    28 )
    29 PARALLEL
    30 REJECT LIMIT UNLIMITED
    31 /
    Table created.
    SQL> SELECT * FROM my_xml_et
    2 /
    EMPNO EMPNAME JOB HIREDATE SAL
    7369 SMITH CLERK 17-DEC-80 800
    7499 ALLEN SALESMAN 20-FEB-81 1600
    This is the XML file i used emp.xml
    <EMPLOYEES>
    <EMP>
    <EMPNO>7369</EMPNO>
    <ENAME>SMITH</ENAME>
    <JOB>CLERK</JOB>
    <HIREDATE>17-DEC-80</HIREDATE>
    <SAL>800</SAL>
    </EMP>
    <EMP>
    <EMPNO>7499</EMPNO>
    <ENAME>ALLEN</ENAME>
    <JOB>SALESMAN</JOB>
    <HIREDATE>20-FEB-81</HIREDATE>
    <SAL>1600</SAL>
    <COMM>300</COMM>
    </EMP>
    </EMPLOYEES>
    Use this external table to insert into your table.
    Thanks,
    Karthick.

  • How to Save a XML file using Document Object

    Hai all,
    I am new to XML and i created a application to insert a node in the XML file using org.w3c.dom.Document object. And want to know which method has to be used to store the Document object into a XML fille.

    The standard way would be to use a transformer with no transformation where the destination is a StreamResult.
    something like:
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer();
    transformer.transform(new DOMSource(doc), new StreamResult("output.xml"));

  • Problem loading XML-file using SQL*Loader

    Hello,
    I'm using 9.2 and tryin to load a XML-file using SQL*Loader.
    Loader control-file:
    LOAD DATA
    INFILE *
    INTO TABLE BATCH_TABLE TRUNCATE
    FIELDS TERMINATED BY ','
    FILENAME char(255),
    XML_DATA LOBFILE (FILENAME) TERMINATED BY EOF
    BEGINDATA
    data.xml
    The BATCH_TABLE is created as:
    CREATE TABLE BATCH_TABLE (
    FILENAME VARCHAR2 (50),
    XML_DATA SYS.XMLTYPE ) ;
    And the data.xml contains the following lines:
    <?xml version="2.0" encoding="UTF-8"?>
    <!DOCTYPE databatch SYSTEM "databatch.dtd">
    <batch>
    <record>
    <data>
    <type>10</type>
    </data>
    </record>
    <record>
    <data>
    <type>20</type>
    </data>
    </record>
    </batch>
    However, the sqlldr gives me an error:
    Record 1: Rejected - Error on table BATCH_TABLE, column XML_DATA.
    ORA-21700: object does not exist or is marked for delete
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    If I remove the first two lines
    "<?xml version="2.0" encoding="UTF-8"?>"
    and
    "<!DOCTYPE databatch SYSTEM "databatch.dtd">"
    from data.xml everything works, and the contentents of data.xml are loaded into the table.
    Any idea what I'm missing here? Likely the problem is with special characters.
    Thanks in advance,

    I'm able to load your file just by removing the second line <!DOCTYPE databatch SYSTEM "databatch.dtd">. I dont have your dtd file, so skipped that line. Can you check if it's problem with ur DTD?

  • Retrieve and Read XML Files using Oracle6i Forms

    Dear all .. i have some problem here: How can i retrieve and read a XML files using Oracle6i Forms? What should i do? Thanks - ASAP -

    Several ways - Pick up a copy of the Oracle XDK off of OTN. This provides Java and PL/SQL toolkits for dealing with XML files.
    The PL/SQL one would be in the Database, so you might have to use the Java one of you need to do it on the Forms machine.
    You can use the Java Importer in 6i to create PL/SQL wrappers that you can call from forms into the Java XDK APIs.
    Or of course you can just use the TEXT_IO package to read the XML as a text stream and parse it in your own PL/SQL code...

Maybe you are looking for