Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Accessing dotted tags with Mojo::DOM

by Fletch (Bishop)
on Dec 07, 2022 at 03:46 UTC ( [id://11148636]=note: print w/replies, xml ) Need Help??


in reply to Re: Accessing dotted tags with Mojo::DOM
in thread Accessing dotted tags with Mojo::DOM

Well foo . . . I thought I’d tried that but it certainly works w/9.30. Serves me right first SoPW in 21 years and it’s PEBKAC.

#!/usr/bin/env perl use 5.034; use Mojo::DOM; my $xml_src = do { local $/; <DATA>; }; my $dom = Mojo::DOM->new->xml(1); $dom->parse( $xml_src ); my @targets = ( qq{com\\.cloudbees\\.hudson\\.plugins\\.folder\\.proper +ties\\.AuthorizationMatrixProperty}, qq{\Qcom.cloudbees.hudson.plugins.folder.properties.Aut +horizationMatrixProperty}, ); for my $tgt (@targets) { say qq{tgt: $tgt}; say $dom->at( $tgt )->all_text; } exit 0; __END__ <?xml version="1.0" encoding="UTF-8"?> <foo> <com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixP +roperty> <bar>Test text</bar> </com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrix +Property> </foo>

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-18 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found