Created
July 26, 2019 13:01
-
-
Save stephenrichards/ade541532a1b630b831c2cb74a5fe34d to your computer and use it in GitHub Desktop.
Print a list of all attributes in the CCMS payload
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
module CCMS | |
class PayloadParser | |
def initialize | |
@doc = File.open(Rails.root.join('ccms_integration/example_payloads/PassportedSingleProceedingNonMolDelegated.xml')) { |f| Nokogiri::XML(f).remove_namespaces! } | |
end | |
def run | |
puts ">>>>>>>>> #{__FILE__}:#{__LINE__} <<<<<<<<<<\n" | |
x = @doc.xpath('//Attributes//Attribute//Attribute') | |
attrs = [] | |
x.each { |z| attrs << z.text } | |
attrs.sort! | |
pp attrs | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment