Created
July 5, 2016 14:55
-
-
Save djberg96/04b0723ff72339a0ab6ddd434bf05ccf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
str = "#< CLIXML\r\n<Objs Version=\"1.1.0.1\" xmlns=\"http://schemas.microsoft.com/powershell/2004/04\"><S S=\"Error\">Stuff</S></Objs>" | |
doc = Nokogiri::XML::Document.parse(str) | |
doc.remove_namepaces! | |
p doc.xpath("//S") # => [], why? | |
# REXML equivalent of what I want | |
doc = REXML::Document.new(str) | |
p doc.root.get_elements('//S') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment