XML分解实例
原贴: http://topic.csdn.net/u/20100414/11/c69748ac-e0b2-490f-bde9-7c5284c3660c.html?seed=1832202493
declare @xml xml=
'<upd:Update xmlns:lar="http://schemas.microsoft.com/msus/2002/12/LogicalApplicabilityRules" xmlns:cmd="http://schemas.microsoft.com/msus/2002/12/UpdateHandlers/CommandLineInstallation" xmlns:bar="http://schemas.microsoft.com/msus/2002/12/BaseApplicabilityRules" xmlns:upd="http://schemas.microsoft.com/msus/2002/12/Update">
<upd:UpdateIdentity UpdateID="9f79459a-d72e-49fc-acb0-1adbb2e63686" RevisionNumber="103"/>
<upd:Properties DefaultPropertiesLanguage="en" UpdateType="Software" Handler="http://schemas.microsoft.com/msus/2002/12/UpdateHandlers/CommandLineInstallation" PublicationState="Published" CreationDate="2005-04-26T08:21:13.989Z" PublisherID="395392a0-19c0-48b7-a927-f7c15066d905" MaxDownloadSize="3320008" MinDownloadSize="0">
<upd:InstallationBehavior RebootBehavior="CanRequestReboot"/>
<upd:Language>zh-cn</upd:Language>
</upd:Properties>
<upd:LocalizedPropertiesCollection>
<upd:LocalizedProperties>
<upd:Language>en</upd:Language>
<upd:Title>Critical Update for SQL Server 2000 Desktop Engine (Windows) on Windows Server 2003 (KB829358)</upd:Title>
</upd:LocalizedProperties>
</upd:LocalizedPropertiesCollection>
<upd:Relationships>
<upd:Prerequisites>
<upd:UpdateIdentity UpdateID="30b6a809-9ba3-4c0f
相关文档:
用c#给PDA做了一个PC端的通讯程序,需要保存两个参数。用Delphi时,是保存在ini文件中,c#读写XML比较方便,就用xml文件来保存了。
class CXmlClass
{
private string XmlFilePath;
/// <summary>
/// 下载到PDA的TXT文件路径
/// </summary>
......
一、简单介绍
using System.Xml;
//初始化一个xml实例
XmlDocument xml=new XmlDocument();
//导入指定xml文件
xml.Load(path);
xml.Load(HttpContext.Current.Server.MapPath("~/file/bookstore.xml"));
//指定一个节点
XmlNode root=xml.SelectSingleNode("/root");
//获取节点下所有直接子节点
XmlNodeList ch ......
<asp:DropDownList ID="compactType" runat="server" AutoCallBack="True" Width="153px"> </asp:DropDownList>
<?xml version="1.0" encoding="utf-8" ?>
<roots>
<root>
<id>1</id>
<Culture> ......
这个效果应该不算什么稀奇,网上也有现成的代码,我这个也没什么特别的地方,只是因为我自己写的,也算是为学习DOM后一个练习;在IE下测试通过;
实现效果是这样的:
读取XML文档;
采用递归生成无限级的树形菜单;
能够响应鼠标事件,展开与拆叠子级菜单;
首先是生成一个XML文档,我用的是XML Spy的编辑器;
< ......