GrandFather has asked for the wisdom of the Perl Monks concerning the following question:

Is it possible to obtain the original file line number for an XML element in XML::Twig?

I'm in the process of writing a visual diff tool for XML files (for a specific application) and I'd like to be able to propogate changes from one file to the other. Using XML::SemanticDiff I can get line numbers that relate to differences between two XML files. I want to use that information to show the differences in a Tk::Tree widget, but to useful I have to be able to relate specific XML::Twig::Elt instances back to the original file line numbers.


DWIM is Perl's answer to Gödel
  • Comment on Obtain original file line number for an XML element in XML::Twig

Replies are listed 'Best First'.
Re: Obtain original file line number for an XML element in XML::Twig
by mirod (Canon) on Apr 04, 2006 at 06:24 UTC

      Thanks for that. I'd realised that parse time processing of that sort would do the trick, but being lazy (it's a virtue you know), hoped the someone had done the work already. :)


      DWIM is Perl's answer to Gödel
        Being lazy is a virtue if you check the FAQ