<Document>
<Items>
<WFItem name=\"id\">1846</WFItem>
<WFItem name=\"WF_DocUNID\">DF0D24E3001555B748257B2E002BE7B8</WFItem>
......
</Items>
</Document>请问这种格式的xml如何读取?

解决方案 »

  1.   

    <WFItem name=\"id\"> 为了转义引号"吗?
    基于流和基于事件两种方法都可以,google下 很多资料
      

  2.   

    这name的值是怎么回事?故意的?为什么这样整?不明白
      

  3.   

    直接用dom4j就可以了啊,
    Document doc = DocumentHelper.parseText(xmlStr);
    Element root = doc.getRootElement(); System.out.println(root.element("Items").element("WFItem").attributeValue("name"));
    把你的那个xml解析成document,再来读取节点
      

  4.   

    dom4j 应该可以实现
    LZ可以google一下