我有以下代码来执行从一个 JAXB 注释对象到另一个 JAXB 注释对象的 XSLT 转换。在这种情况下,性能真的会很差吗?它将 JAXB 对象编组为 XML,将其转换为另一个 XML 并解组,还是这里有更好的技巧?
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer(new StreamSource(mapping.getInputStream()));
JAXBResult result = new JAXBResult(JaxbUtils.getJAXBContext(CalypsoUploadDocument.class));
transformer.transform(new JAXBSource(JaxbUtils.getJAXBContext(CalypsoUploadDocument.class), uploadMessage),result);
return result.getResult();