Scala: XML Attribute parsing

后端 未结 4 1419
误落风尘
误落风尘 2021-01-02 02:02

I\'m trying to parse a rss feed that looks like this for the attribute \"date\":



    
        

        
4条回答
  •  心在旅途
    2021-01-02 02:32

    The "y" in is a namespace prefix. It's not part of the name. Also, attributes are referred to with a '@'. Try this:

    println(((rssFeed \\ "channel" \\ "item" \ "c" \ "@date").toString))
    

提交回复
热议问题