作者:励志天涯网 | 来源:互联网 | 2023-02-05 16:43
IwanttodosomemanipulationonxmlcontentinJava.Seebelowxml我想对Java中的xml内容进行一些操作。见下面的xmlF
I want to do some manipulation on xml content in Java. See below xml
我想对Java中的xml内容进行一些操作。见下面的xml
From Source XML:
Image as BinaryData of size 250KB
Target XML:
Image as BinaryData of size 250KB
As shown, I have Source xml and I want target xml for that .. The only difference we can observe is root_element "ns1:Order" is replace with "OrderData" in target xml.
如图所示,我有源xml,我想要目标xml ..我们可以观察到的唯一区别是root_element“ns1:Order”在目标xml中被替换为“OrderData”。
Fyi, OrderHeader has one sub-element Image which holds binary image of 250KB (so this xml going to be large one) .. also root element of target xml "OrderData" is well-known in advance.
Fyi,OrderHeader有一个子元素Image,它保存250KB的二进制图像(所以这个xml会变大)。目标xml“OrderData”的根元素也是众所周知的。
Now, I want to achieve above result in java with best performance .. I have Source xml content already as byte[] and I want target xml content also as byte[] .. I am open to use Sax parser too.
现在,我希望在具有最佳性能的java中实现上述结果。我已将Source xml内容作为byte []并且我希望目标xml内容也作为byte [] ..我也开放使用Sax解析器。
Please provide the solution which has best performance for doing above stuff.
请提供具有最佳性能的解决方案。
Thanks in advance, Nurali
提前谢谢,Nurali
4 个解决方案