inline模式_大小写

1、

测试代码:

 1 <!DOCTYPE html >
 2 
 3 <html>
 4 
 5 <style type="text/css">
 6 <!--
 7 
 8 -->
 9 </style>
10 
11 <script type="text/javascript" >
12 <!--
13 
14     function Cge_PSR_REF_fromMetadata(_doceleMetadata)
15     {
16         var nodesChild = _doceleMetadata.childNodes;
17         for (var i=0; i<nodesChild.length; i++)
18         {
19             var nodeChild = nodesChild[i];
20             if (nodeChild.nodeType == 1)
21             {
22                 if (nodeChild.tagName.toLowerCase() == "cge:psr_ref")
23                 {
24                     console.log("nodeChild.tagName : "+nodeChild.tagName);
25                     console.log("nodeChild.attributes : "+nodeChild.attributes+" --> "+nodeChild.attributes.length);
26                     for (var j=0; j<nodeChild.attributes.length; j++)
27                     {
28                         var attrJ = nodeChild.attributes[j];
29                         console.log("# # # nodeChild.attributes["+j+"] : "+attrJ+" --> "
30                             +attrJ.name+","+attrJ.value+" ; "+attrJ.nodeType+","+attrJ.nodeName+","+attrJ.nodeValue);
31                     }
32                     
33                     /*
34                     console.log("* * *");
35                     for (zz in attr0)
36                         console.log(zz);
37                         //*/
38                 }
39                 else
40                 {
41                     if ( (nodeChild.childNodes) && (nodeChild.childNodes.length > 0) )
42                         return Cge_PSR_REF_fromMetadata(nodeChild);
43                 }
44             }
45         }
46     }
47 
48 
49     window.onload = function()
50     {
51         var idG01 = document.getElementById("idG01");
52     
53         var nodeMetadata = idG01.querySelector("metadata");
54         if (! nodeMetadata)
55         {
56             console.log("<metadata/> not found .");
57             return;
58         }
59 
60         Cge_PSR_REF_fromMetadata(nodeMetadata);
61     };
62 
63 -->
64 </script>
65 
66 
67 <svg width="1000" height="800" viewBox="0 0 1000 800" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:cge="http://iec.ch/TC57/2005/SVG-schema#" xmlns:hzsvg="http://holleygrid.cn/svg">
68 
69 <g>
70     <metadata>
71         <cge:Layer_Ref ObjectName="aaaaa"/>
72         <cge:PSR_Ref ObjectID="ACLineSegment_12345" ObjectName="哈哈哈哈哈"/>
73     </metadata>
74 <g/>
75 
76 <g id="idG01">
77     <text id="idText01" font-size="30" font-family="SimSun" stroke="rgb(98, 190, 157)" stroke-width="0.106666666666667" x="0.6288" y="30.9472" >PD</text>
78     <metadata>
79         <cge:Layer_Ref ObjectName="MainLayer"/>
80         <cge:PSR_Ref ObjectID="ACLineSegment_1112002624" ObjectName="至东联开闭所支线1 [环球开闭所]-[东联开闭所KBS4522A]"/>
81     </metadata>
82 <g/>
83 
84 </svg>
85 
86 </html>

 

2、

2.1、IE9 解析得到的树状图:

  ZC: 这里注意,IE9 解析出来的 <<cge:PSR_Ref/> 居然是在 <<cge:Layer_Ref/> 的内部...

  ZC: IE9 中 inline方式显示SVG图,里面的大小写全都是和源码一致的 ! ! !

 

2.2、Chrome(版本 49.0.2623.87 m)解析得到的树状图

  ZC: chrome 中 inline方式显示SVG图,里面 tagname/属性 的大小写全都是 小写 ! ! !

 

3、

控制台信息:

3.1、ie9 控制台信息

1 日志: nodeChild.tagName : cge:PSR_Ref 
2 日志: nodeChild.attributes : [object NamedNodeMap] --> 2 
3 日志: # # # nodeChild.attributes[0] : [object Attr] --> ObjectName,至东联开闭所支线1 [环球开闭所]-[东联开闭所KBS4522A] ; 2,ObjectName,至东联开闭所支线1 [环球开闭所]-[东联开闭所KBS4522A] 
4 日志: # # # nodeChild.attributes[1] : [object Attr] --> ObjectID,ACLineSegment_1112002624 ; 2,ObjectID,ACLineSegment_1112002624 

 

3.2、Chrome(版本 49.0.2623.87 m)控制台信息

1 nodeChild.tagName : cge:psr_ref
2 nodeChild.attributes : [object NamedNodeMap] --> 2
3 # # # nodeChild.attributes[0] : [object Attr] --> objectid,ACLineSegment_1112002624 ; 2,objectid,ACLineSegment_1112002624
4 # # # nodeChild.attributes[1] : [object Attr] --> objectname,至东联开闭所支线1 [环球开闭所]-[东联开闭所KBS4522A] ; 2,objectname,至东联开闭所支线1 [环球开闭所]-[东联开闭所KBS4522A]

 

4、

 

5、

 

posted @ 2016-04-05 16:11  Html5Skill  阅读(550)  评论(0编辑  收藏  举报