开发者

I don't know how to deal with this kind of xml structure on android

开发者 https://www.devze.com 2023-02-08 03:15 出处:网络
<gesmes:En开发者_如何学JAVAvelope> <gesmes:subject>Reference rates</gesmes:subject>
<gesmes:En开发者_如何学JAVAvelope>
<gesmes:subject>Reference rates</gesmes:subject>
<gesmes:Sender>
<gesmes:name>European Central Bank</gesmes:name>
</gesmes:Sender> <Cube>
<Cube time="2010-03-26"> 
<Cube currency="USD" rate="1.3353"/> 
<Cube currency="JPY" rate="124.00"/> 
<Cube currency="BGN" rate="1.9558"/> 
<Cube currency="CZK" rate="25.418"/> 
... ... 
</Cube> 
</Cube> 
</gesmes:Envelope> 

What can I do with this kind of structure?


You can read the information from it by traversing it. You can also make it into an object.

I don't know what you want to do with the data, so I'm guessing you're asking how to get a certain rate from a string like that?

I'd suggest you find an xml-parser for java and use that. You can then do whatever you like with the information contained in that xml file.

A semi-random googled url for parsing: http://www.java-tips.org/java-se-tips/javax.xml.parsers/how-to-read-xml-file-in-java.html

0

精彩评论

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