易截截图软件、单文件、免安装、纯绿色、仅160KB

python 读xml文件

def getText(self,nodelist):
rc=""
for node in nodelist:
if node.nodeType == node.TEXT_NODE or node.nodeType == node.CDATA_SECTION_NODE:
rc = rc + node.data
return rc
def parseXML(self,requesturl,xml):
dom = minidom.parse(requesturl)
for node in dom.getElementsByTagName('category'):
xml.append({
'categoryid': self.getText(node.getElementsByTagName("categoryid")[0].childNodes),
'categoryname': self.getText(node.getElementsByTagName("categoryname")[0].childNodes)
})
主函数:
  xml=[]
  self.parseXML(self.file_path,xml)


相关文档:

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/Command ......

js 读取xml兼容各种浏览器

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 ......

使用XMLHttpRequest处理xml数据(二)


首先写一个html页面userxmlajax.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>用户校验ajax实例</title>
  &nbs ......

使用jquery处理xml数据(三)

首先写一个html userxmljquery.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>用户校验ajax实例</title>
   & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号