Forked from stephenrichards/ccms_payload_attribute_finder.rb
Created
November 26, 2020 15:26
-
-
Save Alex-Swann/ed0f164068b48d372223157faf16c6f5 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