IE7中XML缺少顶层元素,IE6正常
如下有两个XML文件如下,KMMap1.xml与KMMap2.xml,两者使用同一段代码生成的,格式相同。TEXT值通过escape得到。
在IE7中KMMap1.xml 报错:缺少一个顶层元素。KMMap2.xml正常
在IE6中两种都正常。
不知道什么原因,是否和IE有关还是我机器问题
KMMap1.xml
<?xml version= "1.0 " encoding= "gb2312 "?>
<tree>
<dbname text= "%u529e%u4e8b%u5458 "/>
<tree isLink= "0 " icon= "images/db.gif " openIcon= "images/dbopen.gif " text= "%u5168%u90e8%u6587%u4ef6 " action= "javascript:openview( 'frmWFile ') " PRI= "5 " FolderID= "办事员-ALL ">
<tree UNID= "2BDFD3F80779D625482572A6001F5F0A " Template= "null " text= "%u6536%u85cf%u5939 " PRI= "5 " isLink= "0 " ParentFolder= " " FolderID= "办事员-0005 " IsTerminal= "1 " hasDoc= "0 "/>
<tree UNID= "BE6B58BD59BF68F3482572A6001F5F17 " Template= "null " text= "%u5de5%u4f5c%u5305 " PRI= "5 " isLink= "0 " ParentFolder= " " FolderID= "办事员-0006 " IsTerminal= "1 " hasDoc= "0 "/>
</tree>
<tree isLink= "0 " text= "共享文件 " action= "javascript:openview( 'frmWShareFile ') " PRI= "5 " IsTerminal= "0 " FolderID= "办事员-SHARE "/>
<tree isLink= "0 " text= "管理设置 " icon= "images/db.gif " openIcon= "images/dbopen.gif " action= "javascript:configInfo( 'Design ') " PRI= "5 " FolderID= "办事员-DESIGN ">
<tree isLink= "0 " text= "文件夹规划 " action= "javascript:configInfo( 'FolderDesign ') " PRI= "5 " IsTerminal= "0 " FolderID= "办事员-FDESIGN "/>
<tree isLink= "0 " text= "视图设计 " action= "javascript:configInfo( 'ViewDesign ') " PRI= "5 " IsTerminal= "0 " FolderID= "办事员-VDESIGN "/>
<tree isLink= "0 " text= "文件动作 " action= "javascript:openview( 'frmWAction ') " PRI= "5 " IsTerminal= "0 " FolderID= "办事员-ACTION "/>
</tree>
</tree>
/××××××××××××××××××××××××××××××××
KMMap2.xml
<?xml version= "1.0 " encoding= "gb2312 "?>
<tree>
<dbname text= "%u884c%u653f%u4e3b%u7ba1 "/>
<tree isLink= "0 " icon= "images/db.gif " openIcon= "images/dbopen.gif " text= "%u5168%u90e8%u6587%u4ef6 " action= "javascript:openview( 'frmWFile ') " PRI= "5 " FolderID= "行政主管-ALL ">
<tree UNID= "7D62D792B1544E52482572A6001F5D2A " Template= "null " text= "%u6536%u85cf%u5939 " PRI= "5 " isLink= "0 " ParentFolder= " " FolderID= "行政主管-0005 " IsTerminal= "1 " hasDoc= "0 "/>
<tree UNID= "1112F2A76D988BD3482572A6001F5D35 " Template= "null " text= "%u5de5%u4f5c%u5305 " PRI= "5 " isLink= "0 " ParentFolder= " " FolderID= "行政主管-0006 " IsTerminal= "1 " hasDoc= "0 "/>
</tree>
<tree isLink= "0 " text= "共享文件 " action= "javascript:openview( 'frmWShareFile ') " PRI= "5 " IsTerminal= "0 " FolderID= "行政主管-SHARE "/>
<tree isLink= "0 " text= "管理设置 " icon= "images/db.gif " openIcon= "images/dbopen.gif " action= "javascript:configInfo( 'Design ') " PRI= "5 " FolderID= "行政主管-DESIGN ">
<tree isLink= "0 " text= "文件夹规划 " action= "javascript:configInfo( 'FolderDesign ') " PRI= "5 " IsTerminal= "0 " FolderID= "行政主管-FDESIGN "/>
<tree isLink= "0 " text= "视图设计 " action= "javascript:configInfo( 'ViewDesign ') " PRI= "5 " IsTerminal= "0 " FolderID= "行政主管-VDESIGN "/>
<tree isLink= "0 " text= "文件动作 " action= "javascript:openview( 'frmWAction ') " PRI= "5 " IsTerminal= "0 " FolderID= "行政主管-ACTION "/>
</tree>
</tree>
[解决办法]
不解。
没ie7,ie6确实通过了
[解决办法]
估计是你程序中有处理不当的地方
[解决办法]
要不这样子吧,楼主去下一个最新的msxml,每个机器都装上看看效果。
无论是哪个版本的ie,都是用msxml来解析xml的,问题可能在这里
[解决办法]
我在IE7下使用正常
你看看是不是缓存问题