Blank spaces while using GUI_DOWNLOAD for Chinese characters

Hi,
While using GUI_DOWNLOAD for chinese characters I have used a code page option of 8300 for Chinese.
The file which is getting downloaded in a notepad has some Chinese characters coming under some headings.
After that columns other columns are getting shifted towards the right.
This is working correctly for English characters.
Can someone please help me.
Now I am using CL_GUI_FRONT_END_SERVICES=>GUI_DOWNLOAD.
What special options should I pass now.
Regards,
Subhashini

Hi,
I only solved my problem by using different code pages 8400 and 8300 for Chinese and Taiwanese characters.
I fixed the lengths of the fields by converting them to hexadecimal string and back to string using these function modules as below.
DATA:lv_xstring TYPE xstring,
       lv_temp TYPE string.
  DATA: lv_conv TYPE REF TO cl_abap_conv_in_ce.
  lv_temp = p_name.
  CALL FUNCTION 'HR_KR_STRING_TO_XSTRING'
    EXPORTING
      codepage_to      = p_codepage
      unicode_string   = lv_temp
      out_len          = p_outlen
    IMPORTING
      xstring_stream   = lv_xstring
    EXCEPTIONS
      invalid_codepage = 1
      invalid_string   = 2
      OTHERS           = 3.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
   EXPORTING
     from_codepage = p_codepage
     in_xstring    = lv_xstring
     out_len       = p_outlen
   IMPORTING
     out_string    = p_string.
Create a Conversion Instance
lv_conv = cl_abap_conv_in_ce=>create(
encoding = p_codepage
input = lv_xstring ).
v_conv->read( IMPORTING data = p_string ).
Regards,
Subhashini

Similar Messages

  • Is there anything to be taken care of while using GUI_DOWNLOAD in ITS?

    Hi All,
             I have a requirement on which I am using GUI_DOWNLOAD for downloading a file into a network Drive.In the foreground I am executing using ITS.When I click on 'SUBMIT' button it goes to "Interpreter failed ...Internal error code: 0x2101".Till the point of GUI_DOWNLOAD its working fine.When I am executing from SAP system,its working fine.Once I execute from browser only problem comes.Have anybody faced a similiar situation and if so please help me.
    Thanks in Advance,
       Anjaly

    Hi Anjaly,
    this means that the template could not be found. I assume you are using the ITS 620, in the integrated ITS this error would result in an ABAP runtime error.
    Ok, how to solve? Please examine the ITS trace files especially that one for the Bussiness HTML interpreter. Its is Agate<N>_sapjulep.trc.
    best regards
    Tobias

  • Need to include header in csv file while using GUI_DOWNLOAD

    Hi,
    Iam using GUI_DOWNLOAD for downloading certain texts,its working fine.now i need to include the header(i'e) some text say 'This is a error file'at the top.how can i do this?

    REPORT  ZTEST12347                              .
    DATA: BEGIN OF ITAB OCCURS 0,
            VBELN LIKE VBAK-VBELN,
            POSNR LIKE VBAP-POSNR,
          END OF ITAB.
    SELECT VBELN
           POSNR
          FROM VBAP
          UP TO 20 ROWS
          INTO TABLE ITAB.
    DATA: IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE.
    IT_LINE-TDLINE = 'this is error file'.
    append it_line.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                = 'C:test.txt'
      TABLES
        DATA_TAB                = IT_LINE
      EXCEPTIONS
        FILE_WRITE_ERROR        = 1
        NO_BATCH                = 2
        GUI_REFUSE_FILETRANSFER = 3
        INVALID_TYPE            = 4
        NO_AUTHORITY            = 5
        UNKNOWN_ERROR           = 6
        HEADER_NOT_ALLOWED      = 7
        SEPARATOR_NOT_ALLOWED   = 8
        FILESIZE_NOT_ALLOWED    = 9
        HEADER_TOO_LONG         = 10
        DP_ERROR_CREATE         = 11
        DP_ERROR_SEND           = 12
        DP_ERROR_WRITE          = 13
        UNKNOWN_DP_ERROR        = 14
        ACCESS_DENIED           = 15
        DP_OUT_OF_MEMORY        = 16
        DISK_FULL               = 17
        DP_TIMEOUT              = 18
        FILE_NOT_FOUND          = 19
        DATAPROVIDER_EXCEPTION  = 20
        CONTROL_FLUSH_ERROR     = 21
        OTHERS                  = 22.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                = 'C:test.txt'
        APPEND                  = 'X'
      TABLES
        DATA_TAB                = ITAB
      EXCEPTIONS
        FILE_WRITE_ERROR        = 1
        NO_BATCH                = 2
        GUI_REFUSE_FILETRANSFER = 3
        INVALID_TYPE            = 4
        NO_AUTHORITY            = 5
        UNKNOWN_ERROR           = 6
        HEADER_NOT_ALLOWED      = 7
        SEPARATOR_NOT_ALLOWED   = 8
        FILESIZE_NOT_ALLOWED    = 9
        HEADER_TOO_LONG         = 10
        DP_ERROR_CREATE         = 11
        DP_ERROR_SEND           = 12
        DP_ERROR_WRITE          = 13
        UNKNOWN_DP_ERROR        = 14
        ACCESS_DENIED           = 15
        DP_OUT_OF_MEMORY        = 16
        DISK_FULL               = 17
        DP_TIMEOUT              = 18
        FILE_NOT_FOUND          = 19
        DATAPROVIDER_EXCEPTION  = 20
        CONTROL_FLUSH_ERROR     = 21
        OTHERS                  = 22.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • How to improve the load performance while using Datasources for the Invoice

    HI All,
    How to improve the  load performance while using Datasources for the Invoice . Actually my invoice load (Appx. 0.4 M records) is taking very long time nearly ~16 to 18 hrs  to update data from R/3 to 0ASA_DS01.
    If I load through flat file it will load with in ~20 Min for the same amount of data.
    Please suggest how to improve load performance.
    PS: I have done the Inpo package settings as per the OSS note.
    Regads
    Srininivasarao.Namburi.

    Hi Srinivas,
    Please refer to my blog posting [/people/divyesh.jain/blog/2010/07/20/package-size-in-spend-performance-management-extraction|/people/divyesh.jain/blog/2010/07/20/package-size-in-spend-performance-management-extraction] which gives the details about the package size setting for extractors. I am sure that will be helpful in your case.
    Thanks,
    Divyesh
    Edited by: Divyesh Jain on Jul 20, 2010 8:47 PM

  • Is there a way to use proper mainland chinese characters on an ipad instead of the apple variants?

    I have been learning Chinese at University, and I bought an iPad to help my studies and I have found that Apple for the international keyboard has variants for many different chinese characters. Why is this and is there a way to use the chinese characters that 1.6 billn people use rather than the Apple variants? Will Apple be addressing this at all?

    No, The simple and traditional are fine, but when typing in simplified there choices for say, 将 or 骨 are different from both Simplified and Traditional entirely. If I had copied Apple's characters in tests I would have lost grades. I've never seen it happen on another operating system and unfortunatley Microsoft beats Apple in this field; hence why I call them Apple variants. I'm not the only one who has see this problem. The only way to get what I would call authentic chinese characters is with the method that is stated above. I found this solution in the thread titled "Chinese characters misrepresented". There are screen shots there too. I would love to find out how/why Apple chose this system for chinese.

  • Extra Carriage Return While Using GUI_DOWNLOAD in ASC Mode

    Dear All,
    Happy New Year..First of All!
    We are facing a problem in using FM GUI_DOWNLOAD for downloading internal table data in ASC Format. The FM seems to be adding one extra Line Feed / Carriage Return in the end of the file. We have debugged the code, and found that the internal table is populated correctly,but after the FM is called and the file is downloaded to the PC, we find that there is one extra blank line that is appended after the data. We have gone through some similar topics in SDN , some of them being:
    GUI_DOWNLOAD : Extra Line
    gui_download - last line
    GUI_DOWNLOAD
    We are already using the parameters TRUNC_TRAILING_BLANKS = 'X', TRUNC_TRAILING_BLANKS_EOL = 'X' and WRITE_LF_AFTER_LAST_LINE = ' ', with no effect. Also tried searching in OSS, but did not find a proper note. Can anybody please throw some light on this problem?
    Thanks and Sincere Regards,
    Amitabha

    Hi...
    If you can not ignore this problem. Because it download data line by line. First it set the cursor then download one record and so. For final record it it download the record then set the cursor to next line. Then it check that no more lines in the internal table. Then it exit from the FM.
    Thank
    Subhankar.

  • Using Gui_download for excel output

    Hi,
    I am using gui_download to output in excel format, my requirement is i want to start records from 3rd row in excel.
    On first row first column title shoud come? Second row blank,  i used fieldname for header in export paramenter from 3rd row.
    Plz help me to sove this issue.
    Thanks in advance.
    Vishnu.

    Hi vishnu,
    Here is the sample code below.
    *& Report  ZVK_TEST1
    REPORT  zvk_test1.
    TYPES:BEGIN OF ty_ekko,
            ebeln TYPE ekko-ebeln,
            bukrs TYPE ekko-bukrs,
    END OF ty_ekko.
    TYPES:BEGIN OF ty_fields,
            field TYPE dd03l-fieldname,
          END OF ty_fields.
    DATA:lt_ekko TYPE STANDARD TABLE OF ty_ekko,
         lt_dummy TYPE STANDARD TABLE OF ty_ekko.
    DATA:lw_ekko TYPE ty_ekko.
    APPEND INITIAL LINE TO lt_dummy.
    APPEND INITIAL LINE TO lt_dummy.
    SELECT ebeln bukrs INTO TABLE lt_ekko
      FROM ekko UP TO 10 ROWS.
    DATA:lt_fields TYPE TABLE OF ty_fields,
         lw_field TYPE ty_fields.
    lw_field-field = 'PO NUMBER'.
    APPEND lw_field TO lt_fields.
    lw_field-field = 'COMPANY CODE'.
    APPEND lw_field TO lt_fields.
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
       bin_filesize              =
        filename                  = 'C:\Documents and Settings\krishnavatte\Desktop\kris.xls'
        filetype                  = 'ASC'
      CHANGING
        data_tab                  = lt_dummy
      EXCEPTIONS
        file_write_error          = 1
        no_batch                  = 2
        gui_refuse_filetransfer   = 3
        invalid_type              = 4
        no_authority              = 5
        unknown_error             = 6
        header_not_allowed        = 7
        separator_not_allowed     = 8
        filesize_not_allowed      = 9
        header_too_long           = 10
        dp_error_create           = 11
        dp_error_send             = 12
        dp_error_write            = 13
        unknown_dp_error          = 14
        access_denied             = 15
        dp_out_of_memory          = 16
        disk_full                 = 17
        dp_timeout                = 18
        file_not_found            = 19
        dataprovider_exception    = 20
        control_flush_error       = 21
        not_supported_by_gui      = 22
        error_no_gui              = 23
        OTHERS                    = 24
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
       bin_filesize              =
        filename                  = 'C:\Documents and Settings\krishnavatte\Desktop\kris.xls'
        filetype                  = 'ASC'
        append                    = 'X'
        write_field_separator     = 'X'
        fieldnames                = lt_fields
      CHANGING
        data_tab                  = lt_ekko
      EXCEPTIONS
        file_write_error          = 1
        no_batch                  = 2
        gui_refuse_filetransfer   = 3
        invalid_type              = 4
        no_authority              = 5
        unknown_error             = 6
        header_not_allowed        = 7
        separator_not_allowed     = 8
        filesize_not_allowed      = 9
        header_too_long           = 10
        dp_error_create           = 11
        dp_error_send             = 12
        dp_error_write            = 13
        unknown_dp_error          = 14
        access_denied             = 15
        dp_out_of_memory          = 16
        disk_full                 = 17
        dp_timeout                = 18
        file_not_found            = 19
        dataprovider_exception    = 20
        control_flush_error       = 21
        not_supported_by_gui      = 22
        error_no_gui              = 23
        OTHERS                    = 24
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Manipulating excel file while using GUI_DOWNLOAD

    hi all,
    while using GUI_UPLOAD i want to
    1) fix the width of the column of excel file
    2) define the font of the data in excel file
    3) change background color of the cells in excel file.
    please suggest as to how can this be done?

    using GUI_DOWNLOAD you can't change the data in excel sheet...if you want to do the things you need to use OLE concpets for downloading of data to Excel sheet wherein you can do most of the options excel can handle..
    Check within SDN as there are blogs for downloading data to Excel sheet using OLE concepts..

  • Convert spool to pdf for Chinese characters

    Hi,
       I need to convert spool to pdf for chinese font.
       Spool is creating successfully, and contents are displaying properly. When try to convert the spool to pdf using 'RSTXPDFT4', the pdf is generated successfully, when trying open the pdf, contents are missing, its like empy white pdf page. This is happening for the Chinese font. The same script is working fine for the English font.
    Plz suggets
    Thanks
    Balaji

    Hi Balaji,
    I am having a similar issue with Simplified Chinese, Traditional Chinese, and Thai fonts when saving spools to PDF.  Have you found any more information on why the output shows up as a blank screen?
    We are printing Purchase Orders and the T&Cs are coming through fine because they are saved as picture files but the smartform does not display at all.
    Any information would be appreciated!
    Thanks,
    Josh

  • Issue Searching for Chinese Characters

    I am creating pdfs from SQL Server Reporting Services. I have the data stored in Chinese characters and it displays fine when the files are opened. Our problem is we are unable to search for any Chinese characters. When we copy a Chinese character from the document and paste into the search box we get the following and it does not find the characters.   
    When I inspect the Fonts it has the following :
    Calibri /regular/bold/Italic (Embedded Subset)
         Type:True Type
         Encoding:Ansi
    PMingLiU (Embedded Subset)
         Type:True Type
         Encoding:Ansi
    PMingLiU (Embedded Subset)
         Type:True Type(CID)
         Encoding:Identity-H
    Do I need to install different fonts on my server or clients to make the search box recoginize the Chinese characters.
    I am using Reader v10.1.7 and I have installed both Chinese font packs

    What is your operating system?
    I cannot reproduce this with English Reader 11.0.3 on Windows 7.  I open a random Chinese document (i.e. http://newyork.china-consulate.org/chn/lszj/P020110622119203610776.pdf), then search for some Chinese characters (e.g. 中国), it displays it correctly in the search box, and also finds the characters in the document:
    Do you use the English or Chinese Reader version?

  • Blank screen while using a ati radeon x1300 pro graphics card

    i'm getting a blank screen at start up while using my radeon x1300 pro... dont really know whats wrong with it. the agp slot is good, i'm getting power to the card, my board is set to boot agp/pci for the video so thats good. only problem is is that i'm not sure what the model of my motherboard is to check with compatiblity. got the mb and processor from a buddy of mine. he got the mb and processor from a friends grandpa... so to make long storys short. i have no idea what my computer is made of but from what i hear ati products dont seem to get along well with msi. is there any logical reason? and if so is there anything that i have overlooked here? common problems and such. i've updated everything i could update but still no signs of life comming from my video card " and yes the card was pushed in all the way". any feed back would be appreciated.

    Example of what system spex should look like:-
    MSI P865 Platinum with 3.A bios ( MS-6728 VER 2 )
    Enermax 465 20 pin PSU +3.3V = 35A +5V = 35A +12V = 33A
    Intel P4 Northwood 3.0Ghz (No overclock) (Arctic cooling Freezer HSF unit with Coolalabs thermal metal coolant)
    512Mb Corsair XMS ddr400 memory (2x256Mb in dual mode)
    Trust Dugital Pci Sound card
    Nvidia 6800GT 256Mb memory AGP card (No overclock)
    80Gb Western Digital IDE hard disk on Primary
    LG DVD IDE optical drive on Secondary
    Jeantech Phong case (120mm in front intake and 120mm at back exhaust)
    Win 98 SE (Del modded edition)
    I am sure this will help you.
    Del

  • Displaying while changing charset for chinese mail?

    hi,
    It seems pretty weird but when I change the charset of a mail message e.g from big5 to gb2312 and send it again to outlook express the chinese characters don't seem to be the same. If however the charset is not changed the email send seems to be fine.
    If the charset is changed and the body is written to a text file using the new charset every thing seems to be fine too.
    Is it something to do with the outlook settings or with the application itself?
    It seems pretty awkward to me since I feel if it is working in the text file the conversion should also work while sending a message.
    Any ideas?
    regards,
    Khurram

    hope it works:
    messageBody.setHeader("Mime-Version" , "1.0" );
    messageBody.setHeader("Content-Type" , "text/plain");
    messageBody.addHeader("Content-Type", "charset=UTF-8");
    // You can see chinese with this
    messageBody.setHeader("Content-Language","zh-cn");
    messageBody.setHeader("Content-Transfer-Encoding", "quoted-printable");
    I try to do it ,and it works fine

  • Problem on zero's while using gui_download

    Hi,
    While downloading the internal table content for ex. ‘000010’ to Excel sheet by using ‘GUI_DOWNLOAD’ , zero’s are truncated and becomes  ‘10’(in this case).
    Is it any possible way to get as like ‘000010’?
    Thanks

    give the FILETYPE as  <b>DBF</b>  and checkout if it works
    or
    in the excel file , right click on that column>format cellschoose text

  • Getting outOfMemory while using Xpath for 6MB file

    Hi ,
    Requirement:
    I have thousands of xml files of variable size (mostly around 5MB), Total size is around 20GB .The structure of xml content is as follows.
    filename: xaaaa
    <file>
    <page>
    <title>AmericanSamoa</title>
    <id>6</id>
    <revision>
    <id>133452270</id>
    <timestamp>2007-05-25T17:12:06Z</timestamp>
    <contributor>
    <username>Gurch</username>
    <id>241822</id>
    </contributor>
    <minor />
    <comment>Revert edit(s) by [[Special:Contributions/Ngaiklin|Ngaiklin]] to last version by [[Special:Contributions/Docu|Docu]]</comment>
    <text xml:space="preserve">#REDIRECT [[American Samoa]]{{R from CamelCase}}</text>
    </revision>
    </page>
    My task is to retrieve the ID , filename in which it exists and the position of node in the page, and i have to write it to a file.
    ex: 6:xaaaa:1
    My approach:
    I am using Xpath for this. The code is as follows.
    */*XPathReader.java*/*
    package preprocess;
    import java.io.IOException;
    import javax.xml.XMLConstants;
    import javax.xml.namespace.QName;
    import javax.xml.parsers.*;
    import javax.xml.xpath.*;
    import org.w3c.dom.Document;
    import org.xml.sax.SAXException;
    public class XPathReader {
    private String xmlFile;
    private Document xmlDocument;
    private XPath xPath;
    public XPathReader(String xmlFile) {
    this.xmlFile = xmlFile;
    initObjects();
    private void initObjects(){       
    try {
    xmlDocument = DocumentBuilderFactory.
                   newInstance().newDocumentBuilder().
                   parse(xmlFile);
    xPath = XPathFactory.newInstance().
                   newXPath();
    } catch (IOException ex) {
    ex.printStackTrace();
    } catch (SAXException ex) {
    ex.printStackTrace();
    } catch (ParserConfigurationException ex) {
    ex.printStackTrace();
    public Object read(String expression,
                   QName returnType){
    try {
    XPathExpression xPathExpression =
                   xPath.compile(expression);
    return xPathExpression.evaluate
                   (xmlDocument, returnType);
    } catch (XPathExpressionException ex) {
    ex.printStackTrace();
    return null;
    XpathReaderTest.java
    /* it takes directory name as argument, this directory contains xml file*/
    package preprocess;
    import java.io.*;
    import javax.xml.xpath.XPathConstants;
    import org.w3c.dom.*;
    public class XPathReaderTest {
    public XPathReaderTest() {
    public static void main(String[] args) throws IOException{
         if (args.length <= 0) {
              System.out.println(
              "Usage: java PreProcess dir_name"
              return;
              String dir=null;
              if (args.length >= 1) dir = args[0];
              int indexno=0;
              File directory = new File(dir);
              File[] files = directory.listFiles();
              FileWriter fstream = new FileWriter("index"+indexno+".txt");
         BufferedWriter out = new BufferedWriter(fstream);
         XPathReaderTest xt=new XPathReaderTest();
              /*for (int index = 0; index < files.length; index++)
                   System.out.println(files[index].toString());
              for (int index = 0,i=1; index < files.length; index++)
                   /*if(index/100>indexno){
                        indexno++;
                        out.close();
                        fstream = new FileWriter("index"+indexno+".txt");
                   out = new BufferedWriter(fstream);
                   xt.extract(files[index].toString(),index,i,out);
                   System.gc();
              out.close();
    public void extract(String completepath,int index,int i,BufferedWriter out)
    throws IOException
         System.out.println(index+" "+completepath);
              XPathReader reader = new XPathReader(completepath);
              String separator = File.separator;
              int pos = completepath.lastIndexOf(separator);
              String temp_fname=completepath.substring(0,pos);
              pos=temp_fname.lastIndexOf(separator);
              String f_name= completepath.substring(pos+1);
              i=1;
              while(true)
              String expression = "/file/page["+i+"]/id";
              String id_value= (String) reader.read(expression, XPathConstants.STRING);
              if(id_value=="")
                   break;
              out.write( id_value + ":"+ f_name+ ":"+i+ "\n" );
    i++;
    Problem:
    This code works fine for xml files < 6MB, but its giving outOfMemory for 6MB and above file.
    I have tried with -Xms256m -Xmx512m option.
    Please suggest the work around , or any modification to code that will resolve my problem.
    I am new to java world , so problem root cause will be very helpful for me.
    Thanks

    Hi ,
    Requirement:
    I have thousands of xml files of variable size (mostly around 5MB), Total size is around 20GB .The structure of xml content is as follows.
    /*filename: xaaaa*/
    <file>
    <page>
        <title>AmericanSamoa</title>
        <id>6</id>
        <revision>
          <id>133452270</id>
          <timestamp>2007-05-25T17:12:06Z</timestamp>
          <contributor>
            <username>Gurch</username>
            <id>241822</id>
          </contributor>
          <minor />
          <comment>Revert edit(s) by [[Special:Contributions/Ngaiklin|Ngaiklin]] to last version by [[Special:Contributions/Docu|Docu]]</comment>
          <text xml:space="preserve">#REDIRECT [[American Samoa]]{{R from CamelCase}}</text>
        </revision>
      </page>
    </file>My task is to retrieve the ID , filename in which it exists and the position of node in the page, and i have to write it to a file.
    ex: 6:xaaaa:1
    My approach:
    I am using Xpath for this. The code is as follows.
    */*XPathReader.java*/*
    package preprocess;
    import java.io.IOException;
    import javax.xml.XMLConstants;
    import javax.xml.namespace.QName;
    import javax.xml.parsers.*;
    import javax.xml.xpath.*;
    import org.w3c.dom.Document;
    import org.xml.sax.SAXException;
    public class XPathReader {
        private String xmlFile;
        private Document xmlDocument;
        private XPath xPath;
        public XPathReader(String xmlFile) {
            this.xmlFile = xmlFile;
            initObjects();
        private void initObjects(){       
            try {
                xmlDocument = DocumentBuilderFactory.
                   newInstance().newDocumentBuilder().
                   parse(xmlFile);           
                xPath =  XPathFactory.newInstance().
                   newXPath();
            } catch (IOException ex) {
                ex.printStackTrace();
            } catch (SAXException ex) {
                ex.printStackTrace();
            } catch (ParserConfigurationException ex) {
                ex.printStackTrace();
        public Object read(String expression,
                   QName returnType){
            try {
                XPathExpression xPathExpression =
                   xPath.compile(expression);
                return xPathExpression.evaluate
                   (xmlDocument, returnType);
            } catch (XPathExpressionException ex) {
                ex.printStackTrace();
                return null;
    XpathReaderTest.java
    /* *it takes directory name as argument, this directory contains xml file**/
    package preprocess;
    import java.io.*;
    import javax.xml.xpath.XPathConstants;
    import org.w3c.dom.*;
    public class XPathReaderTest {
        public XPathReaderTest() {
        public static void main(String[] args) throws IOException{
             if (args.length <= 0) {
                    System.out.println(
                     "Usage: java PreProcess dir_name"
                    return;
              String dir=null;
              if (args.length >= 1) dir = args[0];
              int indexno=0;
              File directory = new File(dir); 
              File[] files = directory.listFiles();
              FileWriter fstream = new FileWriter("index"+indexno+".txt");
             BufferedWriter out = new BufferedWriter(fstream);
             XPathReaderTest xt=new XPathReaderTest();
              /*for (int index = 0; index < files.length; index++)
                   System.out.println(files[index].toString()); 
              for (int index = 0,i=1; index < files.length; index++)
                   /*if(index/100>indexno){
                        indexno++;
                        out.close();
                        fstream = new FileWriter("index"+indexno+".txt");
                       out = new BufferedWriter(fstream);
                   xt.extract(files[index].toString(),index,i,out);
                   System.gc();
              out.close();
        public void extract(String completepath,int index,int i,BufferedWriter out)
        throws IOException
             System.out.println(index+" "+completepath);
              XPathReader reader = new XPathReader(completepath);
              String separator = File.separator;
              int pos = completepath.lastIndexOf(separator);
              String temp_fname=completepath.substring(0,pos);
              pos=temp_fname.lastIndexOf(separator);
              String f_name= completepath.substring(pos+1);
              i=1;
              while(true)
              String expression = "/file/page["+i+"]/id";
              String id_value= (String) reader.read(expression, XPathConstants.STRING);
              if(id_value=="")
                   break;
              out.write( id_value + ":"+ f_name+ ":"+i+ "\n" );
            i++;
    }Problem:
    This code works fine for xml files < 6MB, but its giving outOfMemory for 6MB and above file.
    I have tried with -Xms256m -Xmx512m option.
    Please suggest the work around , or any modification to code that will resolve my problem.
    I am new to java world , so problem root cause will be very helpful for me.
    Thanks

  • ORE 1.3 support for Chinese characters?

    I'm using ORE 1.3 on Linux, and my database tables have some fields containing Chinese string values. These Chinese string can be displayed correctly in Oracle SQL Developer, but in ORE 1.3 when I pull data into a data.frame, they are displayed as '????'. It is the same when I use ORE 1.3 Windows client. I know that R itself can process Chinese characters correctly. So I wonder if ORE 1.3 connections can process Chinese and how to. Thanks!

    Does anyone know how to solve this problem?

Maybe you are looking for

  • Signature in SMS

    I was wondering if soon we could have an update where we have a signature in our SMS messages.

  • Want to "frost" a picture the way you can on picmonkey using PE9

    As mentioned above, on Picmonkey (free online software just for playing around) you can "frost" a photo which I personally like the effect but need to know how to do this in PSE9.  PicMonkey is just for playing around as I can upload a 10mb photo and

  • Function call from button works then vanishes if I click anywhere

    I have the following code and it works great some times but others nothing happens, the button seems to work then for no apparent reason (at least nothing that comes up in the javascript console) I click and it says "FundName.FundTitle.getFundTitle i

  • How to stop internal pricing changing in invoice.

    Dear All, I have taken internal price as an condition in Sale order. if material price changes before actual delivery, then the internal price also changes in invoice. how can i stop from hapenning this. Please help. regards, GHS. Please update. Edit

  • Fixed Deposit Report with TDS Details

    Hello All, Is there any report available to show Fixed Deposit Report with TDS Details ?