简体   繁体   中英

encode the merged XML file

i am using the answer mentioned in the below link to merge XML files
https://stackoverflow.com/a/10760236/1643087
but the output files seems to be missing the encoding

 <?xml version="1.0"?>
<DataFile>
    <Contact id="1" time="13vsxv:01" KeyCd="cxcEfsd191cxzcate="2012-11-19"><Name><Title>01</Title><FirstName>Chrcxzcan</FirstName><LastName>methot</LastName></Name><Address><Street>9xcz</Street><City>Repentigny</City><State>QC</State><Zip>J5Y1c9</Zip></Address><ContactInfo><Email>ancxcec@ucxcet</Email><EvePhone>4fds277</EvePhone></ContactInfo><Language><Lang>0cxc</Lang></Language></Contact>
    <Contact id="2" time="13:02:01" KeyCd="0dasdEC201sda3dad000036" date="2012-11-19">....</Contact>
    .............
</DataFile>

can anybody tell me how to set encoding="ISO-8859-1" and instead of
XMLInputFactory xmlInFactory = XMLInputFactory.newFactory();
i have used
XMLInputFactory xmlInFactory = XMLInputFactory.newInstance();

在编组器上,设置编码的属性。

m.setEncoding("jaxb.encoding", "ISO-8859-1");

创建文档时,您传入要使用的编码。

xmlEventFactory.createStartDocument("ISO-8859-1");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM