http://www.perlmonks.org?node_id=1043053

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

<book> <book:chapter id="bk444444ch1" type="CHAPTER"> <book:locator xlink:href="/book/isbn/979-0-4444-1000-17/book-part/chap +ter/bk444444ch1?releaseStatus=RELEASED" xlink:title="Photonic crystal + light-emitting sources" xlink:type="locator" xmlns:xlink="http://www +.w3.org/1999/xlink"/> <book:locator xlink:href="/book/isbn/979-0-4444-1000-17/book-part/chap +ter/bk444444ch1?releaseStatus=RELEASED&amp;format=pdf" xlink:title="P +hotonic crystal light-emitting sources" xlink:type="locator" xmlns:xl +ink="http://www.w3.org/1999/xlink"/> <book:locator xlink:href="/book/isbn/979-0-4444-1000-17/book-part/chap +ter/bk444444ch1?releaseStatus=RELEASED&amp;format=epub" xlink:title=" +Photonic crystal light-emitting sources" xlink:type="locator" xmlns:x +link="http://www.w3.org/1999/xlink"/> </book>
How can i get "xlink:href" of first instance of book:locator?

Replies are listed 'Best First'.
Re: How to parse xml with namespase vale in XMl:LibXML? ( XPath error : Undefined namespace prefix )
by Anonymous Monk on Jul 08, 2013 at 09:21 UTC
        But when I am trying to access the nodes as below I don't get any value.
        print $chapter_node->findvalue('./book:locator/@xlink:href') . "\n";
        Could you please elaborate a bit or point out where I am committing mistake?