Hi HeadScratcher,

tell the difference between the 2 'title' fields

//dft:title means to find the corresponding <title> nodes anywhere in the tree. To select the <title> that is a child of <feed>, use for example /dft:feed/dft:title, or to select <title> nodes that are children of <entry> nodes anywhere in the tree, you could use //dft:entry/dft:title. There are other ways to tell nodes apart, such as using attributes, siblings, etc. - choosing the correct XPath conditions for selecting the nodes is up to you, depending on the structure of the document and your own criteria.

how do I get the value of point?

xmlns="http://www.w3.org/2005/Atom" will be the namespace of nodes that don't have any prefix. So <point> is in that namespace, and in your XPath you've given that namespace the alias dft. The proper XPath expression is then //georss:where/dft:point

Note these aren't really Perl questions, really more like XPath questions, you I'd recommend you look into XPath a bit more.

Hope this helps,
-- Hauke D

Update: s/direct descendant/child/g


In reply to Re: perl XML::LibXML help reading an xml file that uses namespaces (updated) by haukex
in thread perl XML::LibXML help reading an xml file that uses namespaces by HeadScratcher

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.