XML取值应用实例
原贴:http://topic.csdn.net/u/20100412/14/f6941844-e9bf-4ed7-a0c2-bef03d775783.html?70615
declare @data xml=
'<root>
<SaleMan>
<SaleManId>1</SaleManId>
<SaleManCode>001</SaleManCode>
<Nodes>
<Node>
<NodeId>101</NodeId>
<NodeCode>101</NodeCode>
<CardSetting>
<R1>1</R1>
<R2>2</R2>
<R3>3</R3>
</CardSetting>
</Node>
<Node>
<NodeId>102</NodeId>
<NodeCode>102</NodeCode>
<CardSetting>
<R1>1</R1>
<R2>2</R2>
<R3>3</R3>
<R8>0</R8>
</CardSetting>
</Node>
<Node>
<NodeId>103</NodeId>
<NodeCode>103</NodeCode>
<CardSetting>
<R1>1</R1>
<R2>2</R2>
<r3>3</r3>
</CardSetting>
</Node>
</Nodes>
</SaleMan>
<SaleMan>
<SaleManId>2</SaleManId>
<SaleManCode>002</SaleManCode>
<Nodes>
<Node>
<NodeId>101</NodeId>
<NodeCode>101</NodeCode>
<CardSetting>
<R1>5</R1>
<R2>7</R2>
<R3>4</R3>
<R8>3</R8>
</CardSetting>
</Node>
</Nodes>
</SaleMan>
<SaleMan>
<SaleManId>3</SaleManId>
<SaleManCode>003</SaleManCode>
<Nodes>
<Node>
<NodeId>101</NodeId>
<NodeCode>101</NodeCode>
<CardSetting>
<R1>4</R1>
&
相关文档:
1.route.xml文件内容
<?xml version="1.0" encoding="GBK"?>
<root>
<route id="1111">
<id>111</id>
<name>四川</name>
<path>www.baidu.com/hehe.html</path>
</route>
</root>
2.test.html代码
<html>
<body>
<script> ......
1 在Action实现类方面的对比:Struts 1要求Action类继承一个抽象基类;Struts 1的一个具体问题是使用抽象类编程而不是接口。Struts 2 Action类可以实现一个Action接口,也可以实现其他接口,使可选和定制的服务成为可能。Struts 2提供一个ActionSupport基类去实现常用的接口。即使Action接口不是必须实现的,只有一 ......
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;
(1)使用JDOM首先要指定使用什么解析器。如:
SAXBuilder builder=new SAXBuilder(false) ......
var xmlDom; //XML DOM object
var xmlFile="ff.xml"; //xml file name
loadXML = function(fileRoute){
xmlDoc=null;
if (window.ActiveXObject){
xmlDoc = new ActiveXObject('Msxml2.DOMDocument');
xmlDoc.async=false;
xmlDoc.load(fileRoute);
}else if (document.implementation &a ......