Glad to see one of my suggestions led to a solution. :-)
As to your additional questions, I'm unfortunately strapped for time (due to airlines still unwilling to tailor their flight plans to my personal needs). Here's some hurried (and untested) suggestions.
From the Abbreviated Syntax link I provided above, see
-
/book/chapter[5]/section[2] selects the second section of the fifth chapter of ...
It looks like you need li[2] (note these indices are 1-based - as opposed to 0-based array indices).
-
text() selects all text ...
Possibly answers "how does one print an element?".
A recent post I made (Re^2: Trouble capturing multiple groupings in regex) has some additional XPath examples. In particular, see the "more involved for loop" (in the spoiler) for printing an entire element.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.