To get line number for xml file.

how do u get th line number of a particular node i parse.
is it possible only when error comes the line number and mesage can be displayed.
is it possible when i use xpath expression for a particular node and if that xpath returns boolean false then can i get the line number where the node present..??
plz reply..

There are java classes that will give you the line number of records from files you are reading. Names begin with Line...

Similar Messages

  • Getting line number of  XML document

    Hi all,
    Can someone please help me in 'how to get the line number of XML document'. I know when it throws SAXParseException it give the line number. I want to get the line number when it parses the document successfully. I know i need to use setDocumentLocator and then implement the Locator.
    can someone give me a chunk of code for it.
    thx in advance,
    -Soni

    Hi,
    Atlast i got the solution. It goes like this..
    class A {
    Location loc;
    public void setDocumentLocator(Locator l) {
    loc = l;
    //Here goes other methods like startElement, endElement etc.
    public void someMethod() {
    loc.getLineNumber(); //u can do this anywhere inside the class
    -Soni

  • Line Break for XML File

    All,
    I am able to generate xml file from an internal table. The problem is, if I open the file in IE everything looks good. When I open it in notepad or notepad++, everything is in one line. Can you tell me how to generate a line break after each tags.
    Please find the following code used by me for reference.
    LOOP AT lt_ohd INTO ls_ohd.
        ls_temp_ohd = ls_ohd.
        AT FIRST.
          l_ixml = cl_ixml=>create( ).
          l_document = l_ixml->create_document( ).
          l_element_ohd  = l_document->create_simple_element(
                      name = 'OHD'
                      parent = l_document ).
        ENDAT.
        AT NEW cc.
          CLEAR : lv_inhaltskom, lv_text.
          lv_inhaltskom = ls_temp_ohd-cc.
          CALL FUNCTION 'ISM_SELECT_TEXT_JJTIKO'
            EXPORTING
              pv_inhaltskom = lv_inhaltskom
            CHANGING
              pv_langtext   = lv_text.
          TRANSLATE lv_text TO UPPER CASE.
          l_value = lv_text.
          l_element_county  = l_document->create_simple_element(
                      name   = 'city_county'
                      value  = l_value
                      parent = l_element_ohd  ).
        ENDAT.
        AT NEW order.
          l_element_neighborhood  = l_document->create_simple_element(
                      name    = 'entry'
                      parent  = l_element_county  ).
        ENDAT.
        l_value = ls_temp_ohd-neighborhood.
        l_element_address  = l_document->create_simple_element(
                    name   = 'neighborhood'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-address_detail.
        l_element_address  = l_document->create_simple_element(
                    name   = 'address_detail'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-order.
        l_element_address  = l_document->create_simple_element(
                    name   = 'order'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-item.
        l_element_address  = l_document->create_simple_element(
                    name   = 'item'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-cc.
        l_element_address  = l_document->create_simple_element(
                    name   = 'cc'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-address.
        l_element_address  = l_document->create_simple_element(
                    name   = 'address'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-price.
        l_element_address  = l_document->create_simple_element(
                    name   = 'price'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-bed.
        l_element_address  = l_document->create_simple_element(
                    name   = 'bed'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-bath.
        l_element_address  = l_document->create_simple_element(
                    name   = 'bath'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-opentime.
        l_element_address  = l_document->create_simple_element(
                    name   = 'opentime'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-state.
        l_element_address  = l_document->create_simple_element(
                    name   = 'state'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-zip.
        l_element_address  = l_document->create_simple_element(
                    name   = 'zip'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_streamfactory = l_ixml->create_stream_factory( ).
        l_ostream = l_streamfactory->create_ostream_itable( table = lt_xml_table ).
        l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                              document = l_document ).
        l_rc = l_renderer->render( ).
        l_xml_size = l_ostream->get_num_written_raw( ).
      ENDLOOP.
    Regards,
    Salil
    Edited by: salil vaidya on Jan 18, 2011 2:34 PM

    Thanks.
    But now, I have a syntax error.
    BEGIN OF xml_line,
              data(256) TYPE x
    END OF xml_line.
    DATA: lt_xml_table      TYPE TABLE OF xml_line,
          ls_xml_table      TYPE xml_line.
    LOOP AT lt_xml_table INTO ls_xml_table.
        CONCATENATE ls_string cl_abap_char_utilities=>cr_lf INTO ls_string.
        MODIFY lt_xml_table FROM ls_xml_table INDEX sy-tabix.
        CLEAR : ls_xml_table, ls_string.
      ENDLOOP.

  • OracleSOA - File Adapter - Correct mechanism to get the line number from the file

    We are using Oracle SOA process to read data from a file, process the data and write it to the database. SOA process is created using Oracle File Adapter to read the data, Oracle BPEL to transform & process the data and Oracle DB Adapter to write the data into the database.
    Oracle File Adapter uses native schema to process the fixed length data in the file. The number of rows in the file may exceed more than 500,000, to support processing of large files we use chunk size in the file adapter as 4000 rows. In each read operation, file adapter reads the data that matches to the schema, there might be few rejected rows as well.
    Oracle File Adapter property - jca.file.LineNumber gives me only the line number till what line the data is read. Is there any way to get the line number in the xml message, which exactly matches to the line number in the file.?
    Flat File Format: (Every file has one header, trailer and multiple data lines),
    HEADER02 -
    L01
    L01
    L01
    TRAILER02
    Line number is one of the crucial requirement in the development of the SOA service, this is used to back trace the information from which source and line the data has come.

    Hi Anshul,
    Thanks for sharing your thoughts.
    I am using DB adapter to insert the data into db.
    While doing the xsl transformation I can get the index of the message using position(), but that is not the correct way as there can be rejected lines by the file adapter.
    Even if I maintain a local counter variable, it will not consider rejected lines and increment that, which is not correct.
    Thanks,
    Ravindra

  • Best practice for reducing the number of XML files in an IDML file for translation?

    Our engineering team is looking for ways for us to reduce the number of XML files produced when a (relatively) simple 2-page INDD file is saved out as IDML for translation?

    IDML contains quite a few XML files, but I suspect you're only interested in the Stories folder if you're working on a translation. The way to do that is... to reduce the number of stories. If it's a two-pager, chances are that you have a whole bunch of unthreaded text frames. Thread them in logical reading order. This will help the translator(s) as well - by threading frames in logical reading order, they don't have to work to read the document in the same order as the target audience.

  • How to get the line number of source file?

    Hi,
    What is the equivalent in Java of the __LINE__ and __FILE__ macros in C? I want to print out the line number and the file name where the instruction is being executed.
    Thanks,

    If you are doing this because you're implementing your own debug logging, have a look at Log4J.
    You can configure it to log classnames, method names and line numbers of the code you're executing.

  • Dynamic number of xml files with a specified max size

    Hi all,
    I'm using a custom report to generate xml files (via a ST program and a call transformation) containing
    data belonging to is-u invoices (some are much more complex and rich of data than other ones).
    I'm asked to generate the minimun number of xml files, the only limit is their maximum size (40 MB).
    How can I dynamically understand when I need to save an xml file and generate the next one if the
    size is only readable after the transformation,as far as I know?
    Thanks a lot in advance for your ideas.
    Angelo

    My problem is that different users may be loading different files.
    As there may be many simultaneous users and the xml document nodes do not get edited in any way, I only want to have one copy of each file in memory .... hence the application scope.
    If I make the var name fixed then a user loading xml2.xml would overwrite any previous file xml1.xml or whatever.
    I could switch to session scope but that would load possibly hundreds of copies of any given file at any given time and the files are not small :-(
    Keith

  • How use locator with sax to get line number of an element?

    dear friends,
    it's clearly stated in subject. after trying for hours, i still couldn't figure out how to get line numbers. my class extends defaulthandler. please help.
    ozgur

    hi
    i am also struggling with same problem
    someone plssssssss help.....
    how can i use Locator to get line number of the XML document.
    in my extended DefaultHandler class i have just implemented this,
    public void setDocumentLocator(Locator location) {
         lineNumber = location.getLineNumber();
    but no help...
    how to register my parser to the documnet locator events?
    plzzzzzzz help...
    -Soni

  • Get line number error

    Hi
    Is there some way to get line number error when there is some exception ?
    I use oracle 9.2.02
    thank you in advance

    sybrand_b wrote:
    When you trap the exception you need to use dbms_utility.format_error_stack.
    Thid will not provide correct line numbers. This issue has been resolved in 10g or 11g, and 9iR2 is going completely out of support in July.FORMAT_ERROR_STACK will not provide any line numbers:
    SQL> select * from v$version
      2  /
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    SQL> set serveroutput on format word_wrapped
    SQL> begin
      2      raise no_data_found;
      3    exception
      4      when no_data_found
      5        then
      6          dbms_output.put_line('ERROR_STACK: ' || DBMS_UTILITY.FORMAT_ERROR_STACK);
      7          dbms_output.put_line('ERROR_BACKTRACE: ' || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
      8  end;
      9  /
    ERROR_STACK: ORA-01403: no data found
    ERROR_BACKTRACE: ORA-06512: at line 2
    PL/SQL procedure successfully completed.
    SQL>  SY.

  • Where can I get serial number for Lightroom to start using it?

    Hello. I have just created Adobe CC account and purchased a Photography membership plan for Individuals. The price is 9,99 per month and this sum has already been taken from my card. On this page (https://accounts.adobe.com/plans) I can see the confirmation that I have obtained this plan.
    Now I want to use Lightroom but it asks me for serial number. After reading some help I found that I should get serial number from here - https://www.adobe.com/account.html. But on this page it says that "You have no registered products.". So I see no serial number.
    So there's a simple question - where can I get serial number for Lightroom to start using it?

    Jeff, thanks for your answer but it doesn't help. I've successfully passed all checks on page Sign in, activation, or connection errors | CS5.5 and later . My internet connection is ok, hosts file ok, certificates ok, etc. It's not a source of the problem.
    I've found that on page Adobe ID it says that I have free membership. Somehow it turns that my purchased Photography membership plan is not there at all. in order to proof that I really purchased it please see screen from my internet-banking page below:
    Why it is displayed only free membership in my account page and not Photography subscription which was already paid?

  • How to assign Line Number for Lines when click on Add More Lines

    Hello All,
    Kindly help me to assign line number for the lines which are added through Add More Lines button on an Advance table. If user clicks on the button Add More Lines then there are 5 lines get inserted at a time but I am not able to handle the line number for them.
    Similarly, if user delete any of the line then I need to re-order them.
    Kindly help and share if there is any sample code.
    Thanks,
    Sandy

    Hi,
    Check if this link helps you :
    Re: How to display serial numbers in the results table region
    --Sushant                                                                                                                                                                                                                                                           

  • How to get Line Number in Purchase Order

    Hi Experts
    I want to get Line Number of Matrix of Purchase Order. How I get it ?
    I want to compare Matrix Line Number with Line Number of POR1 in DB.
    Please Help me.
    Hepil Doshi

    Hi Hepil,
    Linenum in Matrix "38" is Columns.Item("110").Value
    SBO application doesnot show it, but you can get the linenum from that column.
    You can test by getting the column title. omatrix.columns.item("110").Title
    Hope it helps.
    Regards
    Edy

  • How to add payment advice for XML file filed in vendor account group

    Hi All,
    I have a requirment to add Payment advice for XML file field in vendor account group under payment transcation tap,
    kindly advice where i can add above mention field in vendor account group.
    thanks
    khaja

    done

  • Make DW default for XML files?

    I'm sure there's a way to do this that I'm missing, but I'd like to make DW my default app for XML files.  I know how this can be done on Windows (using "open with" and changing default), but I'm using Mac OSX.  I tried messing with the file types section of DW's preferences, but it didn't work.  Anyone know how to fix this?  Thanks.

    In the Mac Finder, select an XML file, and click More Info (or press Cmd+I - that's I, not a lowercase L) to bring up an Info panel. Expand the section that says Open With, and then select Dreamweaver from the pop-up menu (click Other, if it's not listed). Then click the Change All button to apply it to all XML files.

  • I keep getting the message This XML file does not appear to have any style information axxociated with it. The document tree is shown below Is this a serious problem?

    My daughter and i use same computer she uses firefox and recently we have noticed on facebook apps we get the message This XML file does not appear to have any style information axxociated with it. The document tree is shown below

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

Maybe you are looking for

  • I want to remove RRUBackup folder from my hard drive - T43

    elloo, I like to remove my RRUBackup from my hard drive. I tried to use Restore & Recovery tool however there is not an option to delete the directory. Can some one help me please? Thanks in advance. 

  • Creating detail and summary report tabs

    Hi Everyone, I want to create two reports on the same query infact two tabs one showing the summary and the other one showing the details.Suppose I have a column Plant in the summary report tab.I want when I click on a particular plant the detail of

  • Passing parms to sql query in dbadapter

    I have a simple query to a sql server db set of tables. I have 2 parms that I will use coming from an external site using my service created in BPEL. How do I incorporate these parms in my query. ie syntax. I know what I need to do just do not know t

  • Does Elements 3 not support 14 bit images?

    I just purchased a Nikon V ED scanner so that I could start digitizing my 4000 or so analog images. As I've begun my first experiments I started noticing that sometimes when I scan an image and then open it in in Elements, the majority of the tools d

  • Forms 5.0 and java

    Whether we can call java classes in form. If yes how?