ImageVerifierCode 换一换
格式:DOCX , 页数:15 ,大小:21.02KB ,
资源ID:27449889      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/27449889.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(XMLDOM大全1Dom Objects introduce.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

XMLDOM大全1Dom Objects introduce.docx

1、XMLDOM大全1Dom Objects introduceMicrosoft DOM Objects Table of ContentsOverviewDOM objects1. DOMDocument2. XMLDOMElement3. XMLDOMNode4. XMLDOMNodeList5. XMLDOMNamedNodeMap6. XMLDOMCDATASection7. XMLDOMAttribute8. XMLDOMDocumentType9. XMLDOMEntity10. XMLDOMProcessingInstruction11. XMLDOMParseErrorXMLHT

2、TPRequestDOM object properties(please see another Document)1. async2. Attributes3. childNodes4. data5. docType6. documentElement7. length8. namespaceURI9. nodeName10. nodeType11. The 12 Node types12. nodeTypedValue13. nodeTypeString14. nodeValue15. ondataavailable16. ownerDocument17. parentNode18. p

3、arsed19. parseError20. prefix21. preserveWhiteSpace22. resolveExternals23. tagName24. text25. url26. validateOnParse27. valueDOM object methods(please see another Document)1. abort()2. appendChild()3. cloneNode()4. createAttribute(), createCDATASection(), createComment(),createElement(), createEntit

4、yReference(),createProcessingInstruction(), createTextNode()5. createNode()6. getAttribute()7. getAttributeNode()8. getElementsByTagName()9. getNamedItem()10. hasChildNodes()11. insertBefore()12. load()13. loadXML()14. nextNode()15. nodeFromID()16. removeAttribute()17. removeAttributeNode() 18. remo

5、veChild()19. removeNamedItem()20. replaceChild()21. reset()22. save()23. selectNodes()24. selectSingleNode()25. send()26. setAttribute()27. setAttributeNode()28. setNamedItem()29. transformNode()30. transformNodeToObject()Microsoft DOM Document Object TutorialXML Programming with VB and ASP gives a

6、VB/ASP developer a from-the-ground-up start to XML and XML programming in VB and ASP. Fun to read and easy going, this is a no-frills book which gets right to the point. More advanced topics include BizTalk, schemas, webclasses and XSL. What this chapter of the book covers: Descriptions of the Micro

7、soft XML objects Sample code for most of the methods and properties Easy-reference table guide to the objectsOverviewMicrosoft has shipped some very useful objects with IE5 that can be used from any programming language that can make use of COM objects. In this part of the book, we will focus on the

8、 XML DOM objects using VB or VBScript.To better understand code or descriptions of the DOMDocument, try to think of an XML document as a tree. Another useful analogy is to think of parents and their children.To better understand code or descriptions about the DOM, try to think of an XML document as

9、a tree. Another useful analogy is to think of parents and their children. We start with the actual root of the document, then it meanders down to each processing instruction, the document root element, attributes, etc. These objects in the DOM are known by there own type (e.g., Element, Attribute, e

10、tc.), but each type is generally called a Node. The DOM gives us collections objects as well, known as NodeLists when a parent has many children that need to be grouped. Figure describes how the tree structure is implemented:This chapter, while comprehensive, should not be used as a complete referen

11、ce.The XML DOM Object implements the XML DOM interfaces. These interfaces make reusability throughout the DOM practical. Because these two objects share the same interfaces, the code becomes easier to understand and work with, which we will see in a short while.DOM objectsFirst we need to explain th

12、e various, common DOM objects that you will use with the MSXML DOM Object.We will focus on the examples of these XML DOM objects shown in table .0.0.1 XML DOM ObjectsObject nameDescriptionDOMDocumentThis object represents the root of the XML file.XMLDOMElementThis object represents each element in t

13、he DOM- Document, namely the root, root element, and each other element.XMLDOMNodeThis object represents a single Node in the document tree and includes support for data types, namespaces, DTDs, and XML Schemas.XMLDOMNodeListUse this object to access (by name) and iterate through the XMLDOMNode coll

14、ection.XMLDOMNamedNodeMapUse this object to access and iterate through the attributes in an element.XMLDOMCDATASectionThis object represents a section in the value of an ele ment that is closed in the CDATA section brackets, which are characters that cannot be parsed by the XML.XMLDOMAttributeThis o

15、bject represents a single attribute Node for a given element.XMLDOMDocumentTypeThis object represents the Document Type (DTD) in an XML file.XMLDOMEntityThis object represents an entity in the DTD section of the XML file.XMLDOMProcessingInstructionThis object represents a processing instruction foun

16、d in the XML file.XMLDOMParseErrorThis object returns detailed information about the last error, including the line number, character position, and a text description.XMLHTTPRequestThis object enables you to establish a connection to a web server from your code and send put, get, and other standard

17、HTML requests.In our examples, we will refer to these objects using the names listed in table .0.0.1 XML object naming conventions (continued)XML object interfaceOur naming conventionDOMDocumentobjDOMDocumentXMLDOMNodeobjXMLDOMNodeXMLDOMNodeListobjXMLDOMNodeListXMLDOMNodeListMapobjXMLDOMNodeListMapX

18、MLDOMParseErrorobjXMLDOMParseErrorXMLDOMElementobjXMLDOMElementXMLDOMAttributeobjXMLDOMAttributeThis manuscript is an abridged version of a chapter from the Manning Publications book XML Programming with VB and ASP. This chapter looks at the Microsoft DOM objects. NOTE: Most images have been removed

19、 to increase speed and many of the code comments have also been removed for presentation. Please purchase the book to enjoy the full experience of all the chapters with images and code comments!DOMDocumentThe DOMDocument object represents the root of the XML file. As the file is loaded into the DOMD

20、ocument, the XML file and its external references, such as DTDs, get validated by the DOMDocument. The DOMDocument is the first port of call to the XML file. This is the only object that can be created. All the other objects, like the elements, can only be created or accessed from the DOMDocument ob

21、ject.ExampleThis example loads an XML file into a DOMDocument object:Dim objDOMDocument As DOMDocumentSet objDOMDocument = New DOMDocumentobjDOMDocument.async = FalseobjDOMDocument.Load http:/localhost/xmlcode/people2.dtdXMLDOMElementThis object represents each element in the XML tree. The XMLDOMEle

22、ment includes support for manipulating the element and the attributes associated with the element.The attributes associated with an element are added and manipulated via the XMLDOMElement object.ExampleThe following example returns the root element of the XML file from a DOMDocument:Dim objDOMDocume

23、nt As DOMDocumentDim objXMLDOMElement As IXMLDOMElementSet objDOMDocument = New DOMDocumentobjDOMDocument.async = FalseobjDOMDocument.Load http:/localhost/xmlcode/people2.dtdSet objXMLDOMElement = objDOMDocument.documentElementXMLDOMNodeThis is one of the base objects of the DOM. Most of the other D

24、OM objects inherit this object; therefore, you will see a lot of properties and methods repeated in each of these objects. These objects are:DOMDocumentXMLDOMAttributeXMLDOMCDATASectionXMLDOMCommentXMLDOMDocumentFragmentXMLDOMDocumentTypeXMLDOMElementXMLDOMEntityXMLDOMEntityReferenceXMLDOMNotationXM

25、LDOMProcessingInstructionXMLDOMTextXTLRuntimeAlthough all these objects inherit methods and properties from the XMLDOMNode object, they will all also have properties and methods that are unique to their function. For example, the XMLDOMElement object has extra methods for obtaining attribute informa

26、tion. The XMLDOMNode interface provides just the basic information, like the name of the Node, its text, etc.To know which type of Node is currently being accessed, the nodeType property returns which type of Node you are referencing when using the XMLDOMNode object, which is explained in detail lat

27、er in this chapter under the nodeType property.Also, see the docType property for more information on Dual interfaces. This explains how to cast from one type of object to the other.ExampleThe following example is the same as the example from the XMLDOMElement, except it now uses the XMLDOMNode obje

28、ct to return the root element of the XML file from a DOMDocument.Dim objDOMDocument As DOMDocumentDim objXMLDOMNode As IXMLDOMNodeSet objDOMDocument = New DOMDocumentobjDOMDocument.async = FalseobjDOMDocument.Load http:/localhost/xmlcode/people2.dtdSet objXMLDOMNode = objDOMDocument.documentElementX

29、MLDOMNodeListThe XMLDOMNodeList object is a collection of Nodes. Its methods allow us to iterate through all the children Nodes of a Node. You can use the For Each . Next loop for this iteration. However, you can also choose to iterate through these Nodes using its method of nextNode().This object i

30、s returned in the property, such as childNodes, or methods such as getElementsByTagName() and selectNodes().ExampleThe following example uses the childNodes property of the DOMDocument to return the children Nodes of the root element of the DOMDocument. (For more details see the childNodes property,

31、 which also shows an example of how to iterate through the XMLDOMNodeList collection.)Dim objDOMDocument As DOMDocumentDim objXMLDOMNodeList As IXMLDOMNodeListSet objDOMDocument = New DOMDocumentobjDOMDocument.async = FalseobjDOMDocument.Load http:/localhost/xmlcode/people2.dtdSet objXMLDOMNodeList = objDOMDocument.documentElement.childNodesXMLDOMNamedNodeMapThis is the other collection object in the DOM. It is used to iterate through the attributes for a specific element. It also allows you to manipulate the attribute collection for an element. To name a f

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1