开发者

Pulling out XML attribute information in Scala

I'm trying to iterate over all the attributes in a scala.xml.Elem and get the namespace, attribute name and value as a String. I've found it a bit hard going to be honest; is there a better way to do it than:

 elem.attributes map { md => (md.getNamespace(elem), md开发者_如何转开发.key, md.value(0).text) } 


I don't think there is a better way to do this. If you need to extract data from MetaData objects a lot, you could write your own extractor to get nicer syntax.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜