Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^5: XML::LibXML problem

by choroba (Cardinal)
on Dec 29, 2011 at 16:18 UTC ( [id://945525]=note: print w/replies, xml ) Need Help??


in reply to Re^4: XML::LibXML problem
in thread XML::LibXML problem

if I do * then I get back all of the elements from the whole tree
Not true. Or at least I do not get it, and you should not get it either:
perl -E ' use XML::LibXML; my $dom = XML::LibXML->load_xml(string => q{ <library> <book attr1="zzz"> <title>xxxx</title> <author>yyyyy</author> </book> <book attr1="sssss"> ---- </book> <book attr1="dddd"> ---- </book> </library> }); my ($l) = $dom->findnodes("/library"); say $_->getName for $l->findnodes("*[text()] | text()");' #text book #text book #text book #text

Replies are listed 'Best First'.
Re^6: XML::LibXML problem
by norricorp (Initiate) on Dec 29, 2011 at 16:38 UTC
    OK, I have been running this again and obvioulsy I changed something (my millionth change of the day) and this has worked.
    So, query is /xs:schema/xs:element/xs:complexType/xs:sequence/xs:element/xs:complexType/xs:sequence/xs:element@name
    does work!
    many thanks for your patience and help. John

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-26 08:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found