Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: XML data reading/output

by ramrod (Curate)
on Sep 04, 2009 at 19:35 UTC ( #793576=note: print w/replies, xml ) Need Help??


in reply to Re: XML data reading/output
in thread XML data reading/output

I got better results with
$doc->findnodes( '//descriptors[@type="CTC"]/descriptor/mainterm/text( +)'
    The three changes I added are:
  • an @ for the type attribute
  • the /descriptor element (although the xml is not well formed)
  • /text() since it appears they desire a text node

Replies are listed 'Best First'.
Re^3: XML data reading/output
by ikegami (Pope) on Sep 04, 2009 at 20:27 UTC
    arg, yeah, dumb mistakes. But not the third one. Contrary to your claims, the OP wants the whole element ('<mainterm weight="a">G</mainterm>'), not just the text ('G').

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://793576]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2016-10-01 20:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (7 votes). Check out past polls.