Like to understand - Stream DataSet (of XML data) to ZIP file?

i have similar kind of requirement where i need to save dataset data in multi part zip file. from this site i got a sample code
.NET - Stream DataSet (of XML data) to ZIP file? but few area is not clear.
the sample code as follows
// get connection to the database
var c1= new System.Data.SqlClient.SqlConnection(connstring1);
var da = new System.Data.SqlClient.SqlDataAdapter()
SelectCommand= new System.Data.SqlClient.SqlCommand(strSelect, c1)
DataSet ds1 = new DataSet();
// fill the dataset with the SELECT
da.Fill(ds1, "Invoices");
// write the XML for that DataSet into a zip file (split into 1mb chunks)
using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile())
zip.MaxOutputSegmentSize = 1024*1024;
zip.AddEntry(zipEntryName, (name,stream) => ds1.WriteXml(stream) );
zip.Save(zipFileName);
how this word code Ionic they are using dotnet zip library ? tell me what is
Ionic
i guess this line zip.MaxOutputSegmentSize = 1024*1024; means each segment size would be 1mb ? am i right ?
this line is not clear
zip.AddEntry(zipEntryName, (name,stream) => ds1.WriteXml(stream) );
what is the meaning of this (name,stream) stream never declared but how they can use ?
tell me what is the meaning of this line zip.AddEntry(zipEntryName, (name,stream) => ds1.WriteXml(stream) ); what the code will do reading the above statement.
suppose if the above code save dataset data in 5 separate zip file then what name will be used for each segment?
if possible give me the code which will read all segment file and extract its content in a folder. thanks

Ionic is a 3rd party library which can be download by click on the shortcut where you got the code.  I don't recommend using compiled 3rd part software unless the source code is provided.  Codeplex solutions are usually very reliable.
Yes 1024 x 1024 is the 1mbyte size of the stream
The library is using a Linq syntax.  So  simple Linq uses something like this
.Select(x => x.ToString())  Where x is a variable name that can be any letter(s) you choose.  Select is part of an enumeration.  It is really just a shortcut instead of using a "FOR" statement.
The line zip is more complicated version of Linq.  It is using two parameters (name,stream).  I don't think the code actually works and you would have to look at the documentation at the codeplex website.
jdweng

Similar Messages

  • How to submit pdf xml data to a file server

    Hi, I am hoping someone can help me. I have created a dynamic pdf in livecycle designer ES, which appears as the requester wants it to. I now just need to work out how to collect the submitted data. Is it possible to submit the xml data to a file server? I have succeeded in emailing the data, but each response is separate xml attachment and would then need to collated, etc. It would be preferable to submit the data directly to a file server if this is possible. Even if it submitted into a database or something. From everything I have read so far, it seems that this is not possible, unless I am missing something. As a newbie to this, any assistance would be much appreciated. Thank you.

    You can submit the data as XML or URL-encoded data (HTTP POST). In either case you will need to have a server-side process to receive and parse the data stream. The server-side process may be a JSP, a servlet, PHP or any technology that can manage HTTP requests/responses.
    See About submitting data using a button at http://help.adobe.com/en_US/livecycle/9.0/designerHelp/000330.html .
    Steve

  • How to write xml data to a file

    Hi all,
    We have a requirement of writing the xml data into a file in given directory in the server. Generating the xml data using the sql query below.
    SELECT XMLELEMENT ("ROW",
    XMLELEMENT ("CELL", xmlattributes ('EBIZCZMDL_01' AS "colname"), inventory_item_id),
    XMLELEMENT ("CELL", xmlattributes ('EBIZFFMT_01' AS "COLNAME"), attribute29),
    XMLELEMENT ("CELL", xmlattributes ('COMMON' AS "COLNAME"),inventory_item_id || '' || attribute29 || 'ITM')
    AS "RESULT") "XMLDATA"
    FROM apps.mtl_system_items_b
    When we try to write the the data from this query to a file using UTL_FILE.put_line, the script gives the error
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    If somebody can help us pls.......
    Thanks in advance

    Hi Odie,
    We are looking at the xml data to be like the below:
    - <xref xmlns="http://xmlns.oracle.com/xref">
    - <table name="NAPP_ITEM_ITEMID">
    - <columns>
    <column name="EBIZFFMT_01" />
    <column name="COMMON" />
    <column name="EBIZQOT_01" />
    <column name="EBIZCZMDL_01" />
    <column name="EBIZCZGOLD_01" />
    </columns>
    - <rows>
    - <row>
    <cell colName="EBIZFFMT_01">154</cell>
    <cell colName="COMMON">154811809990111362727</cell>
    <cell colName="EBIZQOT_01">81</cell>
    <cell colName="EBIZCZMDL_01">91</cell>
    <cell colName="EBIZCZGOLD_01">991</cell>
    </row>
    - <row>
    <cell colName="EBIZFFMT_01">180</cell>
    <cell colName="COMMON">180811809990111362727</cell>
    <cell colName="EBIZQOT_01">871</cell>
    <cell colName="EBIZCZMDL_01">731</cell>
    <cell colName="EBIZCZGOLD_01">341</cell>
    </row>
    </rows>
    </table>
    </xref>
    We have managed half way trying to get the structure. As we are new to this XML Programming.
    The call to dbms_xslprocessor.clob2file is within the cursor loop for the given SQL.
    DECLARE
    l_file_name VARCHAR2 (30);
    l_file_path VARCHAR2 (200);
    CURSOR xml_cur
    IS
    SELECT XMLELEMENT
    ("ROW",
    XMLELEMENT ("CELL",
    xmlattributes ('EBIZCZMDL_01' AS "colname"),
    inventory_item_id
    XMLELEMENT ("CELL",
    xmlattributes ('EBIZFFMT_01' AS "COLNAME"),
    attribute29
    XMLELEMENT ("CELL",
    xmlattributes ('COMMON' AS "COLNAME"),
    inventory_item_id || '' || attribute29 || 'ITM'
    ) AS "RESULT"
    ) "XMLDATA"
    FROM apps.mtl_system_items_b
    WHERE attribute29 IS NOT NULL;
    BEGIN
    l_file_path := '/usr/tmp';
    l_file_name := 'TEST_XREF4.xml';
    FOR xml_rec IN xml_cur
    LOOP
    dbms_xslprocessor.clob2file(xml_rec.XMLDATA, l_file_path, l_file_name, nls_charset_id('UTF8') );
    END LOOP;
    END;
    Please see the above code snippet and help us if we are doing something wrong.
    Thank you

  • Appending XML data to a file using file adaptor

    Hi,
    I am trying to append data to a file using file adaptor in XML format. (Objective is to store data as XML message in the file). I understand it is possible to append data to an existing file by making appropriate changes in WSDL manually. However, my issue is every time the XML data is appended to a file even the XML header message is also getting appended. As a result the file data does not adhere to defined schema structure anymore.
    Is there a way to save XML data in a file in append mode ?
    Thanks, Riz

    I am having the same issue as well, which makes the output XML an invalid one. I have an XSD that has a hierarchy of elements. whenever I am wiriting the child elements the header message & the name space is also getting written. For example
    <?xml version="1.0" ?><Parent xmlns="http://testSchema.com/outputSchema">
    <StartDate>01/01/2001</StartDate>
    <EndDate>01/30/2001</EndDate>
    <Child/>
    </Parent>
    <?xml version="1.0" ?><Child xmlns:ns1="http://testSchema.com/outputSchema">
    <ns1:Id>20012981</ns1:Id>
    <ns1:Value/>
    <ns1:Date>01/15/2001</ns1:Date>
    </Child>
    <?xml version="1.0" ?><Child xmlns:ns1="http://testSchema.com/outputSchema">
    <ns1:Id>20012981</ns1:Id>
    <ns1:Value/>
    <ns1:Date>01/15/2001</ns1:Date>
    </Child>
    I am using a onefile adapter partnerlink to write the parent & an another one for writing the child element, since the child elements will repeat more than once. One other way to fix this issue is write the data using java embedded activity, but that would need a lot of boiler plate code, for writing/reading/appending the same file & for handling all those IOexceptions & buffer IN/outs. I am curious if someone had the same issue & how they resolved it.

  • How to write non-XML data to a file using an OSB FTP Routing?

    Hi --
    Situation ... I need to write non-XML data to a file using FTP. A proxy service retrieves XML and transforms it with XSLT to CSV format, then gives it to a Biz service to file it out, using FTP. Simple.
    Problem ... OSB sends the contents of $body to any service it calls. Because $body is a SOAP document, it has to contain XML. So therefore I have to put my CSV data into an XML element, in order to put it into $body; and this inner element then gets written to the file, which I don’t want. But if I don't enclose my CSV content in a tag, I get "Unexpected CDATA encountered" trying to assign it to a variable.
    There has to be away around this!
    Thanks for your help.
    John Taylor

    Solved. Steps:
    -- Transform the XML to CSV using an XSL transform. Put the CSV data inside enclosing XML elements, and use a Replace action to put the XML element + CSV contents back into *$body*.
    -- Define an MFL transform that only knows about the enclosing XML elements. Use a delimiter of "\n" (hard return).
    -- Route from the proxy service to a Biz service that has Service Type = Messaging Service and Request Message Type = MFL; specify the MFL transform, which will receive the incoming *$body* variable, strip off the enclosing XML element within it, and pass the CSV contents to the FTP service.
    Edited by: DunedainRanger on Nov 29, 2011 9:03 AM

  • URGENT ! Is it possible to create a  xml data control description file

    We are encountering serious problem when generating data control against java bean build from java classes generated with xml top link mapping.
    As workaround we have created a new xml schema that generate the java classes in a way data control may be generated correctly but we have to declare manually each class for java.util.list attribute that are not types by top link.
    Unfortunately some classes seem not to described by a data control xml files for a reason we cannot understand because others similar classes are correctly described.
    To gain time - we have to finish our development -we would force de data control structure by manually adding class data control definition file that are missing.
    Just adding the file in the pasckage is not sufficient.
    What do we have to update to make this file active ?

    Solved my problem by referencing the parent class correctly so the child class xml definition was created by the data control wizard and editable in the structure window.

  • XML data in JSP file

    Guys,
    I need to output some XML data inside my jsp program. This is simple contact xml file, and I need to output that data to the screen.
    Can someone show me code example or point me where I can find one.
    Thanks

    http://developer.java.sun.com/developer/technicalArticles/xml/WebAppDev2/

  • Reading XML data from .pages file

    Hi All!
    I've been trying to get a script up and running, but frankly I'm lost. The script should read the date, lesson no, and name fields from a .pages file and then use that information to send an e-mail.
    What I'm having a problem with is reading the data from the .pages file and I don't know what the best way to do it is because I'm still a novice at this.
    So there are two ways I can think of:
    1. Read directly from the Pages document when it is open. The problem with this is that it's a Pages template and it contains tables. Perhaps the easiest thing would be just to select certain cells directly from pages, but I have no idea how they're labeled or how to access them so I came up with a second idea. If you happen to know how to do this, I would greatly appreciate it.
    2. Pages documents can be unzipped and one of the files is an xml file with a lot of tags and the data I need. I found the following post that talks about how to parse XML via an XSL stylesheet. After going through some tutorials, I got stuck because the xml itself in the Pages file is just a mess to me and I'm confused about which node to choose. In other xml docs you can see a clear, nicely laid out tabbed structure so you can at least figure out the path to the node you want. I stumbled across a nice script for TextWrangler which cleans up XML, but it just barks at the Pages file.
    3. On top of that, I will need to use the name field and match that with an Address Book e-mail address. Should I change the template and make it into an address book field?
    Thanks in advance,
    Paul

    The script should read the date, lesson no, and name fields from a .pages file and then use that information to send an e-mail.
    Maybe you might want to try the following script:
    tell application "Pages"
        activate
        tell foreground layer of page 1 of front document
            select (text box 1 whose vertical position < 0.5)
            tell application "System Events"
                keystroke "c" using {command down} -- ⌘C
                keystroke "a" using {shift down, command down} -- ⇧⌘A
            end tell
            set theText to the clipboard
        end tell
    end tell
    set TID to AppleScript's text item delimiters
    set AppleScript's text item delimiters to tab
    set theTextFields to text items of theText
    set AppleScript's text item delimiters to TID
    set {theDate, theLessonNo, theStudent} to {item 2, item 4, item 6} of theTextFields

  • How to read xml data in ajava file?

    Hi,
    I am very new to web servies. I am having a xml file, which has some data. I want to get tht data in my java class.How can I do tht? i would appreciate if anyone help me out.

    http://java.sun.com/webservices/docs/1.6/tutorial/doc/index.html

  • Load XML-data from large file into plain table

    We have to load data from an XML file to a relational table row by row.
    The structure of the data is very simple:
    <ROOT>
    <repReport>
    <KNZ>XY</KNZ>
    <LA>test123</LA>
    <Ident>AA20</Ident>
    </repReport>
    <repReport>
    </repReport>
    </ROOT>.
    The table econtains the fields KNZ, LA, Ident, ...
    If the file is small the following PL/SQL-code works fine:
    CREATE OR REPLACE PROCEDURE Loadxml_Epd AS
    fil BFILE ;
    len INTEGER;
    insrow INTEGER;
    ctxHdl NUMBER;
    buffer_c CLOB ;
    amt NUMBER := dbms_lob.lobmaxsize;
    src_offset NUMBER := 1 ;
    dst_offset NUMBER := 1 ;
    lang_ctx NUMBER := dbms_lob.default_lang_ctx;
    warning NUMBER;
    errNo NUMBER;
    errMsg VARCHAR2(1999);
    BEGIN
    fil := BFILENAME('XML_DIR','200412MKBReport.xml');
    DBMS_LOB.OPEN(fil, DBMS_LOB.LOB_READONLY);
    len := DBMS_LOB.GETLENGTH(fil);
    INSERT INTO INIT_CLOB(init) VALUES( EMPTY_CLOB())
    RETURNING init INTO buffer_c;
    dbms_lob.loadfromfile(buffer_c,fil, amt, dst_offset, src_offset);
    ctxHdl := dbms_xmlsave.newContext ('SST_XML_EPD');
    dbms_xmlsave.setRowTag (ctxHdl , 'repReport');
    dbms_xmlsave.SetIgnoreCase(ctxHdl , 1);
    dbms_xmlsave.SetSqlToXmlnameEscaping (ctxHdl , TRUE);
    dbms_xmlsave.propagateOriginalException(ctxHdl , TRUE);
    dbms_xmlsave.SetCommitBatch(ctxHdl , 1);
    dbms_xmlsave.SetBatchSize(ctxHdl , 1);
    insrow := DBMS_XMLSAVE.insertXML(ctxHdl,buffer_c);
    DBMS_OUTPUT.PUT_LINE('Anzahl Sätze:' || TO_CHAR(insrow,'999999999'));
    IF DBMS_LOB.ISOPEN(fil) = 1 THEN
    DBMS_LOB.CLOSE(fil);
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLCODE);
    errMsg := SQLERRM;
    DBMS_OUTPUT.PUT_LINE(SUBSTR(errMsg,1,2000));
    IF DBMS_LOB.ISOPEN(fil) = 1 THEN
    DBMS_LOB.CLOSE(fil);
    END IF;
    END;
    But if the file is larger (50 MB in our case) this does not work. In various documents we found that we have to use another sort of XML-parser but we did not find any example how this is really done.
    Does anybody have an example how to load this data that is as simple as our problem?

    We have to load data from an XML file to a relational table row by row.
    The structure of the data is very simple:
    <ROOT>
    <repReport>
    <KNZ>XY</KNZ>
    <LA>test123</LA>
    <Ident>AA20</Ident>
    </repReport>
    <repReport>
    </repReport>
    </ROOT>.
    The table econtains the fields KNZ, LA, Ident, ...
    If the file is small the following PL/SQL-code works fine:
    CREATE OR REPLACE PROCEDURE Loadxml_Epd AS
    fil BFILE ;
    len INTEGER;
    insrow INTEGER;
    ctxHdl NUMBER;
    buffer_c CLOB ;
    amt NUMBER := dbms_lob.lobmaxsize;
    src_offset NUMBER := 1 ;
    dst_offset NUMBER := 1 ;
    lang_ctx NUMBER := dbms_lob.default_lang_ctx;
    warning NUMBER;
    errNo NUMBER;
    errMsg VARCHAR2(1999);
    BEGIN
    fil := BFILENAME('XML_DIR','200412MKBReport.xml');
    DBMS_LOB.OPEN(fil, DBMS_LOB.LOB_READONLY);
    len := DBMS_LOB.GETLENGTH(fil);
    INSERT INTO INIT_CLOB(init) VALUES( EMPTY_CLOB())
    RETURNING init INTO buffer_c;
    dbms_lob.loadfromfile(buffer_c,fil, amt, dst_offset, src_offset);
    ctxHdl := dbms_xmlsave.newContext ('SST_XML_EPD');
    dbms_xmlsave.setRowTag (ctxHdl , 'repReport');
    dbms_xmlsave.SetIgnoreCase(ctxHdl , 1);
    dbms_xmlsave.SetSqlToXmlnameEscaping (ctxHdl , TRUE);
    dbms_xmlsave.propagateOriginalException(ctxHdl , TRUE);
    dbms_xmlsave.SetCommitBatch(ctxHdl , 1);
    dbms_xmlsave.SetBatchSize(ctxHdl , 1);
    insrow := DBMS_XMLSAVE.insertXML(ctxHdl,buffer_c);
    DBMS_OUTPUT.PUT_LINE('Anzahl Sätze:' || TO_CHAR(insrow,'999999999'));
    IF DBMS_LOB.ISOPEN(fil) = 1 THEN
    DBMS_LOB.CLOSE(fil);
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLCODE);
    errMsg := SQLERRM;
    DBMS_OUTPUT.PUT_LINE(SUBSTR(errMsg,1,2000));
    IF DBMS_LOB.ISOPEN(fil) = 1 THEN
    DBMS_LOB.CLOSE(fil);
    END IF;
    END;
    But if the file is larger (50 MB in our case) this does not work. In various documents we found that we have to use another sort of XML-parser but we did not find any example how this is really done.
    Does anybody have an example how to load this data that is as simple as our problem?

  • Problem splitting XML Data into multiple files

    I am sending an XML message through an enterprise message source in enterprise link design studio. While I do so, I am getting a heavy error. This error tells me that my path ist wrong, but I am sure this one is right. Actually everything worked fine till I added an attribute twice in my XML. Since this point enterprise link drives me crazy, I have checked on my XML, it is valid, I have checked on my path, which is also ok.
    Anyone some suggestions how to resolve the issue?
    The Error code looks the following:
    Unable to resolve path "/msg" in message field "host" XML.
    XML:
    <msg host="192.168.52.129:18342" app="[ZInvestigationProvider#null]" cat="PROCESS" id="org.sopware.services.exampleuri.impl.CepMessage.21" lvl="INFO" text="Investigation_POSSIBILITY BPEL_ID=330024 - ID=1002, RFID=RFID002, NAME=SSN Emmersberger, StartDate=10 CurrentDate=17, expectedShippingDate=13, currentZone=-1, deliveryTimeAgreement=true" tsp="2007-12-05T22:25:36.093Z" xmlns="http://schemas.sbb.org/management/Notification/1.0" />
    [Oracle BAM Enterprise Link error code:  0x75 -- 0x1, 0x75 -- 0x68]
    Error while processing the data for the step 'Oracle BAM Enterprise Message Receiver'
    [Oracle BAM Enterprise Link error code:  DC -- 0x1, DC -- 0x83]
    Error while processing the data for the step 'Oracle BAM Enterprise Message Receiver'
    [Oracle BAM Enterprise Link error code:  DC -- 0x1, DC -- 0x83]
    Unable to resolve path "/msg" in message field "host" XML.
    XML:
    <msg host="192.168.52.129:18342" app="[ZInvestigationProvider#null]" cat="PROCESS" id="org.sopware.services.exampleuri.impl.CepMessage.21" lvl="INFO" text="Investigation_POSSIBILITY BPEL_ID=330024 - ID=1002, RFID=RFID002, NAME=SSN Emmersberger, StartDate=10 CurrentDate=17, expectedShippingDate=13, currentZone=-1, deliveryTimeAgreement=true" tsp="2007-12-05T22:25:36.093Z" xmlns="http://schemas.sbb.org/management/Notification/1.0" />
    [Oracle BAM Enterprise Link error code:  0x75 -- 0x1, 0x75 -- 0x68]
    Error while processing the data for the step 'Oracle BAM Enterprise Message Receiver'
    [Oracle BAM Enterprise Link error code:  DC -- 0x1, DC -- 0x83]
    Update of Plan "NotificationPLAN" failed.
    [Oracle BAM Enterprise Link error code:  PlanMgr -- 0x1, PlanMgr -- 0xD5]
    Regards,
    Christoph

    Ok what I tried:
    - I restarted the BAM Server
    - I restarted the Design Studio
    - I restarted the oc4j through which I publish the messages through a topic
    Result:
    Unable to resolve path "/msg" in message field "Data" XML.
    XML:
    <msg host="192.168.52.129:18342" app="[ZInvestigationProvider#null]" cat="PROCESS" id="org.sopware.services.exampleuri.impl.CepMessage.21" lvl="INFO" text="Investigation_POSSIBILITY BPEL_ID=330024 - ID=1002, RFID=RFID002, NAME=SSN Emmersberger, StartDate=10 CurrentDate=17, expectedShippingDate=13, currentZone=-1, deliveryTimeAgreement=true" tsp="2007-12-05T22:25:36.093Z" xmlns="http://schemas.sbb.org/management/Notification/1.0" />
    [Oracle BAM Enterprise Link error code:  0x75 -- 0x1, 0x75 -- 0x68]
    Error while processing the data for the step 'Oracle BAM Enterprise Message Receiver'
    [Oracle BAM Enterprise Link error code:  DC -- 0x1, DC -- 0x83]
    Error while processing the data for the step 'Oracle BAM Enterprise Message Receiver'
    [Oracle BAM Enterprise Link error code:  DC -- 0x1, DC -- 0x83]
    Unable to resolve path "/msg" in message field "Data" XML.
    XML:
    <msg host="192.168.52.129:18342" app="[ZInvestigationProvider#null]" cat="PROCESS" id="org.sopware.services.exampleuri.impl.CepMessage.21" lvl="INFO" text="Investigation_POSSIBILITY BPEL_ID=330024 - ID=1002, RFID=RFID002, NAME=SSN Emmersberger, StartDate=10 CurrentDate=17, expectedShippingDate=13, currentZone=-1, deliveryTimeAgreement=true" tsp="2007-12-05T22:25:36.093Z" xmlns="http://schemas.sbb.org/management/Notification/1.0" />
    [Oracle BAM Enterprise Link error code:  0x75 -- 0x1, 0x75 -- 0x68]
    Error while processing the data for the step 'Oracle BAM Enterprise Message Receiver'
    [Oracle BAM Enterprise Link error code:  DC -- 0x1, DC -- 0x83]
    Update of Plan "NotificationPLAN" failed.
    [Oracle BAM Enterprise Link error code:  PlanMgr -- 0x1, PlanMgr -- 0xD5]

  • XML data in output file

    Hi,
    I am creating a RFC - File scenario and i want the output file in XML format. So I m using "File" in the message protocol of the receiver file.
    My  output file structure format is as below:
    <?xml version="1.0" encoding="UTF-8"?>
    *<ns1:MT_LEBIZ xmlns:ns1="http://lebiz">*
    <HEADER>
    <CODE>TOT</CODE>
    </HEADER>
    <DETAILS>
    <SEGMENT>
    <NUMBER>01</NUMBER>
    <LABEL>Account Assignment Cat</LABEL>
    </SEGMENT>
    <SEGMENT>
    <NUMBER>02</NUMBER>
    <LABEL>GL Account</LABEL>
    </SEGMENT
    </DETAILS>
    </ns1:MT_LEBIZ>
    but i wanted to display www3.org in the namespace in the following line which is marked in bold.
    <ns1:MT_LEBIZ xmlns:ns1="http://lebiz">
    how can i achieve that?

    Hi,
    By using the below code received from Peter, we are were able to remove the prefix, encoding and change the END_DATE format.
    Please find the code below:
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.io.Reader;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class DeletePrefixesEnddateAndEncoding extends AbstractTransformation {
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              // Add your code here
              String inData = convertStreamToString(in);
              String outdata = inData.replaceAll("ns1:", "");
              String outdata2 = outdata.replaceAll("xmlns:ns1=\"http://www.w3.org/2001/XMLSchema-instance\"", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
              String outdata3 = outdata2.replaceAll(" encoding=\"UTF-8\"?", "");
              String outdata4 = outdata3.replaceAll(" encoding=\"utf-8\"?", "");
              String outdata5 = outdata4.replaceAll("<END_DATE>0000-00-00</END_DATE>", "<END_DATE xsi:nil=\"true\" />");
              try {
                   // The JAVA mapping output payload is returned using the
                   // TransformationOutput class
                   // arg1.getOutputPayload().getOutputStream()
                   out.write(outdata5.getBytes("ISO-8859-1"));
              } catch (Exception exception1) {
         // Un comment to test the mapping as a standalone code
         /* public static void main(String[] args) {
         *      try {
         *          InputStream in = new FileInputStream(new File("D:/PETER/in.xml"));
         *          OutputStream out = new FileOutputStream(new File("D:/PETER/out.xml"));
         *          DeletePrefixesEnddateAndEncoding myMapping = new DeletePrefixesEnddateAndEncoding(); myMapping.execute(in, out); }
         *      catch (Exception e) { e.printStackTrace();
                                       public void transform(TransformationInput arg0, TransformationOutput arg1)
                   throws StreamTransformationException {
              getTrace().addInfo("JAVA Mapping Called");
              this.execute(arg0.getInputPayload().getInputStream(), arg1
                        .getOutputPayload().getOutputStream());
         public String convertStreamToString(InputStream in) {
              StringBuffer sb = new StringBuffer();
              try {
                   InputStreamReader isr = new InputStreamReader(in);
                   Reader reader = new BufferedReader(isr);
                   int ch;
                   while ((ch = in.read()) > -1) {
                        sb.append((char) ch);
                   reader.close();
              } catch (Exception exception) {
              return sb.toString();

  • Storing XML data in CLOB and relational tables

    I would like to ask whether there is a possibility to store XML data using normal relational tables and CLOBs in the same time. For example I have some XML data (structured data) which I would like update very often and some which are only a kind of description. I found something about it in http://technet.oracle.com/tech/xml/infoocs/otnwp/about_oracle_xml_products.htm . But I do not know how to use Oracle8i views and some functionality of XML SQL Utility to retrieve XML data in one file.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Maciej Marczukajtis ([email protected]):
    I would like to ask whether there is a possibility to store XML data using normal relational tables and CLOBs in the same time. For example I have some XML data (structured data) which I would like update very often and some which are only a kind of description. I found something about it in http://technet.oracle.com/tech/xml/infoocs/otnwp/about_oracle_xml_products.htm . But I do not know how to use Oracle8i views and some functionality of XML SQL Utility to retrieve XML data in one file.<HR></BLOCKQUOTE>
    Czesc Maciek,
    There are some good examples with XSQL Servlet. From what I understand you have one XML file and you need to save a portion of document in relational tables and other portion in CLOB.
    Yes, you can do that.
    You can do it many ways. I can suggest (2).
    1. Use the views
    2. call your java procedure that will do
    the xml processing, brake it down and insert
    releval frogments into different tables/columns
    null

  • Returning XML Data from a database

    Ok, just got the new DW CS3 and really want to begin using
    the built in Spry capabilitites. All of the examples I've seen for
    populating the datasets with XML data are based on referencing a
    static XML file. I want to query my database and return XML data to
    a Spry Table. How do I accomplish this? I know how to perform the
    query and retrun the data in an XML format (ColdFusion) but I can't
    tell the spry dataset to use this. HELP!!

    Well, that's the trick... I can't point to a testing server
    (i.e. Application interface) because we aren't permitted to have
    the RDS login where I work. (They haven't bothered to configure the
    CF server for restricting access) I have to manually create all
    connections and queries. I'm currenlty using the exact format in
    the example page you provided to return the data in an XML format
    but when I point to that file as my datasource I get nothing
    displayed on the page. The file that performs the query and returns
    the data is in a separate file from the one I'm trying to use the
    Spry table in. When I use this same query file for an Ajax call to,
    say, populate a listbox or pulldown menu it works fine, but I can't
    get it to work with the Spry dataset.

  • Bringing xml data into flash

    I would like to know how to bring xml data into flash.
    Specifically images that someone can click on the thumbnail and
    view the larger image. please can anyone point me to some tutorials
    or sites that i can start to learn how to do this.
    thanks.

    Hi
    First of all, read every thing you can in Flash Help to get
    to know the different methods of loading XML.
    XML can be loaded with 'built-in' components or parsed in
    Actionscript, the Help files will explain both.
    Next - Google for 'XML Image or Picture Gallery' you'll find
    plenty
    Hope it helps

Maybe you are looking for

  • Why is it that when I put my movie from iMovie on the desktop it gets shaky?

    I made a movie on iMovie that is clear and not shaky. However, when I try to download the movie to the desktop, the whole movie is shaky. It is shaky when downloading with QuickTime and when I try to "Export Movie." I use iMovie '09, version 8.0.6. D

  • Is there a way to get an iPod touch to play one audio track and stop.

    Is there a way to get an iPad to play one audio track and stop. I work in education and particularly music. Teachers are looking to create a playlist of selected track but only want the selected track to play then stop. This allows them to talk to th

  • Problem with Color Print in Illustrator. Photoshop fine. Epson R2400

    OK.. I've spent all morning trying to troubleshoot bad color on Illustrator CS4 to Epson R2400 and can't find a solution. Mac  10.5.8 I'm getting off color (but a neutral grayscale) when printing to from AI 14.0 to Epson Stylus Photo R2400. This just

  • Burning list label

    My label is printing out of burning order when i have go to print after the cd has burnt. I can print it in order in the burning playlist but it throws it into alphabetical list in completion of disc does anyone know how to fix this and where i go to

  • Event scripting issues

    I am trying to get the following script working as a startup script. the goal is that when the user chooses to save the document, they are presented with a dialog box asking for a quick summary of the edits that were made. Then this info is written t