The ndaq
namespace is not defined which causes REXML
to not parse it, but otherwise I don't see a problem with ruby. Colons in dictionary keys is not an issue.
This simple script shows one way that your xml can be displayed in a Ruby Hash:
require 'nori'
require 'pp'
response_hash = Nori.new.parse(DATA.read)
pp response_hash
__END__
<rss version="2.0">
<channel>
<title>NASDAQTrader.com</title>
<link>http://www.nasdaqtrader.com</link>
<description>NASDAQ Trade Halts</description>
<copyright>Copyright 2021. All rights reserved.</copyright>
<pubDate>Fri, 22 Jan 2021 10:40:41 GMT</pubDate>
<ttl>1</ttl>
<ndaq:numItems>3</ndaq:numItems>
<item>
<title>PRVL</title>
<pubDate>Thu, 21 Jan 2021 05:00:00 GMT</pubDate>
<ndaq:HaltDate>01/21/2021</ndaq:HaltDate>
<ndaq:HaltTime>19:45:17</ndaq:HaltTime>
<ndaq:IssueSymbol>PRVL</ndaq:IssueSymbol>
<ndaq:IssueName>Prevail Therapeutics Inc. Cmn</ndaq:IssueName>
<ndaq:Market>NASDAQ</ndaq:Market>
<ndaq:ReasonCode>T12</ndaq:ReasonCode>
<ndaq:PauseThresholdPrice/>
<ndaq:ResumptionDate/>
<ndaq:ResumptionQuoteTime/>
<ndaq:ResumptionTradeTime/>
<description>
</description>
</item>
The output of this script is:
{"channel"=>
{"title"=>"NASDAQTrader.com",
"link"=>"http://www.nasdaqtrader.com",
"description"=>"NASDAQ Trade Halts",
"copyright"=>"Copyright 2021. All rights reserved.",
"pubDate"=>"Fri, 22 Jan 2021 10:40:41 GMT",
"ttl"=>"1",
"ndaq:numItems"=>"3",
"item"=>
{"title"=>"PRVL",
"pubDate"=>"Thu, 21 Jan 2021 05:00:00 GMT",
"ndaq:HaltDate"=>"01/21/2021",
"ndaq:HaltTime"=>2021-01-22 19:45:17 +0100,
"ndaq:IssueSymbol"=>"PRVL",
"ndaq:IssueName"=>"Prevail Therapeutics Inc. Cmn",
"ndaq:Market"=>"NASDAQ",
"ndaq:ReasonCode"=>"T12",
"ndaq:PauseThresholdPrice"=>nil,
"ndaq:ResumptionDate"=>nil,
"ndaq:ResumptionQuoteTime"=>nil,
"ndaq:ResumptionTradeTime"=>nil,
"description"=>nil}}}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…