zuroyu
V2EX  ›  Java

dom4j xml 特殊字符问题求助

  •  
  •   zuroyu · May 12, 2011 · 5871 views
    This topic created in 5542 days ago, the information mentioned may be changed or developed.
    项目中使用dom4j来读取xml, xml中特殊字符该如何解决,例如字符 ‘&’ 。
    目前使用的SAXReader来读取
    SAXReader reader = new SAXReader();
    Document document = null;
    //获得document
    document = reader.read(file);
    这样的话如何把file中的特殊字符找出来替换?
    要求:不能更改XML数据
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3179 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 12:18 · PVG 20:18 · LAX 05:18 · JFK 08:18
    ♥ Do have faith in what you're doing.