Read  an XML file and send it to client

Hi,
I'm introducing to servlet development and I'm trying to do some AJAX calls. The client side is implemented, but I have some troubles on the server side. I want to open an XML file and send it to the client. How can I do that? Any special header?
I have implemented this test in PHP, so you can imagine what I would like to do:
if ($type == "xml"){
     $xml = "";
     $file = fopen ("file.xml", "r");
     while (!feof ($file)){
          $xml .= fgets ($file, 4096);
     fclose ($file);
     header ("Content-type: text/xml; charset=ISO-8859-1");
     echo $xml;
}The XML file is:
<?xml version='1.0' encoding='ISO-8859-1'?>
<users>
     <user>
          <name>Pepe</name>
          <age>18</age>
     </user>
     <user>
          <name>María</name>
          <age>21</age>
     </user>
</users>Thanks.

Not very useful:(.
This is my code:
PrintWriter out = null;
        try{
               String type = request.getParameter ("type");
               if (type.equals ("xml")){
                    response.setContentType ("text/xml; charset=ISO-8859-1");
                    out = response.getWriter ();
                    String xml =
                         "<?xml version='1.0' encoding='ISO-8859-1'?>" +
                         "<users>" +
                              "<user>" +
                                   "<name>Pepe</name>" +
                                   "<age>18</age>" +
                              "</user>" +
                              "<user>" +
                                   "<name>María</name>" +
                                   "<age>21</age>" +
                              "</user>" +
                         "</users>";
                    out.println (xml);
        }finally{
            out.close ();
        }This code works. The servlet send back the xml and the client shows the content but, as you can see, i'm not reading the xml file. So my problem is on reading the xml file as a plain text. My code is this:
response.setContentType ("text/xml; charset=ISO-8859-1");
                    out = response.getWriter ();
                    String xml = "";
                    FileReader fr = null;
                    BufferedReader br = null;
                    try{
                         fr = new FileReader (new File ("file.xml"));
                         br = new BufferedReader (fr);
                         String linea;
                         while ((linea = br.readLine ()) != null){
                              xml += linea;
                              //System.out.println (linea);
                         fr.close ();
                    }catch (Exception e){
                         e.printStackTrace ();
                    }But now I get an Exception File not found. The xml file is in the web directory (I'm using net beans 6.8). Where I have to put the file?
Thanks.
Edited by: GagleKas on Mar 15, 2010 6:39 AM

Similar Messages

  • Reading A xml file and sending that XML Data as input  to a Service

    Hi All,
    I have a requirement to read(I am using File adapter to read) a xml file and map the data in that xml to a service(schema) input variable.
    Example of  xml file that I have to read and the content of that xml file like below:
      <StudentList>
        <student>
           <Name> ravi</Name>
           <branch>EEE</branch>
          <fathername> raghu</fathername>
        </student>
      <student>
           <Name> raju</Name>
           <branch>ECE</branch>
          <fathername> ravi</fathername>
        </student>
    <StudentList>
    I have to pass the data(ravi,EEE,raghu etc) to a service input varible. That invoked Service input variable(schema) contains the schema similar to above schema.
    My flow is like below:
      ReadFile file adapter -------------------> BPEL process -----> Target Service.I am using transform activity in BPEL process to map the data from xml file to Service.
    I am using above xml file as sample in Native Data format(to create XSD schema file).
    After I built the process,I checked file adapter polls the data and receive the file(I am getting View xml document in EM console flow).
    But transform activity does not have anything and it is not mapping the data.I am getting blank data in the transform activity with only element names like below
    ---------------------------------------------------------------------------EM console Audit trail (I am giving this because u can clearly understand what is happening-----------------------------------------------------
       -ReceiveFile
            -some datedetails      received file
              View XML document  (This xml contains data and structure like above  xml )
        - transformData:
            <payload>
              <InvokeService_inputvariable>
                  <part name="body">
                     <StudentList>
                         <student>
                           <name/>
                            <branch/>
                            <fathername/>
                         </student>
                   </StudentList>
              </part>
             </InvokeService_inputvariable>
    'Why I am getting like this".Is there any problem with native data format configuration.?
    Please help me out regarding this issue as I am running out my time.

    Hi syam,
    Thank you very much for your replies so far so that I have some progrees in my task.
    As you told I could have put default directory in composite.xml,but what happenes is the everyday new final subdirectory gets created  in the 'soafolder' folder.What I mean is in  the c:/soafolder/1234_xmlfiles folder, the '1234_xmlfiles' is not manually created one.It is created automatically by executing some jar.
    Basically we can't know the sub folder name until it is created by jar with its own logic. whereas main folder is same(soafolder) ever.
    I will give you example with our folder name so that it would be more convenient for us to understand.
    1) yesterday's  the folder structure :  'c:/soafolder/130731_LS' .The  '130731_LS' folder is created automatically by executing some jar file(it has its own logic to control and create the subdirectories which is not in our control).
    2) Today's folder structure :  'c:/soafolder/130804_LS. The folder is created automatically(everytime the number part(130731,130804).I think that number is indicating 2013 july 31 st like that.I have to enquire about this)is changing) at a particular time and xml files will be loaded in the folder.
    Our challenge : It is not that we can put the default or further path in composite.xml and poll the file adapter.Not everytime we have to change the path in composite.xml.The process should know the folder path (I don't know whether it is possible or not.) and  everyday and file adapter poll the files in that created subfolders.
    I hope you can understand my requirement .Please help me out in this regard.

  • Read of XML file and post to IDOC

    Hi
    I'm working on a <b>WAS620</b> and need to read an XML file from a customer, extract the fields needed and post these via IDOC ORDERS01. My problem is HOW to read the XML file? Can anyone give me the steps involved/links to examples etc - I have not processed XML files via ABAP before.
    The file is posted to a shared folder and the ABAP I am about to develop will pick up this file.
    The file is <b>NOT</b> in IDOC/XML format but the customers own format
    Hope someone can help me asap.
    Thanks all in advance
    /Bo

    Hi,
    I would like to extend this question for <b>WAS620</b> and <b>reading</b> a <b>proprietary customer specific XML</b> file/data that is <b>send via HTTP to SAP WAS</b>.
    <b>Q1</b>: What is the best way to read this HTTP sent XML data (as it is, without transformations) into ABAP?
    <b>Q2</b>: What is the appropriate handler to use in the ICF object?
    Thanks all in advance

  • Reading from XML file and updating the table ????

    Hi
    I have package which reads the hier.XML file and does Update inserts into the 5 tables
    i have table called MAIN_tbl with the column cur_date.
    The package kicks if this cur_date is one day less than the hier.XML file DT.
    Currently i m manually checking this date's to make sure the Main_tbl cur_date is n sync with
    hier.XML file DT.
    for example :- hier.xml file DT is "20091020" then main_table cur_date should be 10/19/2009
    in order to kicks of the pakage.
    what i m looking to do ??
    compare the hier.xml DT with the main_table cur_date,
    if cur_date is -1(Preivous day) of hier.xml DT then run hier_pkg(Package)
    if not then update main_table cur_date to -1(previous day) of the hier.xml DATE
    Then later write the above logic to update the main_table in a procedure, and
    then call the package from the procedure.
    below are the top few lines of the hier.XML file which is relevant to the one which we are trying to do
    <?xml version = '1.0'?>
    <HIER_POSTING num ="111" HIER_TYP="CD" DT="20091020" Global="Y">
    FYI : The hier.XML file is located in UNIX space.
    How do i accomplish this. any idea ????
    Thank you so much in advance. For giving a thought on this problem!!!

    Any thought on this guys ???
    Thanks!!

  • Reading an XML file and write the contents to another xml file in java

    Hi,
    I am new to xml parsing.My requirement is that I am getting a message (xml) using ibm MQ in the ByteArrayInputStream format.I have to read this xml message and write to another file.
    I am creating a POC for this.
    First I used simple reading and writing concept but the output is "java.io.FileInputStream@3e25a5 "
    Sample xml file
    - <Client>
    <ClientId>1234</ClientId>
    <ClientName>STechnology</ClientName>
    <DTU_ID>567</DTU_ID>
    <ClientStatus>ACTIVE</ClientStatus>
    - <LEAccount>
    <ClientLE>678989</ClientLE>
    <LEId>56743</LEId>
    - <Account>
    <AccountNumber>9876543678</AccountNumber>
    </Account>
    </LEAccount>
    - <Service>
    <Cindicator>Y2Y</Cindicator>
    <PrefCode>980</PrefCode>
    <BSCode>876</BSCode>
    <MandatoryContent>MSP</MandatoryContent>
    </Service>
    </Client>
    code:
    import java.io.ByteArrayInputStream;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    public class ByteArrayInputStreamToXml {
         public static void main(String srg[]) throws IOException{
              InputStream inputStream= new FileInputStream("C:\\soft\\test2\\sample1.xml");
              byte currentXMLBytes[] = inputStream.toString().getBytes();
              ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(currentXMLBytes);
              OutputStream out = new FileOutputStream("C:\\soft\\test\\data.xml");
              int read=0;
              byte[] bytes = new byte[1024];
              while((read = byteArrayInputStream.read(bytes))!= -1){
              out.write(bytes, 0, read);
              out.write( '\n' );
              inputStream.close();
              out.flush();
              out.close();
              System.out.println("New file created!");
    Please suggest me how can I use DOM/SAX parser ,I can see several code on net for reading xml file using SAX/DOM parser but writing an xml file after reading it using ByteArrayInputStream I am not getting .A help through some example Link will also be helpful for me.
    Thanks
    Sumit
    Edited by: user8687839 on Apr 30, 2012 2:37 AM
    Edited by: user8687839 on Apr 30, 2012 2:43 AM

    Thanks I got the result.
    package com.sumit.collections;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    public class ByteArrayInputStreamToXml {
         public static void main(String srg[]) throws IOException{
              InputStream inputStream= new FileInputStream("C:\\soft\\test2\\sample1.xml");
              ByteArrayOutputStream buffer = new ByteArrayOutputStream();
              int nRead; byte[] data = new byte[1024];
              while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
              buffer.write(data, 0, nRead); } buffer.flush();
              byte currentXMLBytes[]= buffer.toByteArray();
              /* byte currentXMLBytes[] = inputStream.toString().getBytes();*/
              ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(currentXMLBytes);
              OutputStream out = new FileOutputStream("C:\\soft\\test\\data.xml");
              int read=0;
              byte[] bytes = new byte[1024];
              while((read = byteArrayInputStream.read(bytes))!= -1){
              out.write(bytes, 0, read);
              out.write( '\n' );
              inputStream.close();
              out.flush();
              out.close();
              System.out.println("New file created!");
    }

  • Read in XML file and spit out specific element

    Hi all i wonder if someone could give me a hand. I've got some code (below) which reads in an xml file and spits out the contents of the file. Thats fine and dandy, however what i want to be able to do is specify which element to spit out, which i'm not sure how to do. So say i had the following xml file:
    <?xml version="1.0"?>
    <OpenSourceQuestions>
         <question>
              <setup>A raster graphics editor</setup>
              <answerChoice1>The Gimp</answerChoice1>
              <answerChoice2>The Chimp</answerChoice2>
              <answerChoice3>The Pimp</answerChoice3>
              <answerChoice4>The Blimp</answerChoice4>
              <correctAnswer>The Gimp</correctAnswer>
         </question>
         <question>
              <setup>test question 2</setup>
              <answerChoice1>question2 answer1</answerChoice1>
              <answerChoice2>question2 answer2</answerChoice2>
              <answerChoice3>question2 answer3</answerChoice3>
              <answerChoice4>question2 answer4</answerChoice4>
              <correctAnswer>question2 answer1</correctAnswer>
         </question>
    </OpenSourceQuestions>What i want to do is only spit out the xml for the first question, i.e. "A raster graphics editor" and its answers
    Here is my java code for reading in and arsing the file:
    void readXML(){
                try {
                     File fXmlFile = new File("MyXMLFile.xml");
                     DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
                     DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
                     Document doc = dBuilder.parse(fXmlFile);
                     doc.getDocumentElement().normalize();
                     System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
                     NodeList nList = doc.getElementsByTagName("question");
                     System.out.println("-----------------------");
                     for (int temp = 0; temp < nList.getLength(); temp++) {
                       Node nNode = nList.item(temp);
                       if (nNode.getNodeType() == Node.ELEMENT_NODE) {
                         Element eElement = (Element) nNode;
                         System.out.println("Question : "  + getTagValue("setup",eElement));
                         System.out.println("Answer1 : "  + getTagValue("answerChoice1",eElement));
                         System.out.println("Answer2 : "  + getTagValue("answerChoice2",eElement));
                         System.out.println("Answer3 : "  + getTagValue("answerChoice3",eElement));
                         System.out.println("Answer4 : "  + getTagValue("answerChoice4",eElement));
                } catch (Exception e) {
                  e.printStackTrace();
               private static String getTagValue(String sTag, Element eElement)
                     NodeList nlList= eElement.getElementsByTagName(sTag).item(0).getChildNodes();
                     Node nValue = (Node) nlList.item(0);
                     return nValue.getNodeValue();
               }

    IN the time since i posted i have solved my own query!

  • Reading a xml file and Extract content of xml tags

    Hi,
    I need a InDesign script to Extract content of xml tags by reading a local xml file. And stamping the content of xml on InDesign Text frame.
    My sample xml is as follows .
    <events type="array">
    <event> 
    <aktiv_jn>J</aktiv_jn> 
    <enetpulse_id>1712408</enetpulse_id>
    <event_id>65974</event_id>
    <hjemmehold>AZ Alkmaar</hjemmehold>
    <id>93</id>
    <kickoff>2014-08-17T12:30:00+01:00</kickoff>
    <land_id>140</land_id>
    <land_navn>Holland</land_navn>
    <liga_id>13684</liga_id>
    <liga_navn>Eredivisie</liga_navn>
    <livebetting_jn>J</livebetting_jn>
    <marked_id>2897740</marked_id>
    <marked_nummer>138</marked_nummer>
    <marked_tekst>AZ Alkmaar - Ajax</marked_tekst>
    <moderkamp_jn>J</moderkamp_jn>
    <ob_bet_type>MR</ob_bet_type>
    <odds_1>2.95</odds_1>
    <odds_2>2.25</odds_2>
    <odds_x>3.35</odds_x>
    <program_slut>2014-08-18T23:59:00+01:00</program_slut>
    <program_start>2014-08-15T00:00:00+01:00</program_start>
    <resultat>2</resultat>
    <spilstop_dato_tid>2014-08-17T12:30:00+01:00</spilstop_dato_tid>
    <sport_id>21</sport_id>
    <sport_navn>Fodbold</sport_navn>
    <taerskel nil="true"/>
    <udehold>Ajax</udehold>
    <udfald_1_id>9661951</udfald_1_id>
    <udfald_2_id>9661953</udfald_2_id>
    <udfald_x_id>9661952</udfald_x_id>
    </event>
    </events>
    And on my Indesign Page upon execution of script: I need text like,
    land_navn:     Holland
    odds_1:     2.95
    odds_2:     2.25
    odds_x:     3.35

    Hi,
    Try:

  • Reading the XML file and displaying teh string with teh desired output

    Hi Gurus,
    I have an xml file as below.
    catalog>
    <book>
    <id>101</id>
    <genre>Computer</genre>
    <author>Jim Cortez</author>
    <title>XML for dummies</title>
    <price>44.95</price>
    <description>An in-depth look at creating mashed potatoes
    with XML.</description>
    </book>
    <book>
    <id>102</id>
    <author>George Bush</author>
    <title>I'm the decider</title>
    <genre>Fantasy</genre>
    <price>0.95</price>
    <description>I like milk and cookies.</description>
    </book>
    </catalog>
    I would like to display the Output as
    [<catalog>:1]
    [<book>:1]
    [<id>:1]
    [101:3]
    [</id>:2]
    [<genre>:1]
    [Computer:3]
    [</genre>:2]
    [<author>:1]
    [Jim Cortez:3]
    [</author>:2]
    [<title>:1]
    [XML for dummies:3]
    ............ etc., etc.,,
    here is the code template.......
    import java.io.*;
    class TagScanner implements TokenStream {
    public static final int BEGIN_TAG_TYPE = 1;
    public static final int END_TAG_TYPE = 2;
    public static final int TEXT_TYPE = 3;
    protected Reader reader = null;
    /** Lookahead char */
    protected char c;
    /** Text of currently matched token */
    protected StringBuffer text = new StringBuffer(100);
    public TagScanner(Reader reader) throws IOException {
    this.reader = reader;
    nextChar();
    protected void nextChar() throws IOException {
    c = (char)reader.read();
    public Token nextToken() throws IOException {
         if ( start of a tag ) {
         // scarf until end of tag
         // type is either BEGIN_TAG_TYPE or END_TAG_TYPE
         if ( end of file ) {
         type = Token.EOF_TYPE;
         text = "end-of-file";
         else {
         // scarf until start of a tag
         type = TEXT_TYPE;
         if ( just whitespace ) {
         // ignore and get another token
    return new Token(type, text.toString());
    Can someone please provide me the logic for the code please........... here is the complete link of the excersie http://www.antlr.org/wiki/display/CS652/Lexer+for+XML
    Many Thanks
    -M

    Can someone please provide me the logic for the code please..........The logic is pretty well spelled out for you in the description of the assignment and the outline for the code you provided. If you mean
    Can someone please do my homework for me....The answer to that is usually yes, someone can do your homework for you, but no, they usually won't actually do it for you.
    However, if you are really stuck on what to do, you should consider:
            if ( start of a tag ) {How would you know that you are at the start of a tag? Once you can answer that, the rest sort of works itself out as long as
                // scarf until end of tagyou realize what it means to 'scarf' and how to determine when an end-of-tag is reached (hint, very similar as to how to determine if you are at the start-of-tag).

  • Reading the XML file and displaying the string with the desired output

    Hi Gurus,
    I have an xml file as below.
    catalog>
    <book>
    <id>101</id>
    <genre>Computer</genre>
    <author>Jim Cortez</author>
    <title>XML for dummies</title>
    <price>44.95</price>
    <description>An in-depth look at creating mashed potatoes
    with XML.</description>
    </book>
    <book>
    <id>102</id>
    <author>George Bush</author>
    <title>I'm the decider</title>
    <genre>Fantasy</genre>
    <price>0.95</price>
    <description>I like milk and cookies.</description>
    </book>
    </catalog>
    I would like to display the Output as
    [<catalog>:1]
    [<book>:1]
    [<id>:1]
    [101:3]
    [</id>:2]
    [<genre>:1]
    [Computer:3]
    [</genre>:2]
    [<author>:1]
    [Jim Cortez:3]
    [</author>:2]
    [<title>:1]
    [XML for dummies:3]
    ............ etc., etc.,,
    here is the code template.......
    import java.io.*;
    class TagScanner implements TokenStream {
    public static final int BEGIN_TAG_TYPE = 1;
    public static final int END_TAG_TYPE = 2;
    public static final int TEXT_TYPE = 3;
    protected Reader reader = null;
    /** Lookahead char */
    protected char c;
    /** Text of currently matched token */
    protected StringBuffer text = new StringBuffer(100);
    public TagScanner(Reader reader) throws IOException {
    this.reader = reader;
    nextChar();
    protected void nextChar() throws IOException {
    c = (char)reader.read();
    public Token nextToken() throws IOException {
    if ( start of a tag ) {
    // scarf until end of tag
    // type is either BEGIN_TAG_TYPE or END_TAG_TYPE
    if ( end of file ) {
    type = Token.EOF_TYPE;
    text = "end-of-file";
    else {
    // scarf until start of a tag
    type = TEXT_TYPE;
    if ( just whitespace ) {
    // ignore and get another token
    return new Token(type, text.toString());
    Can someone please provide me the logic for the code please........... here is the complete link of the excersie
    http://www.antlr.org/wiki/display/CS652/Lexer+for+XML
    Many Thanks
    -M

    Can someone please provide me the logic for the code please..........The logic is pretty well spelled out for you in the description of the assignment and the outline for the code you provided. If you mean
    Can someone please do my homework for me....The answer to that is usually yes, someone can do your homework for you, but no, they usually won't actually do it for you.
    However, if you are really stuck on what to do, you should consider:
            if ( start of a tag ) {How would you know that you are at the start of a tag? Once you can answer that, the rest sort of works itself out as long as
                // scarf until end of tagyou realize what it means to 'scarf' and how to determine when an end-of-tag is reached (hint, very similar as to how to determine if you are at the start-of-tag).

  • Read a XML file and store an element to a String

    Hello,
    I'm looking for a solution to load an XML file (see below), read all elements and store the first of them (the first "description" element) in a String variable.
    Should I load the file in a Node variable?
    What is the best solution?
    The XML file looks like:
    <document>
    <typeOfWorkstation >
    <item id="desktop">
    <description>Desktop</description>
    </item>
    <item id="laptop">
    <description>Laptop</description>
    </item>
    <item id="other">
    <description>Other configuration</description>
    </item>
    </typeOfWorkstation>
    </docuement>
    All suggestions will be greatly appreciated
    Thank you
    Sylvain

    no example, uh? the tutorial is packed with code samples
    this will get you started:
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse(new File("c:/folder/data.xml"));

  • How to loop through single XML File and send multiple RFC calls?

    I am looking for the best approach to use for making multiple RFC calls (can be sequential) using a single XML file of data.  I have been attempting to get a BPM loop working, but to no avail.  My RFC only accepts a single set of delivery input and I have been told to try to work with it as is.
    input xml sample:
    <?xml version="1.0" encoding="UTF-8"?>
    <ProofOfDelivery>
       <POD>
          <delivery_number>1</delivery_number>
          <carrier_name>UPS</carrier_name>
       </POD>
       <POD>
          <delivery_number>2</delivery_number>
          <carrier_name>UPS</carrier_name>
       </POD>
    </ProofOfDelivery>
    I need to make a synchronous RFC call for each set of POD data.
    Thanks in advance!

    Thanks for the inputs.
    I tried with a BPM and multi-mapping transformation before a ForEach block.  I am getting this error:
    Work item 000000028028: Object FLOWITEM method EXECUTE cannot be executed
    Error during result processing of work item 000000028029
    com/sap/xi/tf/_ProofOfDeliveryMultiMapping_com.sap.aii.utilxi.misc.api.BaseRuntimeExceptionRuntim
    Error: Exception CX_MERGE_SPLIT occurred (program: CL_MERGE_SPLIT_SERVICE========CP, include: CL_
    Probably because I am not making/using the container objects properly.  Here is a screenshot of my BPM.  Can anyone spot my issue or point me to an example on this sort of container use?
    [http://kdwendel.brinkster.net/images/bpm.jpg|http://kdwendel.brinkster.net/images/bpm.jpg]
    Thanks

  • Need to read a XML file and store multilingual data

    I am having an XML file which contains multiple records and each maybe in a different language .identified EN -english ES-Spanish etc
    - <Document xmlns="http://www.xxxxx.com/ws/integration/toolkit/2011/05">
    - <Attributes>
    <Attribute name="duration">0:00:02.993</Attribute>
    <Attribute name="count">47</Attribute>
    <Attribute name="entity">Requisition</Attribute>
    <Attribute name="mode">XML</Attribute>
    <Attribute name="version">http://www.xxxx.com/ws/tee800/2009/01</Attribute>
    </Attributes>
    - <Content>
    - <ExportXML xmlns="http://www.xxxxx.com/ws/integration/toolkit/2005/07/action/export">
    - <record>
    <field name="ContestNumber">120000002O</field>
    <field name="JobInformation,JobType,Description">Standard</field>
    <field name="JobFamily">ACCOUNTING/FINANCE</field>
    <field name="JobInformation,Organization,Name">CHMS-DO NOT USE</field>
    <field name="Country">USA</field>
    <field name="State">Illinois</field>
    <field name="City">Lake County</field>
    <field name="Title_EN">TaTest1</field>
    <field name="Title_es">TaTest1 translated to Espanol</field>
    <field name="InternalDescription_EN">Humira marketing team - develop programs.</field>
    <field name="InternalDescription_zhCN" />
    <field name="InternalDescription_zhTW" />
    <field name="InternalDescription_es">Development of marketing programs for </field>
    <field name="ExternalDescription_EN">Marketing programs for core products</field>
    <field name="ExternalDescription_zhCN" />
    <field name="ExternalDescription_zhTW" />
    <field name="ExternalDescription_es">Marketing core products - Spain</field>
    <field name="URL_en">http://[ZONE]/careersection/[CAREER_SECTION]/jobdetail.ftl?lang=en&job=120000002O</field>
    <field name="URL_zhCN" />
    <field name="URL_zhTW" />
    <field name="URL_es">http://[ZONE]/careersection/[CAREER_SECTION]/jobdetail.ftl?lang=es&job=120000002O</field>
    <field name="PostedExternally">true</field>
    <field name="PostedInternally">true</field>
    <field name="EnglishActive">true</field>
    <field name="SimplifiedChineseActive">false</field>
    <field name="TraditionalChineseActive">false</field>
    <field name="SpanishActive">true</field>
    <field name="InternalBonusTracking" />
    <field name="ExternalBonusTracking" />
    <field name="POSTING_GRADE" />
    <field name="SAP_Schedule">Full-time</field>
    <field name="PostingDateExternal">2012-11-20</field>
    <field name="PostingDateInternal">2012-11-20</field>
    </record>
    </ExportXML>
    </Content>
    </Document>
    I need to store and retrieve data into a AL32UTF8 database without losing language attributed.
    I am using DBMS_XMLDOM.getnodevalue (); to fetch the XML stored in a CLOB column
    But the package returns VARCHAR2 .How do i return NVARCHAR2 so that i can store Multilingual data
    DBMS_XMLDOM.GETNODEVALUE(
    n IN DOMNode)
    RETURN VARCHAR2;
    Or is there an easier way around using XMLTYPE
    Edited by: Rameshkumar T on Nov 27, 2012 6:14 AM

    dbms_lob.loadclobfromfile( v_xml_msg
                                          , v_xml_bfile
                                          , dbms_lob.getlength(v_xml_bfile)
                                          , v_dest_offset
                                          , v_src_offset
                                          , NLS_CHARSET_ID('AL32UTF8')
                                          , v_lang_context
                                          , v_warning
    SELECT message
       INTO   v_xml_clob
       FROM   gjb_xml_message gtmq
       WHERE  message_id = v_msg_id;
       v_line_no := 1;
       v_doc     := dbms_xmldom.newDOMDocument(v_xml_clob);
       v_line_no := 2;
       v_nodes    := dbms_xmldom.getElementsByTagName(v_doc, '*');
       FOR i IN 0..dbms_xmldom.getlength(v_nodes)-1
       LOOP
           BEGIN
               v_line_no := 3.0;
               v_element_x  := dbms_xmldom.makeelement(xmldom.item(v_nodes,i));
               v_line_no := 3.1;
               v_node       := dbms_xmldom.item(v_nodes,i);
               v_line_no := 3.2;
               v_tag        := dbms_xmldom.getNodeName(v_node);
               v_line_no := 3.3;
               v_node_2     := dbms_xmldom.getfirstchild(v_node);
               v_line_no := 4.0;
               v_node_map     := DBMS_XMLDOM.getattributes (v_node);
               FOR x in 0 ..DBMS_XMLDOM.getlength (v_node_map)- 1
               LOOP
                  BEGIN
                     v_line_no := 4.1;
                     v_one_node := DBMS_XMLDOM.item (v_node_map, x);
                     v_line_no := 4.2;
                     v_attrname := DBMS_XMLDOM.getnodename (v_one_node);
                     v_line_no := 4.3;
                     v_attrval  := DBMS_XMLDOM.getnodevalue (v_one_node);
                     IF  v_attrval = 'ContestNumber' THEN
                          v_line_no := 4.4;
                          v_contest_num := v_tag_value;
                          v_rec_no := NULL;
                          IF v_load_type = 'I' THEN
                             v_rec_no := fn_get_job_id(v_contest_num);
                          END IF;
                          IF v_rec_no IS NULL THEN
                             SELECT seq_gjbjobid.NEXTVAL
                             INTO   v_rec_no
                             FROM   dual;
                          END IF;
                     END IF;
    IF UPPER(v_tag) = 'FIELD' THEN
             BEGIN
                v_line_no := 5;
                INSERT INTO gjb_xml_data
                       ( message_id
                       , job_id
                       , tag_name
                       , col_name
                       , col_no
                       , tag_level
                       , tag_value
                       , tag_lang
                       , tag_value_clob
                SELECT v_msg_id
                     , v_rec_no
                     , tag_name
                     , col_name
                     , col_no
                     , tag_level
                     , v_tag_value
                     , tag_lang
                     , v_tag_value_clob
                FROM   gjb_xml_tags gxt
                WHERE  tag_name = v_attrval;
                v_tag_value := NULL;
                v_tag_value_clob := NULL;Edited by: Rameshkumar T on Nov 27, 2012 8:27 AM

  • Crate XML file and send that XML file from R3 to SIBEL

    Hi Friends,
              Is SAP provided any idoc type and Message type for Goods Receipt (MIGO)??
    My requirement is to create XML file having 4 fields from MIGO then that XML file to be display in SIBEL system. Can anybody help me how can I do this.

    Hi Mohanty,
    hope it can help you.
    http://www.sapfans.com/sapfans/forum/intface/messages/4062.html
    Try cl_xml_document class, and also look at cl_ixml class factory.
    Regards,
    David

  • How to read an Excel File AND SEND TO GENERATOR

    Hi 
    I want send the datas from Exel file to my device, I have one part in mu code which can read my data from exel but I don t know how can I send this data to ny divice?
    I  really nead your suggestion, please.
    I attached my code also my Exel file.
    Attachments:
    DG5071.xlsx ‏1841 KB
    Rigol Generator.vi ‏52 KB

    Hello vsa,
    I checked the specifications of this Function Arbitrary Waveform Generator and I found that it is GPIB complaint. Instruments with GPIB protocol can be controlled using GPIB commands, but each instrument could have different GPIB commands. Despite this, most providers have "standard" commands among its products.
    I checked some documentation and found a help file that describes the GPIB commands used by this device, so the options are:
    1. Wait for someone to develop an Instrument Driver for this instrument.
    2. Check if you find any other Function Arbitrary Waveform Generator of the same brand that uses the same commands and for which there is already an instrument driver.
    3. Create your own instrument driver.
    If you choose option 3 I share with you the following links that you may find useful:
    Developing LabVIEW Plug and Play Instrument Drivers:
    http://www.ni.com/white-paper/3271/en/
    Connecting Instruments via GPIB:
    http://www.ni.com/getting-started/set-up-hardware/instrument-control/gpib-connect
    GPIB Instrument Control Tutorial:
    http://www.ni.com/white-paper/2761/en/
    Using IVI Drivers in LabVIEW:
    http://www.ni.com/white-paper/4556/en/
    Instrument Control in LabVIEW Tutorial:
    http://www.ni.com/white-paper/3511/en/
    Best regards.
    David P.
    National Instruments
    Applications Engineer
    www.ni.com/soporte
    Attachments:
    DG5000 Programming Guide.zip ‏907 KB

  • XI to read the action xml file and create a SAP notification in PM

    Hi All
    I am new to XI world can you please help me in doing this scenario.
    I have to read an XML file and create a Notification in PM module of SAP.
    Step by Step help would be great.
    Thanks in Advance
    Sai

    Hi Sai,
    To send data from XML file to SAP (any module) there are 2 ways..
    1. File to IDoc  and
    2. File to RFC...
      first Identify the concerned BAPI or IDOC for CREATION OF
    NOTIFICATION ...then do the  scenarios..
       for Step by stp process go through this link...
    New to XI
    regards,
    Ansar.

Maybe you are looking for

  • How to commit data at the end of a bounded task flow

    Hi all, I am using JDev 11.1.1.0.2. I have this situation 1) A page with a button that goes to a task-flow to insert data (property data-control-scope set to shared and property transaction set to requires-transaction as suggested in http://www.oracl

  • Oracle 8.1.7 on Mandrake 9.0

    Hi All. I'm having some strange problems with Oracle 8.1.7 on Mandrake 9.0. Mandrake is installed and running fine, when I start the ./runInstaller the jre starts up but uses 100% cpu time. I never get the splash screen and the installation just hang

  • PI sheets - PPPI_RESERVATION_ITEM

    Hi, I am looking to create a PI sheet with Batch determination.  I can use CONS_BDS Process Message but it asks me for a value for PPPI_RESERVATION_ITEM and I thought this would automatically come from the reservation? Is this not the case ?  How do

  • CRM IDoc

    Hello Every one, I am new to this forum. I would like some information regarding CRM. I would like to know: What are CRM IDocs? How they differ from Idocs in SAP R/3? What is CRM module? How XI and Crm are related? If anyone can provide me with web l

  • How to get the country to print when printing envelopes or labels

    Has anyone figured out how to configure Address Book so that the country field can be printed on envelopes or labels? Haven't found any pref or setting to get it to show up on those items. OT