in reply to Re: Get text without children in XML::Twig
in thread Get text without children in XML::Twig

root_text()


DWIM is Perl's answer to Gödel
  • Comment on Re^2: Get text without children in XML::Twig

Replies are listed 'Best First'.
Re^3: Get text without children in XML::Twig
by mirod (Canon) on Dec 07, 2006 at 20:40 UTC

    I am not sure about this one. root is usually reserved for the root of the tree. I would expect root_text to give me the text of the root of the tree (ie whitout the XML declaration and comments/PIs before the root).

    What about text_only? I like the idea of the method being named text_..., so it is obviuus that it returns the text, and so it appears right after text in the online doc ToC, which is sorted by alphabetical order.

      text_only doesn't seem distinct enough from text to me - it's not immediately clear what the difference is. node_text maybe?


      DWIM is Perl's answer to Gödel