手机版
网站地图
美文美图
最新动态
你好,欢迎访问
好美文阅读网
个性皮肤
搜索
网站首页
美文
文章
散文
日记
诗歌
小说
故事
句子
作文
签名
祝福语
情书
范文
读后感
文学百科
美文摘抄
节日文章
名家散文
网名大全
座右铭
口号大全
面试技巧
说说大全
阅读答案
诗词默写
流言蜚语
节日祝福
好句子
经典台词
谚语大全
亲情故事
友情故事
表白情书
工作报告
活动总结
心得体会
专题汇总
美文网首页
写出到xml文档注意细节
写出到xml文档注意细节
作者:
我是邱邱
| 来源:发表于
2018-04-22 13:44 被阅读0次
1.指定输出格式:
紧凑的格式,去除了空格和换行,项目上线的时候:
OutputFormat outputFormat=OutputFormat.createCompactFormat();
漂亮的格式,有空格和换行,开发调试的时候使用:
OutputFormat outputFormat=OutputFormat.createPrettyPrint();
2.指定生成的xml文档的编码
outputFormat.setEncoding("utf-8");同时影响了xml保存时的编码 和 xml文档声明时的encoding的编码(xml文档解析时的编码)
结论:使用该方法生成的xml文档避免了中文乱码问题。
相关文章
网友评论
本文标题:
写出到xml文档注意细节
本文链接:
https://www.haomeiwen.com/subject/zwwqlftx.html
延伸阅读
那年盛夏诗歌
环境监察队工作总结范文
优秀教师学习心得范文
华胥引的读后感300字
《Its red》教学反思范文
农资购销的合同范本
竞选中队委优秀演讲稿
辞金蹈海的成语解释
《世纪宝鼎》公开课教案设计
因为爱你,所以牵挂
今生今世红尘醉——美到
一个90后的内心独白
致已逝去的高中年华
深度阅读
您也可以注册成为美文阅读网的作者,发表您的原创作品、分享您的心情!
情人节
母亲节
重阳节
清明节
端午节
植树节
元宵节
妇女节
愚人节
圣诞节
父亲节
教师节
儿童节
劳动节
青年节
建军节
万圣节
平安夜
光棍节
中秋节
国庆节
感恩节
腊八节
更多话题
栏目导航
摄影
故事
互联网
读书
旅行
热点阅读
习惯省钱的你,过得还好吗?
【如何学习英语1】
我校建立广东天然药物研究开发重点实验室
江城子*游春
一个人失眠
在CentOS7上安装MariaDB(原MySQL作者开发的)数
伪善,我并不希望你们经历.
成长励志 | 成功唯有坚持
张秉毅编剧的电影再获国际奖
我,最终选择了蔚蓝深海
网友评论