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

Re: Perl Regex Multiline Matching

by choroba (Cardinal)
on Oct 14, 2016 at 05:38 UTC ( [id://1173980]=note: print w/replies, xml ) Need Help??


in reply to Perl Regex Multiline Matching

Note that XML specification says that newlines in attributes should be normalized away during parsing. And that's what XML::LibXML does indeed:
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use XML::LibXML; my $dom = 'XML::LibXML'->load_xml(IO => *DATA{IO}); for my $property ($dom->findnodes('/set/cdsets/cdset/property')) { say join ' -> ', @$property{qw{ name value }}; } __DATA__ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <set name="01" id="test" catId="81679" > <cdsets> <cdset id="cdset" name="CD Compilation"> <property name="Own" value=""/> <property name="Type" value="Record"/> <property name="Text" value="Sample text more sample text more more same text]."/> <property name="Unique" value="yes"/> </cdset> </cdsets> </set>

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found