xml问题中的XML读取<

时间:2013-03-05 13:27:48

标签: java javascript html xml xml-parsing

我正在尝试阅读以下XML文档,其中我遇到问题,请阅读EXT_STRING0>&lt此标记,在此先感谢

<Results>
<ResultSet fetchSize="0">
    <Row rowNumber="1">
        <OBJECT_ID>AOM_Reference_User5L76V75WA%40aom.com</OBJECT_ID>
        <EXT_STRING0>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Token&gt;&lt;Device&gt;&lt;deviceId&gt;jfhksjdhfjks231231233&lt;/deviceId&gt;&lt;tokenString&gt;RNUR7OQ9VV5R61F3S2K66AHBV&lt;/tokenString&gt;&lt;createdAt&gt;04-03-2013T12:48:55&lt;/createdAt&gt;&lt;/Device&gt;&lt;/Token&gt;</EXT_STRING0>
    </Row>
    <Row rowNumber="2">
        <OBJECT_ID>AOM_Reference_UserLKKEV81D1%40aom.com</OBJECT_ID>
        <EXT_STRING0>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Token&gt;&lt;Device&gt;&lt;deviceId&gt;jfhksjdhfjks231231233&lt;/deviceId&gt;&lt;tokenString&gt;RIF9XTJSTYCPUMHCQ11FCI1HC&lt;/tokenString&gt;&lt;createdAt&gt;28-02-2013T15:57:06&lt;/createdAt&gt;&lt;/Device&gt;&lt;/Token&gt;</EXT_STRING0>
    </Row>
    <Row rowNumber="3">
        <OBJECT_ID>AOM_Reference_User4NO17EFO3%40aom.com</OBJECT_ID>
        <EXT_STRING0>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Token&gt;&lt;Device&gt;&lt;deviceId&gt;jfhksjdhfjks231231233&lt;/deviceId&gt;&lt;tokenString&gt;RIF9V5WRWELSYMHCQ11FCI1HC&lt;/tokenString&gt;&lt;createdAt&gt;28-02-2013T14:43:55&lt;/createdAt&gt;&lt;/Device&gt;&lt;/Token&gt;</EXT_STRING0>
    </Row>
    <Row rowNumber="4">
        <OBJECT_ID>AOM_Reference_User5K4S9NA1S%40aom.com</OBJECT_ID>
        <EXT_STRING0>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Token&gt;&lt;Device&gt;&lt;deviceId&gt;jfhksjdhfjks231231233&lt;/deviceId&gt;&lt;tokenString&gt;RIF9YBD1VK6OYMHCQ11FCI1HC&lt;/tokenString&gt;&lt;createdAt&gt;28-02-2013T15:59:05&lt;/createdAt&gt;&lt;/Device&gt;&lt;/Token&gt;</EXT_STRING0>
    </Row>
    <Row rowNumber="5">
        <OBJECT_ID>AOM_Reference_UserZUMIPYUR6%40aom.com</OBJECT_ID>
        <EXT_STRING0>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Token&gt;&lt;Device&gt;&lt;deviceId&gt;jfhksjdhfjks231231233&lt;/deviceId&gt;&lt;tokenString&gt;RIF9XOM81TEXUMHCQ11FCI1HC&lt;/tokenString&gt;&lt;createdAt&gt;28-02-2013T15:55:29&lt;/createdAt&gt;&lt;/Device&gt;&lt;/Token&gt;</EXT_STRING0>
    </Row>
    <Row rowNumber="6">
        <OBJECT_ID>AOM_Reference_UserT3SURUV71%40aom.com</OBJECT_ID>
        <EXT_STRING0>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Token&gt;&lt;Device&gt;&lt;deviceId&gt;jfhksjdhfjks231231233&lt;/deviceId&gt;&lt;tokenString&gt;RNUR7I9G8KOO21F3S2K66AHBV&lt;/tokenString&gt;&lt;createdAt&gt;04-03-2013T12:47:33&lt;/createdAt&gt;&lt;/Device&gt;&lt;/Token&gt;</EXT_STRING0>
    </Row>
    <Row rowNumber="7">
        <OBJECT_ID>AOM_Reference_UserJ8LKYCDT6%40aom.com</OBJECT_ID>
        <EXT_STRING0>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Token&gt;&lt;Device&gt;&lt;deviceId&gt;jfhksjdhfjks231231233&lt;/deviceId&gt;&lt;tokenString&gt;RIF9YBB2UG4PUMHCQ11FCI1HC&lt;/tokenString&gt;&lt;createdAt&gt;28-02-2013T15:59:04&lt;/createdAt&gt;&lt;/Device&gt;&lt;/Token&gt;</EXT_STRING0>
    </Row>
    <Row rowNumber="8">
        <OBJECT_ID>AOM_Reference_UserO9PJ92I6X%40aom.com</OBJECT_ID>
        <EXT_STRING0>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Token&gt;&lt;Device&gt;&lt;deviceId&gt;jfhksjdhfjks231231233&lt;/deviceId&gt;&lt;tokenString&gt;RIF9XP9WF62N6MHCQ11FCI1HC&lt;/tokenString&gt;&lt;createdAt&gt;28-02-2013T15:55:35&lt;/createdAt&gt;&lt;/Device&gt;&lt;/Token&gt;</EXT_STRING0>
    </Row>
    <Row rowNumber="9">
        <OBJECT_ID>AOM_Reference_UserKK62LWXVU%40aom.com</OBJECT_ID>
        <EXT_STRING0>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Token&gt;&lt;Device&gt;&lt;deviceId&gt;jfhksjdhfjks231231233&lt;/deviceId&gt;&lt;tokenString&gt;RIF9WAUNZJLCYMHCQ11FCI1HC&lt;/tokenString&gt;&lt;createdAt&gt;28-02-2013T14:51:45&lt;/createdAt&gt;&lt;/Device&gt;&lt;/Token&gt;</EXT_STRING0>
    </Row>
    <Row rowNumber="10">
        <OBJECT_ID>AOM_Reference_User8JLCJG90R%40aom.com</OBJECT_ID>
        <EXT_STRING0>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Token&gt;&lt;Device&gt;&lt;deviceId&gt;jfhksjdhfjks231231233&lt;/deviceId&gt;&lt;tokenString&gt;RIF9Y48JUX1WIMHCQ11FCI1HC&lt;/tokenString&gt;&lt;createdAt&gt;28-02-2013T15:58:41&lt;/createdAt&gt;&lt;/Device&gt;&lt;/Token&gt;</EXT_STRING0>
    </Row>
</ResultSet>

2 个答案:

答案 0 :(得分:1)

您可以使用CDATA块和/或继续将xml写为“常规”xml节点,并在读取文件时添加xml声明。

您还可以指定<?xml version="1.0" encoding="utf-8"?>声明。

答案 1 :(得分:0)

问题解决了我解码了格式并解析了