Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Some questions from beginning user of XML::LibXML and XPath

by choroba (Canon)
on Oct 16, 2012 at 10:10 UTC ( #999274=note: print w/ replies, xml ) Need Help??


in reply to Some questions from beginning user of XML::LibXML and XPath

If you find XML::LibXML too verbose, you might like its wrapper XML::XSH2:

#!/usr/bin/perl use warnings; use strict; use XML::XSH2; $XML::XSH2::Map::file = '1.xml'; $XML::XSH2::Map::project = 'Release DLL|Win32'; $XML::XSH2::Map::old = 'ReleaseDLL'; $XML::XSH2::Map::new = 'ReleaseDLL32'; xsh << 'end ;' open $file ; register-namespace msb http://schemas.microsoft.com/developer/msbu +ild/2003 ; for //msb:PropertyGroup[contains(@Condition, $project)] { for ( ./msb:IntDir | ./msb:OutDir ) { set . xsh:subst(text(), $old, $new) ; } } save :b ; end ;
One of the features of xsh is you can run it in interactive mode in which it is easy to test your more complicated XPath expressions.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Some questions from beginning user of XML::LibXML and XPath
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2015-07-06 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls