我正在
unexpected element (uri:"*****.xsd", local:"Site"). Expected elements are <{}Site>
当我使用JAXB将xml解组为对象时:
解组代码:
JAXBContext context = JAXBContext.newInstance(SitesHolder.class);
Unmarshaller un = context.createUnmarshaller();
我的xml有:
<Sites>
<Site id="444" name="....." location="US" xmlns="*****.xsd">
::::
::::
SiteHolder有Site类列表(List),在Site类中,我有以下内容:
@XmlType(name = "", namespace="****.xsd" ,propOrder = {
"id",
"name",
"location",
"xmlns",
})
@XmlRootElement(name = "Site")
public class Site {
]
我在这里遗漏了什么?