XML object model

zhaozj2021-02-16  46

XML object model

-------------------------------------------------- ---------- Source: Extreme Self-actress XML Second Edition (scriptxml): Appendix A XML Object Model Sir: Freeta Date: 2003-10-25

Chapter 5 talks about how to use Script to integrate with components in an HTML page, and how to cooperate with XML object models. This appendix will explore the XML object model in detail, including objects that make up the model, their properties and methods, and how they are applied in the application.

Object model structure

As we discussed in Chapter 3, the subject is a tissue of a tree structure. The label of the tree is a Document object, and other objects are branched by this object.

The XML object model consists of four basic objects:

Document Object -XML Data Source. Node Object - A parent node or one of the child nodes. NodeList object - the list of brothers nodes. ParseError object - an object that has no content, used to receive errors messages

Figure A-1 shows the relationship between these objects.

Document | | ------------ Node | ------- Node ------- | ------------ Node | ----------- Node | | -------------- Node | ------------ nDE | ---- ---------- Node | -------------- Node Figure A-1: ​​XML object model

Each object in the object model has a specific attribute or method, or both. If you use the Script program code, the content author can use these attributes and methods to acquire information and use XML data. This appendix will fully introduce the XML object model and view these objects and related properties and methods. Since this book is to discuss how to use XML, you must understand the operation of the object model. In this appendix later, there are some examples of how to use objects in an object model. To use these examples, you will need to list the text codes in A-1, or you can find it (Appxa / Lasta_1.xml) in the book CD.

jodie@msn.com bill@msn.com < /FRMY (CCC) (,,,,,,,,,,,,,,,,,,,........................................................................................................................................................................................................................................................................... .. Structure.

[Text code A-1]

You can see from the file type declaration, this file uses DTD. This DTD file is as shown in text code A-2, you can also find it in the APPXA / LSTA_2.DTD in the book CD.

[text code A-2]

Finally, the XML file will be displayed through the HTML web page, the following is the text code of HTML (in the APPXA / LSTA_3.HTM of the Script Disc).