问题描述
请帮助建议通过JAXB读取xml内部xmls文件路径的最佳方法。实施需要提供最佳性能。我们在下面尝试过
Master XML Example生成JAXB类
<Header RefNum="SIM0000053728SIM" BU="CSGBU" Format="xml" xml:lang="en" RetStat="" Ind="0" Type="INV" Postprocmethod="L"/>
<Part File="file:C:\file\xml\SIM0000053728SIM\ADDR1710135.88361.1.1.0.xml" BillSeqNo="88361" LinkType="ABS" DocType="ADD" Format="XML"/>
<Part File="file:C:\file\xml\SIM0000053728SIM\AGGCHG1710135.88361.1.1.0.xml" BillSeqNo="88361" LinkType="ABS" DocType="AGG" Format="XML"/>
<Part File="file:C:\file\xml\SIM0000053728SIM\BAL1710135.88361.1.1.0.xml" BillSeqNo="88361" LinkType="ABS" DocType="BAL" Format="XML"/>
每个包含的文件RootElement创建JAXB类并进行迭代
BusinessDocument finalObject =BusinessDocument) unMarshall.unmarshal(new File(colllectionXMLFile));
List<Part> invoiceXMLList = finalObject.getPart();
for(Part part:invoiceXMLList) {
File file = new File(new URI(part.getFile()));
Document document = (Document) unMarshall.unmarshal(file);
businessDocument.getDocument().add(document);
}
我们的问题
1. Is there any other better approach with 1 XSD and 1 Unmarshall to improve performance
2. Is there any way to Merge all XMLs before Unmarshall to improve performance.
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)