簡體   English   中英

編碼合並的XML文件

[英]encode the merged XML file

我正在使用以下鏈接中提到的答案來合並XML文件
https://stackoverflow.com/a/10760236/1643087
但是輸出文件似乎缺少編碼

 <?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>

有人可以告訴我如何設置encoding =“ ISO-8859-1”而不是
XMLInputFactory xmlInFactory = XMLInputFactory.newFactory();
我用過
XMLInputFactory xmlInFactory = XMLInputFactory.newInstance();

在編組器上,設置編碼的屬性。

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

創建文檔時,您傳入要使用的編碼。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM