由于要转到开发WAP上,所有对WML要学习一下,以后还要有XHTML,这些都是与XML密不可分的,XML还是师傅级的,
所以准备先学习一下XML.现在感觉XML确实不错,现在越学越有兴趣,今天又学了点东东,放到网上,记录自己的学习历程
:创建XML文档对象:
Javascript:
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
VBscript:
set xmlDoc = createObject("Microsoft.XMLDOM")
VB in asp:
set xmlDoc = server.createObject("Microsoft.XMLDOM")
载入XML文档:
<script type="text/javascript">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async = "false"
xmlDoc.load("note.xml")
</script>
载入字符XML文档:
<script type="text/javascript">
var text="<note>"
text=text+"<to>Tove</to><from>Jani</from>"
text=text+"<heading>Reminder</heading>"
text=text+"<body>Don't forget me this weekend!</body>"
text=text+"</note>"
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.loadXML(text)
// ....... processing the document goes here
</script>
NameSpace:
xmlns:namespace-prefix="namespace"
默认Namespace:
<element xmlns="namespace">