Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Using to fixup the xml I get
<?xml version="1.0" encoding="UTF-8"?> <book xmlns:book="http://generated.ns/book"> <book:chapter id="bk444444ch1" type="CHAPTER"> <book:locator xmlns:xlink="" xlink:hre +f="/book/isbn/979-0-4444-1000-17/book-part/chapter/bk444444ch1?releas +eStatus=RELEASED" xlink:title="Photonic crystal light-emitting source +s" xlink:type="locator"></book:locator> <book:locator xmlns:xlink="" xlink:hre +f="/book/isbn/979-0-4444-1000-17/book-part/chapter/bk444444ch1?releas +eStatus=RELEASED&amp;format=pdf" xlink:title="Photonic crystal light- +emitting sources" xlink:type="locator"></book:locator> <book:locator xmlns:xlink="" xlink:hre +f="/book/isbn/979-0-4444-1000-17/book-part/chapter/bk444444ch1?releas +eStatus=RELEASED&amp;format=epub" xlink:title="Photonic crystal light +-emitting sources" xlink:type="locator"></book:locator> </book:chapter> </book>

And then setns/query using xmllint --shell

$ xmllint.exe --shell ravi06-03.xml / > / > whereis //@xlink:href XPath error : Undefined namespace prefix xmlXPathEval: evaluation failed //@xlink:href: no such node / > / > setns xlink= / > / > whereis //@xlink:href /book/book:chapter/book:locator[1]/@xlink:href /book/book:chapter/book:locator[2]/@xlink:href /book/book:chapter/book:locator[3]/@xlink:href / > / > cat //@xlink:href ------- xlink:href="/book/isbn/979-0-4444-1000-17/book-part/chapter/bk444444c +h1?releaseStatus=RELEASED" ------- xlink:href="/book/isbn/979-0-4444-1000-17/book-part/chapter/bk444444c +h1?releaseStatus=RELEASED&amp;format=pdf" ------- xlink:href="/book/isbn/979-0-4444-1000-17/book-part/chapter/bk444444c +h1?releaseStatus=RELEASED&amp;format=epub" / > / > / > cat (//@xlink:href/..)[1] ------- <book:locator xmlns:xlink="" xlink:href="/ +book/isbn/979-0-4444-1000-17/book-part/chapter/bk4 44444ch1?releaseStatus=RELEASED" xlink:title="Photonic crystal light-e +mitting sources" xlink:type="locator"/> / > / > / > bye $

In reply to Re^2: How to parse xml with namespase vale in XMl:LibXML? (xmllint --shell setns / xpathtester) by Anonymous Monk
in thread How to parse xml with namespase value in XMl:LibXML? by ravi06

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and !@monks...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (1)
    As of 2018-07-22 18:53 GMT
    Find Nodes?
      Voting Booth?
      It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

      Results (455 votes). Check out past polls.