??xml version="1.0" encoding="utf-8" standalone="yes"?>
<%@ Language=VBScript %>
strPath = Server.MapPath(".") & "/New.xml"
obj
XML
.createFile strPath, "Root"
obj
XML
.createRootChild "Images"
'Here only one attribute is added to the Images/Image Node
'Notice that all three job nodes have size 24, all of those
'Notice that only two nodes have the specified XPath, hence
'It is always important to iterate through all of the nodes
Response.Redirect "New.xml"
<%
'*********************************************************************
'Initialize Class Members
'Terminate and unload all created objects
'*********************************************************************
'Set
XML
File and objDoc
'Get
XML
File
'*********************************************************************
'Create Blank
XML
File, set current obj File to newly created file
'Get
XML
Field(s) based on XPath input from root node
'Update existing node(s) based on XPath specs
'Create node directly under root
'Create a child node under root node with attributes
'Create a child node under the specified XPath Node
'Create a child node(s) under the specified XPath Node with attributes
'Delete the node specified by the XPath
vbscȝ成xml文g
有两文g:
obj
XML
.
asp
:试文g
cls
XML
.
asp
:vbscL?br />代码:
obj
XML
.
asp
<% Option Explicit %>
<!--#INCLUDE FILE="cls
XML
.
asp
"-->
<%
Dim obj
XML
, strPath, str
Set obj
XML
= New cls
XML
'Or If using an existing
XML
file:
'obj
XML
.File = "C:/File.xml"
obj
XML
.createChildNodeWAttr "Images", "Image", "id", "1"
obj
XML
.updateField "Images//Image[@id=1]", "super.gif"
obj
XML
.createRootNodeWAttr "Jobs", Array("Size", "Length", "Width"), _
Array(24, 31, 30)
obj
XML
.createRootNodeWAttr "Jobs", Array("Size", "Length", "Width"), _
Array(24, 30, 29)
obj
XML
.createRootNodeWAttr "Jobs", Array("Size", "Length", "Width"), _
Array(24, 31, 85)
'nodes will be updated
obj
XML
.updateField "Jobs[@Size=24]", "24's"
'only two new child nodes will be added
obj
XML
.createChildNodeWAttr "Jobs[@Size=24 and @Length=31]", "Specs", _
Array("Wood", "Metal", "Color"), _
Array("Cedar", "Aluminum", "Green")
'returned by this XPath query.
For Each str In obj
XML
.getField("Jobs[@Size=24]")
Response.Write(str & "<br>")
Next
Set obj
XML
= Nothing
%>
Class cls
XML
'strFile must be full path to document, ie C:/
XML
/
XML
File.
XML
'objDoc is the
XML
Object
Private strFile, objDoc
' Initialization/Termination
'*********************************************************************
Private Sub Class_Initialize()
strFile = ""
End Sub
Private Sub Class_Terminate()
Set objDoc = Nothing
End Sub
' Properties
'*********************************************************************
Public Property Let File(str)
Set objDoc = Server.CreateObject("Microsoft.
XML
DOM")
objDoc.async = False
strFile = str
objDoc.Load strFile
End Property
Public Property Get File()
File = strFile
End Property
' Functions
'*********************************************************************
Public Function createFile(strPath, strRoot)
Dim objFSO, objTextFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(strPath, True)
objTextFile.WriteLine("<?xml version=""1.0""?>")
objTextFile.WriteLine("<" & strRoot & "/>")
objTextFile.Close
Me.File = strPath
Set objTextFile = Nothing
Set objFSO = Nothing
End Function
Public Function getField(strXPath)
Dim objNodeList, arrResponse(), i
Set objNodeList = objDoc.documentElement.selectNodes(strXPath)
ReDim arrResponse(objNodeList.length)
For i = 0 To objNodeList.length - 1
arrResponse(i) = objNodeList.item(i).Text
Next
getField = arrResponse
End Function
Public Function updateField(strXPath, strData)
Dim objField
For Each objField In objDoc.documentElement.selectNodes(strXPath)
objField.Text = strData
Next
objDoc.Save strFile
Set objField = Nothing
updateField = True
End Function
Public Function createRootChild(strNode)
Dim objChild
Set objChild = objDoc.createNode(1, strNode, "")
objDoc.documentElement.appendChild(objChild)
objDoc.Save strFile
Set objChild = Nothing
End Function
Public Function createRootNodeWAttr(strNode, attr, val)
Dim objChild, objAttr
Set objChild = objDoc.createNode(1, strNode, "")
If IsArray(attr) And IsArray(val) Then
If UBound(attr)-LBound(attr) <> UBound(val)-LBound(val) Then
Exit Function
Else
Dim i
For i = LBound(attr) To UBound(attr)
Set objAttr = objDoc.createAttribute(attr(i))
objChild.setAttribute attr(i), val(i)
Next
End If
Else
Set objAttr = objDoc.createAttribute(attr)
objChild.setAttribute attr, val
End If
objDoc.documentElement.appendChild(objChild)
objDoc.Save strFile
Set objChild = Nothing
End Function
Public Function createChildNode(strXPath, strNode)
Dim objParent, objChild
For Each objParent In objDoc.documentElement.selectNodes(strXPath)
Set objChild = objDoc.createNode(1, strNode, "")
objParent.appendChild(objChild)
Next
objDoc.Save strFile
Set objParent = Nothing
Set objChild = Nothing
End Function
Public Function createChildNodeWAttr(strXPath, strNode, attr, val)
Dim objParent, objChild, objAttr
For Each objParent In objDoc.documentElement.selectNodes(strXPath)
Set objChild = objDoc.createNode(1, strNode, "")
If IsArray(attr) And IsArray(val) Then
If UBound(attr)-LBound(attr) <> UBound(val)-LBound(val) Then
Exit Function
Else
Dim i
For i = LBound(attr) To UBound(attr)
Set objAttr = objDoc.createAttribute(attr(i))
objChild.SetAttribute attr(i), val(i)
Next
End If
Else
Set objAttr = objDoc.createAttribute(attr)
objChild.setAttribute attr, val
End If
objParent.appendChild(objChild)
Next
objDoc.Save strFile
Set objParent = Nothing
Set objChild = Nothing
End Function
Public Function deleteNode(strXPath)
Dim objOld
For Each objOld In objDoc.documentElement.selectNodes(strXPath)
objDoc.documentElement.removeChild objOld
Next
objDoc.Save strFile
Set objOld = Nothing
End Function
End Class
%>
http://www.peugeot.com.cn/web/307/
http://www.blueidea.com/bbs/newsdetail.asp?page=4&id=1935698&Daysprune=&lp=1
http://www.skii.com.cn/pitera/index.html
http://www.wangbao.com.cn/main.html
http://land.anycall.com/event/anyclub2/event_main.jsp
http://www.gglc.com.cn/main.htm
http://www.boyaguoji.com/index1.htm
www.superaction.co.kr
Adobeq_业务单元的首席Y件架构师兼高U副dKevin Lynch透露Q他们正开发一个代号ؓ(f)Apollo的项目,它将使得针对Adobe的Flash Presentation软g开发的应用E序不用|页览器就能运行?/p>
Lynch表示QApollo预计明年初就?x)免?gu)供下载,它开发的目的是ؓ(f)?jin)克服目前网应用的限制。目前,FlashE序是运行在|页览器当中的。他q表C,Apollo是基于客L(fng)的YӞ它可以独立于|页览器之外运行FlashE序而不是在线q是ȝ?/p>
Apollo是设计来为开发h员提供一U创建可渲染Flash动画、HTML和AcrobatQPDFQ文件应用程序的途径?/p>
Lynch表示Q如emailq些原生的网l应用程序,虽然它们可以q行在不同的操作pȝ之上Q但是当用户断开|络q接时就无能为力?jin);而Apollo正是可以弥补q一~陷?/p>
ApolloE序在用户下U时q会(x)l箋q行Qƈ且当用户重新上线时就?x)自动的更新数据。例如,某h在离U的状态下通过手持讑֤或笔记本来预订机;当他重新链接到网l时Q这个Y件就?x)自动的完成剩下的业务?/p>
除此之外QApollo应用E序和其它桌面应用程序没什么区别:(x)它们都拥有独立的图标来运行程序,q且可以在系l辅助工具中看到它们?/p>
一个早期版本的Apollo软g预期?x)在今年q底推出Q到时用户可以从Adobe Labs官方|站下蝲。程序员可以利用Adobe现有的工具品线来编写运行在Apollo中的应用E序?/p>
“哦?你很有方法嘛Q?rdquo;我附和了(jin)一下?
“做出UR司机Q也要用U学的方法?rdquo;他说。我一愣,时很有些兴?ldquo;什么科学的
Ҏ(gu)Q?rdquo;
“要懂得统计。我做过_的计。我说给你听啊。我每天开17个小时的车,每小
时成?4.5?hellip;…”
“怎么出来的Q?rdquo;我追问?
“你算啊,我每天要?80元,油费大概210元左叟뀂一?7时Q^均每时固定?
?2元,交给公司Q^均每时12.5元a(b)贏V这是不是就?4.5 元?”Q我有些?
讶。我打了(jin)10q的车,W一ơ听到有出租车司么计成本。以前的司机都和?
_(d)每公里成?.3元,另外每天交多钱之类的?
“成本是不能按公里的Q只能按旉。你看,计h(hun)器有一?ldquo;(g)?rdquo;功能。你可以
看到一天的详细记录。我做过数据分析Q每ơ蝲客之间的I驶旉q_?分钟。如
果上来一个v步h(hun)Q?0元,大概要开10分钟。也是每一?0元的客h要花17分钟
的成本,是9.8元。不赚钱啊!如果说做东、杭州、青的客h是吃饭,?0?
的客吃菜都算不上Q只能算是撒?jin)些味精?rdquo;
强!q位师傅听上ȝ不象出租车司机,到象是一位成本核师?ldquo;那你怎么?
呢?”我更感兴了(jin)Ql问。看来去机场的\上还能学到新东西?
“千万不能被客h?jin)满街跑。而是通过选择停R的地点,旉Q和客户Q主动地?
定你要去的地斏V?rdquo;我非常惊Ӟq听上去很有意思?ldquo;有h说做出租车司机是靠运
气吃饭的职业。我以ؓ(f)不是。你要站在客L(fng)位置上,从客L(fng)角度L考?rdquo;q句
话听上去很专业,有点象很多商业管理培训老师说的“put yourself into others'
shoes.”
“l你举个例子Q医院门口,一个拿着药的Q一个拿着脸盆的,你带哪一个?rdquo;我想
?jin)想Q说不知道?
“你要带那个拿脸盆的。一般h病小痛的到医院看一看,拿点药,不一定会(x)dq?
的医院。拿着脸盆打R的,那是出院的。住院哪有不Mh的?今天二楼的谁M(jin)Q?
明天三楼又死?jin)一个。从医院出来的h通常?x)有一U重h生的感觉Q重新认识生
命的意义Q健h最重要。那天这个说Q走Q去青。眼睛都不眨一下。你说他?
打RCh民广场,再去做青线吗?l对不会(x)Q?rdquo;
我不由得开始佩服?
“再给你D个例子。那天h民广场,三个人在前面招手。一个年d子,拿着包Q?
刚买完东ѝ还有一寚wq男奻I一看就是逛街的。第三个是个里面I绒衬衫的,
外面绒服的男子Q拿着W记本包。我看一个h只要3U钟。我毫不犹U地停在这?
男子面前。这个男的上车后_(d)(x)延安高架、南北高架~~~q没说后面就忍不住问Qؓ(f)
什么你毫不犹U地开到我面前Q前面还有两个hQ他们要是想上RQ我也不好意?
和他们抢?
我回{说Q中午的时候,q有十几分钟?点了(jin)。那个女孩子是中午溜出来C?
的,估计公司很近Q那对男x游客Q没拿什么东西,不会(x)dq;你是出去办事
的,拿着W记本包Q一看就是公务。而且q个时候出去,估计应该不会(x)q。那个男
的就_(d)你说对了(jin)Q去宝山?rdquo;
“那些在超?jng)门口,地铁口打车,I着睡衣的h可能dq吗Q可能去机场吗?机场
也不?x)让她进啊?rdquo;
有道理!我越听越有意思?
“很多司机都抱怨,生意不好做啊Qa(b)价又涨了(jin)啊,都从别hw上扑֎因。我_(d)?
永远从别n上找原因Q你永远不能提高。从自己w上找找看,问题出在哪里?rdquo;q?
话听h好熟Q好像是“如果你不能改变世界,改变你自己”Q或者Steven
Corvey?ldquo;影响圈和x?rdquo;的翻版?
“有一ơ,在南丹\一个h拦RQ去田林。后来又有一ơ,一个h在南丹\拦RQ还
是去田林。我问?jin),怎么你们从南丹\出来的hQ很多都是去田林呢?人家_(d)
在南丹\有一个公共汽车ȝQ我们都是坐公共汽R从东到q里Q然后搭车去?
林的。我恍然大?zhn)。比如你看我们开q的q条路,没有写字|没有酒店Q什么都
没有Q只有公共汽车站Q站在这里拦车的多半都是刚下公共汽R的,再选择一条最
短\l打车。在q里拦R的客户通常不会(x)高于15元?rdquo;
“所以我_(d)态度军_一切!”我听十几个总裁讲过q句话,W一ơ听出租车司
么说?
“要用U学的方法,l计学来做生意。天天等在地铁站口排队,怎么能赚到钱Q每?
月就?00块钱怎么L老婆孩子Q这是在谋杀啊!慢性谋杀你的全家。要用知?
武装自己。学?fn)知识可以把一个h变成聪明的hQ一个聪明的人学?fn)知识可以变?
很聪明的人。一个很聪明的h学习(fn)知识Q可以变成天才?rdquo;
“有一ơ一个h打Rȝ车站Q问怎么走。他说这么这么走。我说慢Q上高架Q再q?
么这么走。他_(d)q就l远?jin)。我_(d)没关p,你经常走你有l验Q你那么?0
块,你按我的走法Q等里程?0块了(jin)Q我q表。你只给50快就好了(jin)Q多的算?
的。按你说的那么走?0分钟Q我带你q么走只?5分钟。最后,按我的\赎ͼ?
C(jin)4公里Q快?5分钟Q我只收?0块。乘客很高兴Q省?0元钱左右。这4公里
Ҏ(gu)来说是1块多q沚w。我相当于用1元多׃?5分钟。我刚才说了(jin)Q我一
时的成?4.5块,我多合算啊!”
“在大众公司,一般一个司??千,拿回家。做的好的大?千左叟뀂顶U的司机
大概每月能有7000。全大众2万个司机Q大概只?-3个司机,万里挑一Q每月能?
?000以上。我是q?-3个h中间的一个。而且很稳定,基本不会(x)大的波动?rdquo;
太强?jin)!到此为止Q我来佩服这个出UR司机?
“我常常说我是一个快乐的车夫。有Q你是因的钱多,所以当然快乐N?
他们_(d)你们正好错了(jin)。是因ؓ(f)我有快乐、积极的?j)态,所以赚的钱多?rdquo;
说的多好啊!
“要懂得体呛_作带l你的美。堵在h民广场的时候,很多司机抱怨,又堵车了(jin)Q真
是倒霉。千万不要这P用心(j)体会(x)一下这个城?jng)的,外面有很多漂亮的奛_子经
q,非常C的高楼大厦,虽然CP但是却可以用ƣ赏的眼光去享受。开车去
机场Q看着两边的绿Ԍ冬天是白色的Q多啊。再看看里程表,100多了(jin)Q就更美
?jin)!每一样工作都有她丽的地方,我们要懂得从工作中体?x)这U美丽?rdquo;
“?0q前是强生公司的Ll?q前在公怽q三个不同部门的部门l理。后?
我不q了(jin)Q一个月??千块Q没意思。就d来做司机。我愿意做一个快乐的?
夫。哈哈哈哈?rdquo;
C(jin)机场Q我l他留了(jin)一张名片,_(d)(x)“你有没有兴趣q个星期五,到我办公室,l?
微Y的员工讲一讲你怎么开出租车的Q你当打着表,60公里一时Q你讲多久,
我就付你多少钱。给我电(sh)话?rdquo;
我迫不及(qing)待的在飞Z记录下他q堂生动的MBA课?/p>