in reply to Parsing XML file and keeping the formatting tags
#!/usr/bin/perl use warnings; use strict; use XML::LibXML; my $dom = 'XML::LibXML'->load_xml(location => 'file.xml'); for my $child ( @{ $dom->find('/trans-unit/*[self::source | self::target]') } ) { ( my $contents = join '', $child->childNodes ) =~ s,\n, <lb/> ,g; print $contents, $child->nodeName eq 'source' ? ' || ' : "\n"; }
($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,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing XML file and keeping the formatting tags
by corfuitl (Sexton) on Mar 22, 2018 at 18:56 UTC | |
by stevieb (Canon) on Mar 22, 2018 at 21:23 UTC |