<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>KmlFile</name>
<open>1</open>
<Style id="sh_ylw-pushpin">
<IconStyle>
<scale>2</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
<LineStyle>
<color>ff0000aa</color>
</LineStyle>
</Style>
<StyleMap id="msn_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>C:/Users/Administrator/Desktop/新建文本文档.kml#sn_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>C:/Users/Administrator/Desktop/新建文本文档.kml#sh_ylw-pushpin</styleUrl>
</Pair>
</StyleMap>
<GroundOverlay>
<name>未命名图像叠加层</name>
<Icon>
<href>D:/备份/图片/HM9.GIF</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>35.25598141413654</north>
<south>35.23913581589419</south>
<east>115.3612677572053</east>
<west>115.340422959514</west>
<rotation>355.0311840005118</rotation>
</LatLonBox>
</GroundOverlay>
<GroundOverlay>
<name>未命名图像叠加层</name>
<Icon>
<href>D:/备份/图片/HM9.GIF</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>35.268975</north>
<south>35.25290277777778</south>
<east>115.4115194444444</east>
<west>115.3938166666667</west>
</LatLonBox>
</GroundOverlay>
</Document>
</kml>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>KmlFile</name>
<open>1</open>
<Style id="sh_ylw-pushpin">
<IconStyle>
<scale>2</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
<LineStyle>
<color>ff0000aa</color>
</LineStyle>
</Style>
<StyleMap id="msn_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>C:/Users/Administrator/Desktop/新建文本文档.kml#sn_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>C:/Users/Administrator/Desktop/新建文本文档.kml#sh_ylw-pushpin</styleUrl>
</Pair>
</StyleMap>
<GroundOverlay>
<name>未命名图像叠加层</name>
<Icon>
<href>D:/备份/图片/HM9.GIF</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>35.25598141413654</north>
<south>35.23913581589419</south>
<east>115.3612677572053</east>
<west>115.340422959514</west>
<rotation>355.0311840005118</rotation>
</LatLonBox>
</GroundOverlay>
<GroundOverlay>
<name>未命名图像叠加层</name>
<Icon>
<href>D:/备份/图片/HM9.GIF</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>35.268975</north>
<south>35.25290277777778</south>
<east>115.4115194444444</east>
<west>115.3938166666667</west>
</LatLonBox>
</GroundOverlay>
</Document>
</kml>
解决方案 »
- c# 控件Fill后无法填满 tablelayoutpanel的单元格?
- 关于XML的简单问题!
- 我现在有点放弃c#了,请问高手2!
- 有什么好办法,将datagridview中值为0的cell显示为空?
- 在使用OracleDataAdapter.Fill(Dataset)方法时报错:指定的参数已超出有效值的范围!
- 请问如何知道SQL存储过程中游标的位置?或者说如何知道存储过程中三千条记录中的第几条正在处理?我要做进度条
- 如何得到一个空闲的网络端口
- 怎样不用中间变量,实现,a,b交换
- 请问如何由regist得知使用者已经安装dotnet framework 1.1
- 菜鸟求解~!!!!
- 正则和策略模式的2个小问题
- 在服务器上有堆栈问题,而在开发平台不报错误
我这个文件是标准的xml文档吗 能被解析吗
我是新手 请您帮我 谢谢
IEnumerable <XElement> childElements =
from el in po.Descendants("Title")
select el;
foreach (XElement el in childElements)
Console.WriteLine((string)el);
Console.ReadLine();
System.Xml.XmlDocument dom = new System.Xml.XmlDocument();
dom.LoadXml(xml);
foreach (System.Xml.XmlNode node in dom.ChildNodes)
{
if(node.Name !="xml")
Response.Write(GetNode(node)+"");
}
} string GetNode(System.Xml.XmlNode node)
{
string str = node.InnerText;
if (node.HasChildNodes)
{
str = "";
foreach (System.Xml.XmlNode n in node.ChildNodes)
{
str += GetNode(n);
}
}
return str;
}
使用XmlTextReader方法很多
网上很多例子都是这样解析Xml文件
XmlDocument doc = new XmlDocument();
doc.Load("c:\\xml\\google.xml"); //以上数据在c:\\xml\\google.xml文件里
XmlNode xn = doc.SelectSingleNode("kml/Document"); 像以上三行代码就可以解析google.xml文件 xn就得到<Document>元素
但我试了不行 但我以这种格式试了别的XML文件就行我不知道是不是因为google.xml文件有命名空间请您帮我解答一下 非常感谢