我对python还很陌生。我现在学习如何在Java中对对象进行封送/解封。 我正在寻找类似Java的东西。 比如:
JAXBContext jaxbContext = JAXBContext.newInstance(com.Request1.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new InputSource(new StringReader(message)));
requestStr2 = (com.Request1) unmarshaller.unmarshal(doc);
其中Request1具有@XmlRootElement注释
我不想写多个元素、子元素等,因为我有非常复杂的xsd结构。我想通过generateDS从xsd生成类,然后从数据库初始化它并序列化为xml文件
我看过pyxser,但它只在Python2上出现。 什么模块可以帮我? 多谢各位
目前没有回答
相关问题 更多 >
编程相关推荐