XSD:
<xs:complexType name="row">
<xs:sequence maxOccurs="unbounded">
<xs:any processContents="skip"/>
</xs:sequence>
</xs:complexType>
Generated Java:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "row", propOrder = {
"any"
})
public class ReportRowType {
@XmlAnyElement
protected List<Element> any;
...
}
如何正确创建XML org.w3c.dom.Element
以放入此处?我只是创建一个随机文档?这对我来说似乎不对:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.newDocument();
Element e = doc.createElement("random_tag_name");
row.getAny().add(e)?