in reply to XML::Twig 'cut' and 'paste' Question

In XPATH syntax / specifies an absolute path where as // specefies a relative path. /article/fig/label would work.

See http://www.w3.org/TR/xpath for the full XPATH spec.


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: XML::Twig 'cut' and 'paste' Question
by Ieronim (Friar) on Jul 28, 2006 at 19:57 UTC
    You are not fully right. Directly from the document you cite:
    //para selects all the para descendants of the document root and thus selects all para elements in the same document as the context node
    So //fig/label selects all 'label' childern of all 'fig' elements in the document.

         s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print