Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

In Re^2: XML parsing and Lists you wrote a query using more than one tagname which appears nowhere in the xml you posted

H5 is not H4, there is no "Part"

$ xmllint.exe --xpath " //Article//Sect//H4[ contains(.,'Include')] /. +.//LI" madbee.xml <LI> <LI_Label>1.</LI_Label> <LI_Title>Critera 1</LI_Title> </LI><LI> <LI_Label>2.</LI_Label> <LI_Title>Critera 2</LI_Title> </LI><LI> <LI_Label>3.</LI_Label> <LI_Title>Critera 3</LI_Title> </LI><LI> <LI_Label>4.</LI_Label> <LI_Title>Critera 3</LI_Title> </LI> $ xmllint.exe --xpath " count( //Article//Sect//H4[ contains(.,'Includ +e')] /..//LI )" ma dbee.xml 4 $ xmllint.exe --xpath " count( //H4[ contains(.,'Include')] /..//LI )" + madbee.xml 4 $

My advice is switch to font DejaVu Sans Mono, say size 11 or 12 or 20 , helps with the detailed oriented nature of programming

 [id://1042546] -> XML parsing and Lists

what you posted still isn't valid xml -- XML::LibXML rejects it

madbee2.xml:24: parser error : Opening and ending tag mismatch: L line + 7 and Sect </Sect> ^ madbee2.xml:25: parser error : Opening and ending tag mismatch: Sect l +ine 3 and Main </Main> ^ madbee2.xml:26: parser error : Opening and ending tag mismatch: Main l +ine 2 and Article </Article> ^ madbee2.xml:28: parser error : Premature end of data in tag Aritcle li +ne 1 ^

In reply to Re: Counting number of child nodes based on element value (typos) by Anonymous Monk
in thread Counting number of child nodes based on element value by madbee

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 all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others studying the Monastery: (3)
    As of 2018-05-26 23:48 GMT
    Find Nodes?
      Voting Booth?