Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stephenrichards/ade541532a1b630b831c2cb74a5fe34d to your computer and use it in GitHub Desktop.
Save stephenrichards/ade541532a1b630b831c2cb74a5fe34d to your computer and use it in GitHub Desktop.
Print a list of all attributes in the CCMS payload
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