Get line/column number from DOM Nodes

Hello,
I'm currently writing an xml editor application.
I want to select the lines of a specified org.w3c.dom.Node or Element when the user selects a Node from a tree, so I must have the line and column number of the selected Node.
I know I can get the location via the Locator during SAX parsing but I need a DOM tree. Of course i could create my own dom classes but then I'd had to rewrite a lot of code and my xpath evaluator (wich currently uses, of course, also w3c.dom classes) won't work together with it.
I'm surely not the first one who needs this function, so there must be a possibility to figure it out. I thought about hacking xerces but probably it was a bad idea.
I hope anyone knows a solution or even a totally other way.
Thanks,
Roar

You might want to look at:
http://cvs.sourceforge.net/viewcvs.py/armedbear-j/j/j/src/org/armedbear/j/XmlParserImpl.java?rev=1.7&view=auto
In general, DOM is not designed for editors, but for applications dealing with XML as an object model, where the lexcal details don't matter.
You could subclass whatever builds the DOM tree from SAX events and add either user data (if using DOM level 3) or and entry in an IdentityHashMap (if not) to the created nodes. You also need to add LexicalHandler support if you want to go into the detail of CDATA sections etc.
Pete

Similar Messages

  • How to get payment document number from paid column in monthly invoice

    Dear experts
    I use SBO japan version and i need to know how to get payment document number from paid column in monthly invoice ?
    in table MIN1, only contain invoice and credit note document number, there is no payment document number
    thank you for your help
    Best Regards
    JeiMing

    Dear Gordon
    Yeah, you are right, i can use field MIentry in RCT2
    thank you
    Best regards
    jeiming

  • Getting the row and column number from the caretposition

    Howdy peeps
    Does anyone know how to find out the Line number and column in a JTextPane by using the caret position
    (you know like in text editors where it says 100:4 [line number:character position on row])
    is there a simple way of doing this in a JTextPane?

    im getting a bit confuzzled with this :(
    can someone help me out with a bit more code orientated help? :$
    i have a jTextArea and a JTextField, when i change the caret in the text area i want the JTextField to show the line number and charater position on the row (e.g. 100:4)
    so i assume i need to methods
    e.g.
    getPaneRow
    myint=myPane.getCaretPosition()
    do some wonderful magic code to get the line number
    return line number
    getPaneColumn
    myint=myPane.getCaretPosition()
    do some wonderful magic code to get the column number
    return column number
    is there a magician out there that can give me the magic powder? :)

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 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.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • How do I get my UDID number from my ipod if I can't plug it into itunes?  Apple took it back because it was broken and gave me a new one but I have games and apps that can only be moved over with the UDID from the old pod.

    How do you get the UDID number from your ipod if you don't have the ipod anymore.  The apple store took it because it wasn't working so I can't plug it in to get the number.  Some of my apps are associated wtih that number and I can't move them to my new Ipad without that number.  Any ideas?

    Hi KT. I restored my information back to November 10th and the one app that I need the info on is still empty like I just downloaded it. Do you have another suggestion? I was able to track down my serial number but can't get the UDID without plugging it in and I no longer have it. Suggestions?

  • Can anyone help me get a serial number from Adobe & Identit-e?

    I bought the Adobe Creative Suite 6 Design Standard Student & Teacher edition through Amazon online. I followed the instructions inside the package to verify my eligibilty as an educator. I received a message on the screen after submitting my materials that I was verified & I would be receiving a serial number.  This was on June 1. I contacted Adobe Chat and a rep. told me to wait 2 -3 business days, but still no email with serial number had arrived. On June 7, I contacted Adobe Chat again and the rep told me to contact customer service at identit-e.  I have sent  identit-e two emails with no response. It has been one week of trying to get my serial number from either Adobe or identit-e.  Can anyone help me get my serial number?
    Product Code <removed by moderator>. 
    My work email is <Removed by moderator>

    Jeff,
    I ordered through Amazon and not through Adobe so there is not a record of my order on the Adobe website.  I do have a record of the order with Amazon so I requested a refund through Amazon.  The product is unusable without the serial number.  It has been 8 days since my eligibility  was verified with identit-e.  I have spoken with three Adobe rep.s and two unanswered email to identit -e trying to get the serial number since I was verified as eligible to receive the student/educator version of Creative Suites. I am very disaapointed with the lack of help I have received from Adobe with this issue.
    Being referred to identit-e or to a FAQ page is not what I needed to solve the problem- I needed the serial number  I have lost complete confidence in Adobe's customer service and that the serial number will ever be provided.
    Kathie

  • My iPod touch was stolen. Can you tell me how I can get the serial number from my iTunes account?, My iPod touch was stolen. Can you tell me how I can get the serial number from my iTunes account?

    My iPod touch was stolen. Can I get the serial number from my iTunes account?

    See the end of:
    - If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up.
    - You can also wipe/erase the iPod and have the iPod play a sound via iCloud.
    - If not shown, then you will have to use the old fashioned way, like if you lost a wallet or purse.
    - Change the passwords for all accounts used on the iPod and report to police
    - There is no way to prevent someone from restoring the iPod (it erases it) using it.
    - Apple will do nothing without a court order                                                
    Reporting a lost or stolen Apple product                                        
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • If my ipod was stolen can i get my serial number from apple?

    how would i get my serial number through apple store if it was stolen today? i need it ASAP beause im in school and the day ends at 1:45...someone help me please

    I don't believe you can get your serial number from Apple since they have know way of knowing that you are indeed you, but you can call Apple tech support at 1-800-275-2273 (if you have a cellphone or can make an 800 call from school) and ask.
    Otherwise, if you have access to a computer to which you synced the iPod, or someone you can call does, you can find the serial number in iTunes on that computer. See:
    http://support.apple.com/kb/HT1459#one
    Regards.

  • HT1349 My Ipad was stolen, How can I get the serial Number from Apple. It was registered with them

    I had  2 Ipads, a mac book pro and a Mac Air stolen 2 weeks ago
    I am trying to locate one of the serial numbers, but cant find the last box.  Can I get the serial number from Apple. It was registered and now it is not showing up as one of my products.
    Thanks

    The easiest way to find your serial number is this Open Itunes...click help... run diagnostics.....(tick or untick as necessary) so that you just have ticked the last two,  device connectivity and device sync.  run these tests. it will say no ipod/ipad found but will give results of test....scroll down to bottom of results... here you will find the serial number of your last attached devices.

  • Getting valid idoc number from the sales document

    hi,
    Iam sending the code for getting the idoc number from sales document.
    but iam not getting the result.
    please see the code and correct the code so that i will get the idoc number from the sales document.
    tables edid4.
    data l_docnum like edid4-docnum.
    parameters:p_vbeln like vbak-vbeln.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
      exporting
        input         = p_vbeln
    IMPORTING
       OUTPUT        = p_vbeln
    select single docnum from edid4 into l_docnum where sdata like '&p_vbeln&'.
    if sy-subrc = 0.
    write edid4-docnum.
    else.
    write ' the record is not found'.
    endif.
    it is very urgent..............
    thanks in advance......

    See the below code :
    report zxyz.
    tables edid4.
    data l_docnum like edid4-docnum.
    parameters:p_vbeln like vbak-vbeln.
    <b>data sdata like edid4-sdata.</b>
    start-of-selection.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
    exporting
    input = p_vbeln
    IMPORTING
    OUTPUT = p_vbeln
    <b>concatenate '%' p_vbeln '%' into sdata.</b>
    select single docnum from edid4 into l_docnum
                  where sdata like <b>sdata.</b>
    if sy-subrc = 0.
    write edid4-docnum.
    else.
    write ' the record is not found'.
    endif.
    Thanks
    Seshu

  • I keep getting an invalid serial number when re-installing Adobe Acrobat 9 I am getting my serial number from my registered products

    I keep getting an invalid serial number when re-installing Adobe Acrobat 9 I am getting my serial number from my registered products

    If it was an upgrade version, it may be you are being asked for the qualifying product S/N and are entering the new S/N instead. That would cause a problem.

  • Can i get my serial number from itunes without connecting my ipod?

    cani i get my serial number from itunes without connecting my ipod?

    Yes, but first you have to make a hat out of aluminum foil, sacrifice 2 pounds of red jelly beans to the serial number god, run around the block three times on one leg while chanting OH Wa Ta Goo Siam.   When you get back home the serial number will be written on a piece of paper inside a mayonaise jar that is buried exactly 49.475 feet NNW of the southeast corner of your house...  But don't tell anyone I told you this....
    Now where's my hat....

  • How to get Accounting document number from billing document number

    Hi,
    How to get Accounting document number from billing document number i.e. from VBAK- VBELN.
    Cheta Pant

    Hi,
    VBAK is the Sale Order header table, Billing document table is VBRK.
    Sales tables (VBAK,VBAP,VBRP,VBRK) do not store accounting document numbers.
    You do other way around. Just go to SE16 and enter the Billing document number in field Billing document VBELN in BSEG or BSID or BSAD table and execute, you will find the accounting document number.
    If you just want collect this information once then you can use table BSEG, but if you think to develope a report then use table BSID and BSAD.
    Regards,
    Chintan Joshi

  • Is There Anyway I Can Get The Serial Number From My iPod Without Actually Having The iPod?

    Is There Anyway I Can Get The Serial Number From My iPod Without Actually Having The iPod?

    - Sign in hee and look:
    My Support Profile
    - On your syncing computer go to iTunes>Preferences>Devices and hover the mouse pointer over the iPod backup and the SN will pop up in a box.

  • Getting SIM card number from iPhone 5

    I just got my iPhone 5.  It's asking me to give my SIM card number in order to activate it online.  The instructions are saying to take the back cover off of the phone. How do I do that?  Doesn't look like I can. I tried using a pin to open the side of it but that didn't work. 

    LyndyB
    Re: Getting SIM card number from iPhone 5 
    Jan 28, 2013 8:22 AM (in response to SallyD79)
    This answer a little late but will post anyway in case another person comes this way:
    If the SIM is already installed in your phone, you can browse to the Settings area and obtain there.
    Settings > General > About
    Locate the ICCID number. It is typically 20 digits long (5 groups of 4 digits).  This is the SIM card number.
    If the Phone was shipped with the SIM installed, this ICCID number is usually written on the label that is affixed to the outsided of the box.
    Hope this helps.
    This worked! Saved me a trip home, and trying to scrounge up a pin...

Maybe you are looking for

  • Error using SAPM --  package SAPKGPAD08

    Hi I am trying to update the EA-APPL packages through SPAM my current patch level is 7 and i am trying to load patch 8 package name SAPKGPAD08 i have checked for all dependencies, extra .. everything ok i get error during import phase.. with exit cod

  • Boot device not found - Please install an operating system on your hard disk

    Trying to boot up this morning gave this error message: "Boot device not found Please install an operating system on your hard disk Hard Disk <3F0> F2  System Diagnostics" Pressing F2 brings up to  the "HP PC Hardware Diagnostics UEFI" page, where it

  • Java 1.4.2. - full heap dump?

    Hello, Is there any possibility to generate full heap dump (core dump) in java 1.4.2. on demand? Best regards, Peter

  • Can you tell if someone is spying on your I phone

    Is there a way to tell if someone is spying on your I phone?

  • Placeholders in After Effects

    Hello After FX forum. I've downloaded a free template which contains 4 placesholder to drag and drop my existing files. But I'd like to make more placeholders for my composition, the problem is I am doing what Ive seen on the net how to make placehol