How to get data from XML file having korea Text

I have a one XML File with Korean Text, How to read this File.
i tried with this code
BufferedReader in = new BufferedReader(
new InputStreamReader(new FileInputStream("C:/test1.xml"), "EUC-KR"));
String str = in.readLine();
but it is giving exceptions.
please suggest me, how to retrive EUC-KR text from the XML file

Standard Java does not support this Charset. You have to find a charset provider that implements "EUC-KR". But you should also consider using Unicode, which is implemented in standard Java.
http://www.unicode.org/charts/

Similar Messages

  • How to extract data from XML file with JavaScript

    HI All
    I am new to this group.
    Can anybody help me regarding XML.
    I want to know How to extract data from XML file with JavaScript.
    And also how to use API for XML
    regards
    Nagaraju

    This is a Java forum.
    JavaScript is something entirely different than Java, even though the names are similar.
    Try another website with forums about JavaScript.
    For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3

  • How to get data from a file?

    Hello everyone, i'm new to this forum and to java too. Ok, so here is what i want to do:
    I want to get data from a file containing words and numbers and store them into variables that i will use them after to insert into a database table. For example i have a file called employees.txt in this form:
    eid ename zipcode Hire_date
    1000 "Jones" 67226 "12-DEC-95"
    In C++ i declare variables for each data and store them, for example in this case:
    ifstream in("somefile");
    string name, hdate;
    int eid, zip;
    in >> eid >> ename >> zip >> hdate;
    So i want to do the same thing in JAVA but i can't make it work. So, i would appreciate if someone could give me a simple example how to do it. Thank you.

    [http://java.sun.com/docs/books/tutorial/essential/io/index.html]

  • Help Me... How to get Data from CSV File...?

    Hi Everyone..!
    This is yajiv and am working in CS3 Photoshop platform. I know about Java Script. Is it possible to get the data from CSV files. Actually our client use to send us the CSV files which contains a lot of swatch name and reference files in one particular image name.
    Actually how we work on that CSV file is, first we copy file name to search that CSV file. then get the result to paste into layer name. This process continue till the end of swatch.
    Thank in Advance
    -yajiv

    > Is it possible to get the data from CSV files.
    Have you tried searching this forum?

  • How to retrive data from .XML file to JMS

    hi friends.. this is vamsi from india.. i have been working on jsp, java bean, xml, jms, message driven bean , ejb and database from last couple of days. but i am not able to retrieve data from fields in xml file to jms. can any one help me out in retrieving the data from xml to jms..
    thanking you,
    vamsi.

    Database but we are not able to retrieve the values
    from XML to JMS."We are not able to" is too vague a statement. An answer to this could well be "Did you turn your computer on?"
    So again, please post formatted code showing what you have done and where you are stuck.
    Perhaps an error message and/or a stack trace if appropriate.

  • How to get data from media files such author, title and so on

    Hi you all!

    You'd have to parse the binary file header yourself. JMF doesn't have any built-in ways to extract META data from media files.
    Also, don't post your question in the title and not in the body of the message. It's annoying and stupid...

  • How to retrieve data from xml file into obiee reports

    Hi all,
    I've got a situation here. A xml file is stored as blob in oracle database table. Now i need to retrieve data/info from that xml file into obiee reports. How am i supposed to proceed with this ?

    I will go for a table function:
    http://gerardnico.com/wiki/database/oracle/table_function
    In two words, you can create a function that behave as a table. Then you create a function to pick up your xml, you parse it and you send back the rows.
    I know that Oracle has also a library for XML files but I never use it until now.
    Success
    Nico

  • How to get attribute from xml file

    I managed to grab all the info from xml, except the "url" attribute in <image type="poster" url="" size="mid" .../>. Any ideas?
    import java.io.*;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import java.net.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class XmlParser {
         ArrayList<Movie> myMovies;
         Document dom;
         public XmlParser(){
              //create a list to hold the movie objects
              myMovies = new ArrayList<Movie>();
         public void runExample(String adr, String tagName) {
              parseXmlFile(adr);
              parseDocument(tagName);
              printData();          
         private void parseXmlFile(String adr){
              //get the factory
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              try {               
                   //Using factory get an instance of document builder
                   DocumentBuilder db = dbf.newDocumentBuilder();
                   //parse using builder to get DOM representation of the XML file
                   URL xmlUrl = new URL(adr);
                   InputStream in = xmlUrl.openStream();
                   dom = db.parse(in);               
              }catch(ParserConfigurationException pce) {
                   pce.printStackTrace();
              }catch(SAXException se) {
                   se.printStackTrace();
              }catch(IOException ioe) {
                   ioe.printStackTrace();
         private void parseDocument(String tagName){
              //get the root elememt
              Element docEle = dom.getDocumentElement();
              //get a nodelist of <movie> elements
              NodeList nl = docEle.getElementsByTagName(tagName);
              if(nl != null && nl.getLength() > 0) {
                   for(int i = 0 ; i < nl.getLength();i++) {
                        //get the movie element
                        Element el = (Element)nl.item(i);
                        //get the Movie object
                        Movie mov = getMovie(el);
                        //add it to list
                        myMovies.add(mov);
          * I take an movie element and read the values in, create
          * an Movie object and return it
          * @param movE
          * @return
         private Movie getMovie(Element movE) {
              String title = getTextValue(movE, "original_name");
              String year = getTextValue(movE, "released");
              String imdbId = getTextValue(movE, "imdb_id");
              double score = getDoubleValue(movE, "score");
              String overview = getTextValue(movE, "overview");
              String poster = movE.getAttribute("url");
              Movie mov = new Movie(title, year, imdbId, score, overview, poster);
              return mov;
         private String getTextValue(Element ele, String tagName) {
              String textVal = null;
              NodeList nl = ele.getElementsByTagName(tagName);
              if(nl != null && nl.getLength() > 0) {
                   Element el = (Element)nl.item(0);
                   textVal = el.getFirstChild().getNodeValue();
              return textVal;
          * Calls getTextValue and returns a int value
          * @param ele
          * @param tagName
          * @return int
         private int getIntValue(Element ele, String tagName) {
              //in production application you would catch the exception
              return Integer.parseInt(getTextValue(ele, tagName));
          * Calls getTextValue and returns a double value
          * @param ele
          * @param tagName
          * @return double
         private double getDoubleValue(Element ele, String tagName) {
              return Double.parseDouble(getTextValue(ele, tagName));
          * Iterate through the list and print the
          * content to console
         private void printData(){
              System.out.println("Total Movies: " + myMovies.size());
              Iterator it = myMovies.iterator();
              while(it.hasNext()) {
                   System.out.println(it.next().toString());
         public static void main(String[] args){
              //create an instance
              XmlParser xp = new XmlParser();
              //call run example
              xp.runExample("http://api.themoviedb.org/2.1/Movie.search/en/xml/apikey/Fight+Club+1999", "movie");
    }Here is the example xml file I used
    <?xml version="1.0" encoding="UTF-8"?>
    <OpenSearchDescription xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
      <opensearch:Query searchTerms="Fight Club 1999"/>
      <opensearch:totalResults>1</opensearch:totalResults>
      <movies>
        <movie>
          <score>8.383284</score>
          <popularity>3</popularity>
          <translated>true</translated>
          <adult>false</adult>
          <language>en</language>
          <original_name>Fight Club</original_name>
          <name>Fight Club</name>
          <alternative_name>El Club de la Lucha</alternative_name>
          <type>movie</type>
          <id>550</id>
          <imdb_id>tt0137523</imdb_id>
          <url>http://www.themoviedb.org/movie/550</url>
          <votes>62</votes>
          <rating>8.4</rating>
          <certification></certification>
          <overview>A lonely, isolated thirty-something young professional seeks an escape from his mundane existence with the help of a devious soap salesman. They find their release from the prison of reality through underground fight clubs, where men can be what the world now denies them. Their boxing matches and harmless pranks soon lead to an out-of-control spiral towards oblivion.</overview>
          <released>1999-09-16</released>
          <images>
            <image type="poster" url="http://hwcdn.themoviedb.org/posters/f75/4bc908ab017a3c57fe002f75/fight-club-original.jpg" size="original" width="1000" height="1500" id="4bc908ab017a3c57fe002f75"/>
            <image type="poster" url="http://hwcdn.themoviedb.org/posters/f75/4bc908ab017a3c57fe002f75/fight-club-mid.jpg" size="mid" width="500" height="750" id="4bc908ab017a3c57fe002f75"/>
            <image type="poster" url="http://hwcdn.themoviedb.org/posters/f75/4bc908ab017a3c57fe002f75/fight-club-cover.jpg" size="cover" width="185" height="278" id="4bc908ab017a3c57fe002f75"/>
            <image type="poster" url="http://hwcdn.themoviedb.org/posters/f75/4bc908ab017a3c57fe002f75/fight-club-thumb.jpg" size="thumb" width="92" height="138" id="4bc908ab017a3c57fe002f75"/>
            <image type="backdrop" url="http://hwcdn.themoviedb.org/backdrops/f71/4bc908ab017a3c57fe002f71/fight-club-original.jpg" size="original" width="1280" height="720" id="4bc908ab017a3c57fe002f71"/>
            <image type="backdrop" url="http://hwcdn.themoviedb.org/backdrops/f71/4bc908ab017a3c57fe002f71/fight-club-poster.jpg" size="poster" width="780" height="439" id="4bc908ab017a3c57fe002f71"/>
            <image type="backdrop" url="http://hwcdn.themoviedb.org/backdrops/f71/4bc908ab017a3c57fe002f71/fight-club-thumb.jpg" size="thumb" width="300" height="169" id="4bc908ab017a3c57fe002f71"/>
          </images>
          <version>73</version>
          <last_modified_at>2010-09-11 14:33:06</last_modified_at>
        </movie>
      </movies>
    </OpenSearchDescription>

    pvujic wrote:
    Thanks, but how can I "fetch" the url from the image element?You've got to first get to the image element. But based on what you've posted though, with a little more coding, you should be able to succeed. Just give it a try! :)

  • How to extract data from xml file in owb 10.2?

    I have to load data from an xml file into a relational table , may i know how to do it in owb 10.2.

    This is a Java forum.
    JavaScript is something entirely different than Java, even though the names are similar.
    Try another website with forums about JavaScript.
    For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3

  • How to extract data from xml file and store that data inti data base table

    Hii All
    I have one table that table contains one column that column contain an XML file
    I want to extract data from that XML file and want to store that extracted data into an other table.
    That xml file has different different values
    I want to store that values into table in diff diff columns

    Hi,
    I am also facing the same problem.I have a .xml file and i need to import the data into the custom table in oracle database.
    Can you please let me know if you know the solution how to do it in oracle apps.
    Thanks,

  • How to get data from pdf file and send contents  of the pdf file to R/3

    Hi, experts,
    Action:
    1. Make a pdf forms (interactive form) with inputfield named “A_inputfield” in the webdynpro application and run the webdynpro application.
    2. In the IE, click the save button in the pdf interactive form and save the pdf to local disk,ex: C disk. Close the IE browser.
    3. Open the pdf interactive form from the local C disk and type "aaa" to the “A_inputfield”.
    4. I want to save the "aaa" to the R/3 system using webdynpro or using other tools . How can I do it?
    First way:
    If I use webdynpro application to save the content of the pdf, I don't find a way mapping or binding the content to a context of a view. So I don't think this way is unadvisable.
    Second way:
    Adding a button "submit" in the pdf forms when create the pdf form. Runing the webdynpro application, save the pdf to local disk,ex: C disk.  Opening the pdf interactive form from the local c disk and typing "aaa" to the “A_inputfield”, click the  "submit" button to save the content. Of course, I need to finish the code for clicking "submit" button. But I don't know how  to write these codes and where to write these codes. Do you give me some advise ?
    Best regards,
    tao

    Hi, Abhimanyu L,
    Thanks a lot for your help. Your answer can give me large developmental.:)
    I find http://help.sap.com/saphelp_erp2005/helpdata/en/67/fae9421dd80121e10000000a155106/content through searching google for CL_WD_ADOBE_SERVICES class. But I don't find any exmples for the class. Do you give me some hint for some exmples for the class?
    Best regards,
    tao
    (You can reply back to me via e-mail if you think we should discuss this internally at [email protected] or [email protected])

  • Read data from xml files and  populate internal table

    Hi.
    How to read data from xml files into internal tables?
    Can u tell me the classes and methods to read xml data..
    Can u  explain it with a sample program...

    <pre>DATA itab_accontextdir TYPE TABLE OF ACCONTEXTDIR.
    DATA struct_accontextdir LIKE LINE OF itab_accontextdir.
    DATA l_o_error TYPE REF TO cx_root.
    DATA: filename type string ,
                 xmldata type xstring .
    DATA: mr      TYPE REF TO if_mr_api.
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
    WRITE xmldata.
    TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.
    LOOP AT itab_accontextdir INTO struct_accontextdir.
        WRITE: / struct_accontextdir-context_id,
               struct_accontextdir-context_name,
               struct_accontextdir-context_type.
        NEW-LINE.
        ENDLOOP.</pre>
    <br/>
    Description:   
    In the above code snippet I am storing the data in an xml file(you know xml is used to store and transport data ) called 'xml_accontextdir.xml' that is uploaded into the MIME repository at path 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'.
    The below API is used to read a file in MIME repo and convert it into a string that is stored in ' xmldata'. (This is just a raw data that is got by appending the each line of  xml file).
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
        Once the 'xmldata' string is available we use the tranformation to parse the xml string that we have got from the above API and convert it into the internal table.
    <pre>TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.</pre>
    Here the trasnsformation 'id ' is used to conververt the source xml 'xmldata' to resulting internal table itab_accontextdir, that have same structure as our xml file 'xml_accontextdir.xml'.  In the RESULT root of the xml file has to be specified. (In my the root is 'shiva'). 
    Things to be taken care:
    One of the major problem that occurs when reading the xml file is 'format not compatible with the internal table' that you are reading into internal table.  Iin order to get rid of this issue use one more tranformation to convert the data from the internal table into the xml file.    
    <pre>TRY.
          CALL TRANSFORMATION id
            SOURCE shiv = t_internal_tab
            RESULT XML xml.
        CATCH cx_root INTO l_o_error.
      ENDTRY.
      WRITE xml.
      NEW-LINE.</pre>
    <br/>
    This is the same transformation that we used above but the differnce is that the SOURCE and RESULT parameters are changed the source is now the internal table and result is *xml *string. Use xml browser that is available with the ABAP workbench to read the xml string displayed with proper indentation. In this way we get the format of xml file to be used that is compatable with the given internal table. 
    Thank you, Hope this will help you!!!
    Edited by: Shiva Prasad L on Jun 15, 2009 7:30 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 11:56 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 12:06 PM

  • Extract data from XML file to Oracle database

    Dear All
    Please let me know, how to extract data from XML file to Oracle database which includes texts & images.
    Thanking You
    Regards Lakmal Marasinghe

    I would do it from the database, but then again, I am a database / PL/SQL guy.
    IMHO the database will deliver you with more options. I don't know about "speed" between the two.

  • Get repeated data from XML File

    Hello,
    I have created one SSIS package to fetch the data from XML file.[I have used XML Source in Data flow task]
    While doing the same i have used the "Generate XSD" option to generate XSD file automatically.
    XSD file is as follows -
      <xs:element name="Collage">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" name="Class" type="xs:string" />
            <xs:element minOccurs="0" name="Division" type="xs:string" />
            <xs:element minOccurs="0" name="CollageDetail">
              <xs:complexType>
                <xs:sequence>
                  <xs:element minOccurs="0" maxOccurs="unbounded" name="Studients">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element minOccurs="0" name="StudentID" type="xs:string" />
                        <xs:element minOccurs="0" name="StudentName" type="xs:string" />
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    My Table Information is as follows
    Class
    Devision
    StudentID
    StudentName
    BE
    A
    A101
    Tom
    BE
    A
    A102
    Jack
    BE
    A
    A103
    John
    Problem - In the "column" tab of the "XML source" i am not able to see the information of "class" and "Division". [these two columns data is repeating in every row
    I am able to see only two option in "Outout Name" Dropdown in "Column" Tab.i.e  "Studients" and "CollageDetail"
    Student is having two column [StudentID,StudentName] and CollageDetail is having only one column[CollageDetail_ID]
    I am not able to see "Collage","Division" Information XML Source.
    Could you please suggest me what i have make changes to get "Class","Division" information from "XML Source".
    Thank You. 

    Thanks for the reply,
    i tried add
    maxOccurs="unbounded" in the XSD file, I am able to see the Class and division option in
     "Outout Name" Dropdown.  but i am getting NULL value for the Class
    and division  column.
    Still i am not able to get top level attribute.Kindly suggest me for the same.
    XML file content is as follows.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Collage xmlns:ns0="http://www.W3.com/schema/Collage.xsd">
    <ns0:Class>BE</ns0:Class>
    <ns0:Division>A</ns0:Division>
    <ns0:CollageDetail>
    <ns0:Studients>
    <ns0:StudentID>A101</ns0:StudentID>
    <ns0:StudentName>Tom</ns0:StudentName>
    </ns0:Studients>
    <ns0:Studients>
    <ns0:StudentID>A102</ns0:StudentID>
    <ns0:StudentName>Jack</ns0:StudentName>
    </ns0:Studients>
    <ns0:Studients>
    <ns0:StudentID>A103</ns0:StudentID>
    <ns0:StudentName>John</ns0:StudentName>
    </ns0:Studients>
    </ns0:CollageDetail>
    </ns0:Collage>
    I would like to get all the XML data in below format [single set , not in part].Kindly suggest me for the same.
    Table data
    Class
    Devision
    StudentID
    StudentName
    BE
    A
    A101
    Tom
    BE
    A
    A102
    Jack
    BE
    A
    A103
    John

  • How to read the data from XML file and insert into oracle DB

    Hi All,
    I have below require ment.
    I will receive data in the XML file. then i need to read that data and insert into oracle tables. please let me know how this can be handled.
    Many Thanks.

    Sounds a lot like this question, only with less details.
    how to read data from XML  variable and insert into table variable
    We can only help if you provide us details to help as we cannot see what you are doing and only know what you tell us.  Plenty of examples abound on the forums that cover the topics you seek as well.

Maybe you are looking for

  • Inserting records into a table with all caps

    Hello I have a procedure that inserts records into a table. How do I ensure that the text values inserted are recorded all capital letters into the table? Thanks.

  • 80 GB on dropbox but only 250 GB HD

    i seem to be in a constant battle trying to keep my 250 GB HD from filling up. right now i am showing a 80 GB dropbox folder and i am wondering if there is anything i can do about this. i mean, presumably i can take some of this data OFF dropbox and

  • Buffered? Serialized Objects

    I have been playing around with serialization now for months, and sporadically I've been having a very odd problem with objects getting 'stuck' in my client sockets until another object 'pushes them out.' Now, I know that there is no way anything lik

  • Costing relevancy of BOM

    Hi guys, M a bit new in SAP.so this question may sound very basic. My question is when we go to item data in BOM,there is a tab status/lng text. In that tab there is costing relevancy indicator field. If i need it to be x all the time and it should b

  • Using Bluetooth and Headset Together

    I can't get the bluetooth in my car to work with the 8320 when there is also a headset plugged into the phone.  When I get a call it will go through the headset instead of the bluetooth.  Is there any way to make the call go through the bluetooth ins