【发布时间】:2012-09-18 23:03:11
【问题描述】:
<GetProductsForMachine>
<Products>
<ProductsForMachine>coffee espresso</ProductsForMachine>
<ProductsForMachine>coffe1</ProductsForMachine>
<ProductsForMachine>coffee2</ProductsForMachine>
</Products>
ProductsForMachine 类的实现必须是什么,很难,因为没有元素可以获取它们的值。
我尝试使用以下代码,但解析时出现错误..
@Root
public class ProductsForMachine{
@Attribute(name="ProductsForMachine", required=true)
public String ProductsForMachine;
@Element(required=false)
public int value;
}
谢谢
【问题讨论】:
-
it's difficult because there aren't elements to get theirs value.为什么?ProductsForMachine在您的 XML 文件中有值。还是我误会了你? -
好的,请告诉我解析它的类必须是什么,因为我写的类在解析中不起作用..
标签: android xml-parsing simple-framework