breezykatt has asked for the wisdom of the Perl Monks concerning the following question:
#$rpt is just a namespace number retrieved from sub and is correct for + each file. $nsdevices="//ns" . $rpt. ":device"; my @devices = $doc->findnodes($nsdevices); print "nsdevices:$nsdevices\n";
<?xml version='1.0' encoding='utf-8'?><Notify xmlns:xsd="http://www.w3 +.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst +ance" xmlns="http://docs.oasis-open.org/wsn/b-2"> <NotificationMessage> <Topic Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Sim +ple">TOPICNAME</Topic> <ProducerReference> <Address xmlns="http://www.w3.org/2005/08/addressing">address</Address +> <Metadata xmlns="http://www.w3.org/2005/08/addressing"> <ns2:MessageID xmlns:ns2="http://www.w3.org/2005/08/addressing">msgid< +/ns2:MessageID> </Metadata> </ProducerReference> <Message> <ns1:rpt xmlns:ns1="http://www.url.com/path/for/rpt"> <ns1:reportObject> <ns1:device timestamp="2016-01-01T00:00:00.000-00:00">
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::LibXML & namespaces
by choroba (Cardinal) on Oct 03, 2016 at 23:10 UTC | |
by breezykatt (Acolyte) on Oct 04, 2016 at 16:46 UTC | |
by Cow1337killr (Monk) on Oct 05, 2016 at 00:38 UTC |