Input XML Format needs to be Translated Into CSV String Format

Hi,
I need to translate input xml format to CSV string format in BPEL.
How to use xpath function to do this?
Thanks

1. In the partner link of the file adapter you can run the wizard and create a XSD according to your CSV format.
(you just need to create an example of CSV)
The wizard will create a XSD automatically.
2. Assign an invoke activity to that partner link.
3. Use transformation to pass data from your XML input into the invoke variable.
Arik

Similar Messages

  • Sender Idoc needs to be translated into 4 text files

    Hi,
    Could you please guide me how can i achieve this.
    Within XI this Idoc message needs to be translated into 4 text files:
    Could you pls. confirm as...can i use MultiMapping or shall i go for BPM?
    Thanks & Regards,
    Y.Raj.

    Should also work in your case:
    1. Create your mapping program that will map the information from the source file
    into the destination idoc. This has to be a 1:N split. Just make sure that the destination message type and message interface are are of occurrence N.
    2. Also, you will have 2 destination interfaces and 2 interface mapping, one for the IDOC and one for the mail.
    Now, there are a few essential steps in your configuration,
    1. In the receiver determination, specify the 2 receiver systems, one for your IDOC and the other for your MAIL.
    2. Now, you will have a condition window. Just type the condition on the basis of which the receiver has to be determined for the mail and the idoc business system. Just remember that the condition can be specified only for the source message.
    3. In the Interface Determination, you have an option called RB CLASSIC and RB SPLIT. To do a 1:N split, you will have to do a RB_SPLIT.
    You can even use xslt mapping to split source message type into multiple target messages types.for more information on the same check this link:
    http://help.sap.com/saphelp_erp2005/helpdata/en/83/2200cb50d345c793336d9a1683163e/frameset.htm

  • I need this javascript translated into java basically. any help?

    basically i need to write a program in java that translates english sentence into pirate talk..yeah yeah i know its not original but here is what i need done but its in javascript and i need it written in java:
      <script LANGUAGE="JavaScript">
        PHRASES = [["hello", "ahoy"], ["hi", "yo-ho-ho"], ["pardon me", "avast"],
                   ["excuse me", "arrr"], ["yes", "aye"],
                   ["my", "me"], ["friend", "me bucko"], ["sir", "matey"],
                   ["madam", "proud beauty"], ["miss", "comely wench"],
                   ["stranger", "scurvy dog"], ["officer", "foul blaggart"],
                   ["where", "whar"], ["is", "be"], ["are", "be"], ["am", "be"],
                   ["the", "th'"], ["you", "ye"], ["your", "yer"],
                   ["tell", "be tellin'"], ["know", "be knowin'"],
                   ["how far", "how many leagues"], ["old", "barnacle-covered"],
                   ["attractive", "comely"], ["happy", "grog-filled"], ["quickly", "smartly"],
                   ["nearby", "broadside"], ["restroom", "head"], ["restaurant", "galley"],
                   ["hotel", "fleabag inn"], ["pub", "Skull & Scuppers"], ["mall", "market"],
                   ["bank", "buried treasure"], ["die", "visit Davey Jones' Locker"],
                   ["died", "visited Davey Jones' Locker"], ["kill", "keel-haul"],
                   ["killed", "keel-hauled"], ["sleep", "take a caulk"],
                   ["stupid", "addled"], ["after", "aft"], ["stop", "belay"],
                   ["nonsense", "bilge"], ["officer", "bosun"], ["ocean", "briny deep"],
                   ["song", "shanty"], ["money", "doubloons"], ["food", "grub"],
                   ["nose", "prow"], ["leave", "weigh anchor"], ["cheat", "hornswaggle"],
                   ["forward", "fore"], ["child", "sprog"], ["children", "sprogs"],
                   ["sailor", "swab"], ["lean", "careen"], ["find", "come across"],
                   ["mother", "dear ol' mum, bless her black soul"],
                   ["drink", "barrel o' rum"], ["of", "o'"]
        function Capitalize(str)
        // Returns: a copy of str with the first letter capitalized
            return str.charAt(0).toUpperCase() + str.substring(1);
        function Translate(text)
        // Returns: a copy of text with English phrases replaced by piratey equivalemts
            for (var i = 0; i < PHRASES.length; i++) {
                var toReplace = new RegExp("\\b"+PHRASES[0]+"\\b", "i");
    var index = text.search(toReplace);
    while (index != -1) {
    if (text.charAt(index) >= "A" && text.charAt(index) <= "Z") {
    text = text.replace(toReplace, Capitalize(PHRASES[i][1]));
    else {
    text = text.replace(toReplace, PHRASES[i][1]);
    index = text.search(toReplace);
    return text;
    </script>
    does anyone have any input on how i should go about this? im decent in java but nothing special. thanks

    how do you get the word from the map?
    basically if i understand overall goal: im going to
    loop through the text given to me and check to see if
    any of the words match my hashmap...if it does then i
    replace the word with my word in hashmap and output
    the new result. correct
    >
    if thats correct, well then atleast i understand it.
    i think i could come up with loop to search but i
    have no idea how to compare each word with my map and
    then replace if necessary
    String replacementWord = map.get(word);
    if (replacementWord != null) {
       // Word was found and should be replaced with replacementWord
    }Kaj

  • How can I convert IDoc in XML format w/DTD into a string?

    I want to send by e-mail outbound IDoc in XML format with its document type definition (DTD).
    I want to be able to get the same output result into a string than the XML file IDoc port type with DTD activated.  I have created a FM (based on SAP "OWN_FUNCTION") assigned to an IDoc port of type ABAP-PI that executes the following processing steps:
    1-Extract outbound IDoc information to get the sender & recipient mail addresses (EDP13 / EDIPHONE tables).
    2-Convert & Transform IDoc data into XML string using FM IDX_IDOC_TO_XML.
    3-Prepare and send e-mail with XML attachement using FM SO_NEW_DOCUMENT_ATT_SEND_API1.
    I cand generate the e-mail with the XML file attachement but FM IDX_IDOC_TO_XML does not convert the IDoc with proper formating and DTD.
    What should I use to accomplish the IDoc conversion to XML w/DTD into a string?
    Should I use XSLT tools ?
    How does that work?
    Thank you
    Carl

    muks wrote:
    Use decimal string to number
    Specifically, you can define a constant with a different datatype on the input on the lower left if you need a different datatype (e.g. U8, I64, DBL, etc) Are all your values integers or do you also need to scan fractional numbers? In this case, you should use "fract/exp string to number" instead.
    LabVIEW Champion . Do more with less code and in less time .

  • How could I export FCE project into XML format?

    Hello,
    I recently decided to upgrade from Final Cut Express to Final Cut Pro X. But I don't seem to be able to export my FCE unfinish projects. That is because FCE  does not export into XML format !!!
    Does anyone knows how to have FCE to generate a XML file? Or to have the FCP file format converted into a XML file format?
    Thanks

    If you are editing in FCE4, then you can open your FCE Project in FCP6 or FCP7 and do the .xml export there. Once you have that .xml file, you need to use the software 7toX to convert the file to FCP-X.
    http://assistedediting.intelligentassistance.com/7toX/
    It should be noted that the conversion of a sequence file to .xml and then .xml to FCP-X may not pass 100% of the information.
    There is information about what is and is not translated here:
    http://assistedediting.intelligentassistance.com/7toX/about.html
    MtD

  • Convert gzip files into XML format

    We have a requirement where we receive gzip files. These files are zipped file containing base64 binary format csv files. We would have to convert these files into XML format. Please let me know any of the following.
    1. Is there any Xpath query or XSL function (somthing similar like doTranslateFromNative() ) to convert from gzip files to XML format.
    2. If we need to unzip the zipfile outside fusion, then java code piece to unzip the gzip file. I guess after that we can use the usual doTranslateFromNative() function to translate to XML format, since after unzipping the gzip file, they are base64 binary formats.
    Thanks in advance,
    Toms

    There is an option to do pre-processing and post processing of Files when using File adapter. You need to create a valve which will first do pre processing and send the output to FileAdapter.
    You can get more information here:
    http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm#CACDHGGG
    under section: 4.2.14 Pre-Processing and Post-Processing of Files
    Essentially you will use Java to unzip the file first and then the unzipped content will be passed to the adapter.

  • How to use an .xsl file to transform input XML to re-formatted output XML?

    Hello,
    I have a .xml file from a report that I want to use a stylesheet to transform into a different .xml format.
    I am reading that I can create a .xsl file to read my input and then transform it to a new output .xml file.
    How do I load this into the Apps?
    I tried creating a template definition and loading the .xsl in as type 'XSL-TEXT' and also, I added
    <?xml-stylesheet type="text/xsl" href="Transform.xsl"?> to my xml data source. The output looked the same as the input.
    Has anyone done this before? Any suggestions would be great!
    Thanks
    -CC

    This is how I use e4x with HTTPService:
    import mx.collections.XMLListCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable] private var claimsXLC:XMLListCollection;
    private function claimsHandler(evt:ResultEvent):void{
        claimsXLC = new XMLListCollection(evt.result..claim as XMLList);
    XML data is being returned, but I use XMLList to create the XMLListCollection.
    If this post answers your question or helps, please mark it as such.

  • Need the output of a query in given XML format

    I have a table as
    create table t_cases (case_id number, pros_seq number, case_lname varchar2(100),
    day_phone number, night_phone number, intl_phone number);
    where case_id and pros_seq is the compound primary key.
    The insert script to insert the data in the table is
    insert into t_cases values(1, 1, 'test', 12, 23, 34);
    insert into t_cases values(1, 2, 'test', 56, 67, 78);
    commit;
    Now from this table I need to query and fetch the data in the following xml format.
    &lt;case REPEATINGTYPE="PageList"&gt;
    &lt;rowdata REPEATINGINDEX="1"&gt;
    &lt;caseid&gt;1&lt;/caseid&gt;
    &lt;prosseq&gt;1&lt;/prosseq&gt;
    &lt;PhoneNumbers REPEATINGTYPE="PageList"&gt;
    &lt;rowdata REPEATINGINDEX="1"&gt;
    &lt;CountryCode&gt;12&lt;/CountryCode&gt;
    &lt;Type&gt;Day&lt;/Type&gt;
    &lt;/rowdata&gt;
    &lt;rowdata REPEATINGINDEX="2"&gt;
    &lt;CountryCode&gt;23&lt;/CountryCode&gt;
    &lt;Type&gt;Night&lt;/Type&gt;
    &lt;/rowdata&gt;
    &lt;rowdata REPEATINGINDEX="3"&gt;
    &lt;CountryCode&gt;34&lt;/CountryCode&gt;
    &lt;Type&gt;International&lt;/Type&gt;
    &lt;/rowdata&gt;
    &lt;/PhoneNumbers&gt;
    &lt;/rowdata&gt;
    &lt;rowdata REPEATINGINDEX="2"&gt;
    &lt;caseid&gt;1&lt;/caseid&gt;
    &lt;prosseq&gt;2&lt;/prosseq&gt;
    &lt;PhoneNumbers REPEATINGTYPE="PageList"&gt;
    &lt;rowdata REPEATINGINDEX="1"&gt;
    &lt;CountryCode&gt;56&lt;/CountryCode&gt;
    &lt;Type&gt;Day&lt;/Type&gt;
    &lt;/rowdata&gt;
    &lt;rowdata REPEATINGINDEX="2"&gt;
    &lt;CountryCode&gt;67&lt;/CountryCode&gt;
    &lt;Type&gt;Night&lt;/Type&gt;
    &lt;/rowdata&gt;
    &lt;rowdata REPEATINGINDEX="3"&gt;
    &lt;CountryCode&gt;78&lt;/CountryCode&gt;
    &lt;Type&gt;International&lt;/Type&gt;
    &lt;/rowdata&gt;
    &lt;/PhoneNumbers&gt;
    &lt;/rowdata&gt;
    &lt;/case&gt;
    Please let me know how to do this.

    Like this...
    select XMLELEMENT( "case", XMLATTRIBUTES ('PageList' as "RepeatingType")
                     ,xmlagg(
                              xmlelement("rowdata", xmlattributes(pros_seq as "RepeatingIndex")
                                        ,xmlelement("caseid", case_id)
                                        ,xmlelement("prosseq", pros_seq)
                                        ,xmlelement("PhoneNumbers", xmlattributes('PageList' as "RepeatingType")
                                                   ,xmlelement("rowdata", xmlattributes(1 as "RepeatingIndex")
                                                              ,xmlelement("CountryCode", day_phone)
                                                              ,xmlelement("Type", 'Day')
                                                   ,xmlelement("rowdata", xmlattributes(2 as "RepeatingIndex")
                                                              ,xmlelement("CountryCode", night_phone)
                                                              ,xmlelement("Type", 'Night')
                                                   ,xmlelement("rowdata", xmlattributes(3 as "RepeatingIndex")
                                                              ,xmlelement("CountryCode", intl_phone)
                                                              ,xmlelement("Type", 'International')
            as x
    from t_cases

  • Need output of a query in given xml format.

    I have a table as
    create table t_cases (case_id number, pros_seq number, case_lname varchar2(100),
    day_phone number, night_phone number, intl_phone number);
    where case_id and pros_seq is the compound primary key.
    The insert script to insert the data in the table is
    insert into t_cases values(1, 1, 'test', 12, 23, 34);
    insert into t_cases values(1, 2, 'test', 56, 67, 78);
    commit;
    Now from this table I need to query and fetch the data in the following xml format.
    <case REPEATINGTYPE="PageList">
         <rowdata REPEATINGINDEX="1">
              <caseid>1</caseid>
              <prosseq>1</prosseq>
              <PhoneNumbers REPEATINGTYPE="PageList">
              <rowdata REPEATINGINDEX="1">
                   <CountryCode>12</CountryCode>
                   <Type>Day</Type>
              </rowdata>
              <rowdata REPEATINGINDEX="2">
                   <CountryCode>23</CountryCode>
                   <Type>Night</Type>
              </rowdata>
              <rowdata REPEATINGINDEX="3">
                   <CountryCode>34</CountryCode>
                   <Type>International</Type>
              </rowdata>
              </PhoneNumbers>
         </rowdata>
         <rowdata REPEATINGINDEX="2">
              <caseid>1</caseid>
              <prosseq>2</prosseq>
              <PhoneNumbers REPEATINGTYPE="PageList">
              <rowdata REPEATINGINDEX="1">
                   <CountryCode>56</CountryCode>
                   <Type>Day</Type>
              </rowdata>
              <rowdata REPEATINGINDEX="2">
                   <CountryCode>67</CountryCode>
                   <Type>Night</Type>
              </rowdata>
              <rowdata REPEATINGINDEX="3">
                   <CountryCode>78</CountryCode>
                   <Type>International</Type>
              </rowdata>
              </PhoneNumbers>
         </rowdata>
    </case>
    Please let me know how to do this.

    Like this...
    select XMLELEMENT( "case", XMLATTRIBUTES ('PageList' as "RepeatingType")
                     ,xmlagg(
                              xmlelement("rowdata", xmlattributes(pros_seq as "RepeatingIndex")
                                        ,xmlelement("caseid", case_id)
                                        ,xmlelement("prosseq", pros_seq)
                                        ,xmlelement("PhoneNumbers", xmlattributes('PageList' as "RepeatingType")
                                                   ,xmlelement("rowdata", xmlattributes(1 as "RepeatingIndex")
                                                              ,xmlelement("CountryCode", day_phone)
                                                              ,xmlelement("Type", 'Day')
                                                   ,xmlelement("rowdata", xmlattributes(2 as "RepeatingIndex")
                                                              ,xmlelement("CountryCode", night_phone)
                                                              ,xmlelement("Type", 'Night')
                                                   ,xmlelement("rowdata", xmlattributes(3 as "RepeatingIndex")
                                                              ,xmlelement("CountryCode", intl_phone)
                                                              ,xmlelement("Type", 'International')
            as x
    from t_cases

  • Help on writing pl/sql stored procedure to accept input in xml format

    Hi All,
    I need to write a pl.sql stored procedure which would be getting the input as an xml.
    The requirement is that xml data recieved in below fashion needs to be inserted to 3 different tables.
    The tags under the root node directly needs to be inserted into Table1
    The tags under the first element of the root node needs to be inserted into Table2
    Can anybody help me on how to write a stored procedure which could take up the below xml as input and insert the data received into 3 different tables.
    Any sample code.pointers to achieve this could be of great help.
    The structure of the xml would be as follows:
    <AssemblyProduct>
    <AssemblyHeader>
    <Name></Name>
    <AssemblyId></AssemblyId>
    <ListOfHCSIFFs><HCSIFFHeader><Id></Id> </HCSIFFHeader> </ListOfHCSIFFs>
    <ListOfHCSIFFs><HCSIFFHeader><Id></Id> </HCSIFFHeader> </ListOfHCSIFFs>
    <ListOfHCSIFFs><HCSIFFHeader><Id></Id> </HCSIFFHeader> </ListOfHCSIFFs>
    </AssemblyHeader>
    <AssemblyHeader>
    <Name></Name>
    <AssemblyId></AssemblyId>
    </AssemblyHeader>
    <AssemblyHeader></AssemblyHeader>
    <ApplicationId></ApplicationId>
    <ApplicationName></ApplicationName>
    <ApplicationValidFrom></ApplicationValidFrom>
    <ApplicationValidTo></ApplicationValidTo>
    </AssemblyProduct>

    Well you could write your procedure to accept a parameter of XMLTYPE datatype and then use that value in a query inside the procedure to break the data up as required using something like XMLTABLE e.g.
    -- Nested repeating groups example:
    WITH t as (select XMLTYPE('
    <RECSET>
      <REC>
        <COUNTRY>1</COUNTRY>
        <POINT>1800</POINT>
        <USER_INFO>
          <USER_ID>1</USER_ID>
          <TARGET>28</TARGET>
          <STATE>6</STATE>
          <TASK>12</TASK>
        </USER_INFO>
        <USER_INFO>
          <USER_ID>5</USER_ID>
          <TARGET>19</TARGET>
          <STATE>1</STATE>
          <TASK>90</TASK>
        </USER_INFO>
      </REC>
      <REC>
        <COUNTRY>2</COUNTRY>
        <POINT>2400</POINT>
        <USER_INFO>
          <USER_ID>3</USER_ID>
          <TARGET>14</TARGET>
          <STATE>7</STATE>
          <TASK>5</TASK>
        </USER_INFO>
      </REC>
    </RECSET>') as xml from dual)
    -- END OF TEST DATA
    select x.country, x.point, y.user_id, y.target, y.state, y.task
    from t
        ,XMLTABLE('/RECSET/REC'
                  PASSING t.xml
                  COLUMNS country NUMBER PATH '/REC/COUNTRY'
                         ,point   NUMBER PATH '/REC/POINT'
                         ,user_info XMLTYPE PATH '/REC/*'
                 ) x
        ,XMLTABLE('/USER_INFO'
                  PASSING x.user_info
                  COLUMNS user_id NUMBER PATH '/USER_INFO/USER_ID'
                         ,target  NUMBER PATH '/USER_INFO/TARGET'
                         ,state   NUMBER PATH '/USER_INFO/STATE'
                         ,task    NUMBER PATH '/USER_INFO/TASK'
                 ) y
       COUNTRY      POINT    USER_ID     TARGET      STATE       TASK
             1       1800          1         28          6         12
             1       1800          5         19          1         90
             2       2400          3         14          7          5And then you can extract and insert whatever parts you want into whatever tables as part of the procedure.

  • Mapping complete input XML structure into one field on target

    Hi,
    I have a scenario where I need to map the complete input XML structure as it is, into one field on target side. so can we achieve this in Graphical Mapping? If yes, please share your valuable info.
    Regards,
    Shiva.

    Hello,
    this is the java map code.just compile it and made a .zip file import it and use it Interface Mapping.
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.Map;
    import java.io.*;
    public class PayloadToXMLField1 implements StreamTransformation {
        String strXML = new String();
       //Declare the XML tag for your XML message
       String StartXMLTag = "<DocumentBody>";
       String EndXMLTag = "</DocumentBody>";
       //String StartXMLTag1 = "<Code>";
       //String EndXMLTag1 = "</Code>";
        AbstractTrace trace;
        private Map param = null;
        public void setParameter(Map param) {
            this.param = param;
        public void execute(InputStream in, OutputStream out) {
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
            trace.addInfo("Process Started");
            try {
                StringBuffer strbuffer = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n;(n = in.read(b)) != -1;) {
                    strbuffer.append(new String(b, 0, n));
                strXML = strbuffer.toString();
            } catch (Exception e) {
                System.out.println("Exception Occurred");
            String outputPayload =
                StartXMLTag
             + "<![CDATA["
             + strXML
             + "]]>"
             + EndXMLTag;
            try {
                out.write(outputPayload.getBytes());
             trace.addInfo("Process Completed");;
            } catch (Exception e) {
                trace.addInfo("Process Terminated: Error in writing out payload");;

  • Output of RFC needs to be converted into PDF format

    Hi Experts,
    In the ESS screen, we have to provide one link for every employee. When the user will click on the link, one letter in PDF format should be displayed to the user. This PDF will act as a "Address Certificate". The address certificate will contain information related with name, address, passport details etc. How we can achieve this?
    In my view, we will have to create one Z-RFC. The ABAPer will create the Z-RFC. Now the input for the Z RFC will be employee no. The output will be Name, Address and Passport details.
    The information provided in table format needs to be converted into PDF form. How we can do so? What all services needs to be activated for this?
    Regards,
    Gary

    Hi Gary,
    When you say the ESS screen, what do you mean by this is it ECC side or in Portal Side.
    It its in Portal side then, I think you need to create a WebDynpro application which display output through ADOBE forms. For that you need to have basic WebDynpro knowledge.
    Apart from that ADS needs to be configured. There are sevrel tutorial available in SDN. For creating a WebDynpro Application with Adobe Interactive forms.
    Do let me know if you require more information.
    Regards,

  • Converting Javabeans into XML format

    HI,
    I have wrote program that will read input from users then stored them in javabeans. I used the serialize function to create xml file from the javabeans.
    public static void CreateXML(LocationRequest location)
              try
         // Serialize object into XML
         XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
    new FileOutputStream("test.xml")));
         encoder.writeObject(location);
         encoder.close();
         } catch (FileNotFoundException e) {
    The output file is as follows :
    <?xml version="1.0" encoding="UTF-8"?>
    <java version="1.4.1_05" class="java.beans.XMLDecoder">
    <object >
    <void property="address">
    <string>21212122</string>
    </void>
    <void property="originatorId">
    <string>Anu</string>
    </void>
    </object>
    </java>
    Could anyone has idea on how i can change the above xml file into another new xml format like below:-
    <address> 21212122</address>
    <originatorId> "Anu "</originatorId>
    Cheers,
    Bambli

    The quickest way would be to use XSLT. Write a stylesheet that converts your 1st format to your 2nd format.
    Here's an example stylesheet. (I'm a little rusty on my XSL so you'll want to test this.)
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" encoding="UTF-8"/>
      <!-- simply copy the message to the result tree -->
      <xsl:template match="/java/object/void/@property">
        <xsl:element name="local-name()">
          <xsl:value-of select="text()"/>
        </xsl:element>
      </xsl:template>
    </xsl:stylesheet> Feed this to a transformer as follows:
    javax.xml.transform.TranformFacotry factory = javax.xml.transform.TransformerFactory.newInstance();
    javax.xml.transform.stream.StreamSource source = new javax.xml.transform.stream.StreamSource(new java.io.File("yourstylesheet.xsl"));
    javax.xml.transform.Transformer xformer =factory.newTransformer(source);
    xformer.transform(new javax.xml.transform.stream.StreamSource(new java.io.File("yourbean.xml")),new javax.xml.transform.stream.StreamResult(new java.io.File("yourconverted.xml")));Its that simple.
    Cliff

  • How to store xml data into file in xml format through java program?

    HI Friends,
    Please let me know
    How to store xml data into file in xml format through java program?
    thanks......
    can discuss further at messenger.....
    Avanish Kumar Singh
    Software Engineer,
    Samsung India Development Center,
    Bangalore--560001.
    [email protected]

    Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
    i got a piece of code from the net which allows me to parse th file:
    import java.io.IOException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import org.apache.xerces.parsers.SAXParser;
    import java.lang.*;
    public class MySaxParser extends DefaultHandler
    private static int INDENT = 4;
    private static String attList = "";
    public static void main(String[] argv)
    if (argv.length != 1)
    System.out.println("Usage: java MySaxParser [URI]");
    System.exit(0);
    String uri = argv[0];
    try
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    MySaxParser MySaxParserInstance = new MySaxParser();
    parser.setContentHandler(MySaxParserInstance);
    parser.parse(uri);
    catch(IOException ioe)
    ioe.printStackTrace();
    catch(SAXException saxe)
    saxe.printStackTrace();
    private int idx = 0;
    public void characters(char[] ch, int start, int length)
    throws SAXException
    String s = new String(ch, start, length);
    if (ch[0] == '\n')
    return;
    System.out.println(getIndent() + " Value: " + s);
    public void endDocument() throws SAXException
    idx -= INDENT;
    public void endElement(String uri, String localName, String qName) throws SAXException
    if (!attList.equals(""))
    System.out.println(getIndent() + " Attributes: " + attList);
    attList = "";
    System.out.println(getIndent() + "end document");
    idx -= INDENT;
    public void startDocument() throws SAXException
    idx += INDENT;
    public void startElement(String uri,
    String localName,
    String qName,
    Attributes attributes) throws SAXException
    idx += INDENT;
    System.out.println('\n' + getIndent() + "start element: " + localName);
    if (localName.compareTo("Machine") == 0)
    System.out.println("YES");
    if (attributes.getLength() > 0)
    idx += INDENT;
    for (int i = 0; i < attributes.getLength(); i++)
    attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
    if (i < (attributes.getLength() - 1))
    attList = attList + ", ";
    idx-= INDENT;
    private String getIndent()
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < idx; i++)
    sb.append(" ");
    return sb.toString();
    }// END PRGM
    Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
    The next step is to write the data to the DB.
    Am sending an example of my file:
    <Start>
    <Machine>
    <Hostname> IPCServer </Hostname>
    <HostID> 80c04499 </HostID>
    <MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
    <CPU> UltraSPARC-IIi at 360 MHz </CPU>
    <Memory> RAM : 512 MB </Memory>
    <HostAdapter>
    <HA> kern.info] </HA>
    </HostAdapter>
    <Harddisks>
    <HD>
    <HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
    <HD2> ST38420A 8.2 GB </HD2>
    </HD>
    </Harddisks>
    <GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
    <NetworkType> hme0 : Fast-Ethernet </NetworkType>
    <EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
    <IPAddress> 149.51.23.140 </IPAddress>
    </Machine>
    </Start>
    Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
    Cal u tellme what to do!
    Even better- do u have a piece of code that will help me understand and implement the database writing portion?
    I badly need help here.
    THANX

  • OWB11gR2 - simple and easy way to load XML formatted data into db tables?

    Hi,
    we're currently trying to load table data stored in XML files into our datawarehouse using OWB 11gR2.
    However, we're finding this is not quite as trivial as loading flat files...
    Most postings on this forum points to the blog-entry title "Leveraging XDB" found here (http://blogs.oracle.com/warehousebuilder/2007/09/leveraging_xdb.html).
    This blog also references the zip-file owb_xml_etl_utils.zip, which seems to have disappeared from it's original location and can now be found on sourceforge.
    Anyway, the solution described is for OWB 10g, and when trying to import experts from the zip-file etc. we end up not being able to run the "Create ETL from XSD" expert, as the 11gR2 client is different from the 10g and does not have the Experts menu et.al.
    Also, this solution was published over 3 years ago, and it seems rather strange that importing XML-formatted data should still be so cumbersome in the newer warehouse builder releases.
    The OWB 11gR2 documentation is very sparse (or rather - quite empty) on how to load XML data, all it has is a few lines on "XML Transformations", giving no clue as to how one goes about loading data.
    Is this really the state of things? Or are we missing some vital information here?
    We'd have thought that with 11g-releases, loading XML-data would be rather simple, quick and painless?
    Is there somewhere besides the blog mentioned above where we can find simple and to the point guidelines for OWB 11gR2 on how to load XML-formatted data into Oracle tables?
    Regards,
    -Haakon-

    Yes it is possible to use SQL*Loader to parse and load XML, but that is not what it was designed for and so is not recommended. You also don't need to register a schema, just to load/store/parse XML in the DB either.
    So where does that leave you?
    Some options
    {thread:id=410714} (see page 2)
    {thread:id=1090681}
    {thread:id=1070213}
    Those talk some about storage options and reading in XML from disk and parsing XML. They should also give you options to consider. Without knowing more about your requirements for the effort, it is difficult to give specific advice. Maybe your 7-8 tables don't exist and so using Object Relational Storage for the XML would be the best solution as you can query/update tables that Oracle creates based off the schema associated to the XML. Maybe an External Table definition works better for reading the XML into the system because this process will happen just once. Maybe using WebDAV makes more sense for loading XML to be parsed (I don't have much experience with this, just know it is possible from what I've read on the forums). Also, your version makes a difference as you have different options available depending upon the version of Oracle.
    Hope all that helps as a starter.
    Edited by: A_Non on Jul 8, 2010 4:31 PM
    A great example, see the answers by mdrake in {thread:id=1096784}

Maybe you are looking for

  • IMac no longer sees network or gets very weak connection

    Here's the deal: I have an iMac that was purchased in 2010. I have used it in an office connecting through a network router using the iMac's airport capabilities. The connection had been good for over a year. Airport would show four full bars every d

  • Windows 8.1 update and brightness control

    I have a DELL XPS L521X with Windows 8.1 (I had windows 8 some days ago) and I have had two problems: 1) I did not allow Windows to upgrade to 8.1 and it forced me to do it. It gave me 15 minutes to save progress and do it. I was watching the NBA fin

  • If there is an alternative

    I have a report which has a condition: bring me the records which have quantity > 100 ( for example ) or whatever you tell it to do Inside the report (rdf) the field "quantity" has as a source a placeholder (cp_qty), which takes value from a formula

  • Error 8012 when trying to download application from app store

    Just tried to pick up geodefense swarm from the app store. It says error 8012 under the status column in downloads and it tells me to go to the store menu and hit check for downloads. I have tried this and other various methods to restart the downloa

  • LXDE panel menu does not display in regular user mode

    Hello All, Running arch on eeepc 1000HE.  Running openbox with lxde.  The menu on the panel does not display when in a regular user mode, but does display when in su mode.  The button for the menu displays but when pressed the menu is blank.  It seem