DHTML and DOM Venkat Subramaniam svenkatcs uh edu
DHTML and DOM Venkat Subramaniam – svenkat@cs. uh. edu 1
Style Sheets: CSS and CSS 2 • W 3 C recommendation on Cascading Style Sheet • CSS level 1 specification allows expressing style of contents • CSS level 2 specification goes further into – positioning – use of HTML 4. 0 – defining additional tags Venkat Subramaniam – svenkat@cs. uh. edu 2
Positioning • HTML elements are positionable • You may specify where they should appear – as part of the style – position attribute • position attribute may take – absolute • Position based on or relative to the parent container. Natural document flow ignored. – relative • Position is relative to the normal document flow. – static • element not positionable, maintains normal position. Venkat Subramaniam – svenkat@cs. uh. edu 3
Positioning Context • Positioning context is a point which corresponds to (0, 0) for an element • For the HTML document, it starts with the top left corner of browser window (document area) • When you define a block level element, it defines a new context for that element – Every thing is now relative to this new context • You can define a new context by setting the position attribute Venkat Subramaniam – svenkat@cs. uh. edu 4
Absolute vs. Relative <HEAD><STYLE> SPAN. l 1 {position: absolute; left: 20; top: 30} SPAN. l 2 {position: relative; left: 20; top: 30} </STYLE></HEAD> <BODY> <DIV>Hello <SPAN class="l 1">there</SPAN> <SPAN class="l 2">!</SPAN> </DIV> With no positioning only first Positioning absolute positioning Venkat Subramaniam – svenkat@cs. uh. edu Moved with respect to where browser would have placed it otherwise 5
Positioning Attributes • position – style rule for a postionable element • left – offset from left edge of positioning context to left edge of box • top – offset from top edge of positioning context to top edge of box • width – width of absolute positioned element’s content • height – height of absolute positioned element’s content • clip – viewable area shape, dimension of an absolute positioned element • overflow – for handling contents that exceed height/width • visibility – says if element is visible or not • Z-index Venkat svenkat@cs. uh. edu 6 – Subramaniam stacking –order of a positionable element
DOM: Document Object Model • HTML documents are parsed and displayed by browsers • Fonts and colors may be specified • To a certain extent position may be specified • How about dynamically modifying the contents on the front end? • DOM provides handled into the browser, allowing us to access various components Venkat – svenkat@cs. uh. edu of. Subramaniam the document at run time 7
Document Object Model • Document class represents an HTML document • Provides you a write method – you can generate HTML dynamically on the clientside • Document’s properties – alink. Color – anchors[] – applets[] – bg. Color – cookie – Domain – embeds[] – fg. Color – forms[] Venkat Subramaniam – svenkat@cs. uh. edu – – – – images[] last. Modified link. Color links[] referrer title URL vlink. Color 8
Scripting Events • Various types of events are generated • Types of events depends on the positionable element • Event handler may be specified as an attribute of the element • For certain events, returning – true will result in browser continuing with its usual behavior – false will result in browser ignoring the rest of action Venkat Subramaniam – svenkat@cs. uh. edu 9
Dynamic Techniques • DOM allows us to address elements • Event allows us to respond to activities • Scripts can effectively – provide event handlers – access elements using DOM • Dynamic content generation on the front end for data validation and varying presentation and style Venkat Subramaniam – svenkat@cs. uh. edu 10
DOM • Browser exposes the object model of the document for you to manipulate • The Document Object Model Venkat Subramaniam – svenkat@cs. uh. edu 11
The structure of a document • An XML document contains – data and – information on the data (Meta information) • XML document contains – the contents and – structure • What is the structure? – the types of items it contains • elements, child-elements, attributes, content data – relationship between these items • Which element is the parent of a child element • what are its attributes Venkat Subramaniam – svenkat@cs. uh. edu 12
Grove • Grove is an abstract model of a structure • It is the concept and representation of the structure of an XML document • It represents a tree view of – Elements • the child elements • the attributes – their values • content data • etc. • Grove is a model not an API of any kind – information on structure not mechanism to access it – various APIs used to access and manipulate these models Venkat Subramaniam – svenkat@cs. uh. edu 13
Object Model • Methods, properties provided to access a structure • The interface is the key – Hides the details of structure from programmers • Interface based programming allows one to – Access the details of an abstraction – Without depending on the specifics of the abstraction Venkat Subramaniam – svenkat@cs. uh. edu 14
What is DOM? • How do you access an XML document? • Need to parse and extract information among meta information • DOM is an interface/API for such access – Language and platform independent – Specification that may be implemented in any language • It provides the flexibility to read a document, to modify, to search it, to add on to it and remove from Venkat Subramaniam – svenkat@cs. uh. edu 15
What does DOM provide? • If you were to deal with a document, you are looking at the physical layout of its content • How many elements does it have? • How do you add an element? – Read through all elements and get to the end append! • How about a logical view of the document? – You can easily understand the structure – You can easily manipulate the structure using an interface/API Venkat Subramaniam – svenkat@cs. uh. edu 16
Why use DOM? • DOM parses and builds all information into memory • DOM – Validates well-formedness and grammar • Using DOM to create a document guarantees correctness of format – Provides logical/object view hiding the details • You can rely on the logical view rather than reading through file structure and tags – Helps it easy to manipulate the document • You don’t have to endure the pain of parsing • You can rely on API to read • Lets you delete arbitrary items from the document Venkat Subramaniam – svenkat@cs. uh. edu 17
Drawbacks of DOM • DOM ends up taking more memory – Much larger than the size of the document • Reads and builds information on the entire document • Not efficient for lookup of subset of information • Entire tree built, whether you need it or not Venkat Subramaniam – svenkat@cs. uh. edu 18
API for DOM • DOM is a specification of Interface • Several APIs implement this interface • Comes in different flavors • Watch out for parsing large sized documents • May take up too much memory to store large documents – Some implementations provide just-in-time extraction to manage large size data, at expense of additional seek and retrieval time Venkat Subramaniam – svenkat@cs. uh. edu 19
DOM aids document interchange • Provides effective method to exchange Platform independent self-describing data • Robustness and validation • Illustrates the relationship between data elements that may not otherwise be obvious Application Venkat Subramaniam – svenkat@cs. uh. edu Application 20
DOM facilitates data archival • Text formed data can be easily archived, parsed, compressed and transferred • The contents of a data store may be archived for later use or reference purpose • Applications (like mail program) may use this for archiving older mails/records • Useful for initialization/configuration information as well Venkat Subramaniam – svenkat@cs. uh. edu 21
Meaningful presentation of data • Client systems may interact with the DOM nodes to decide and to eliminate information that may or may not be relevant • By packaging the information with the semantics, client programs can put the information to better use • Systems may aid user with selective utilization of information Venkat Subramaniam – svenkat@cs. uh. edu 22
A common data exchange “gateway” App 5 App 4 App 3 App 0 App 1 App 2 App 5 App 4 XML DOM App 0 App 1 Venkat Subramaniam – svenkat@cs. uh. edu App 3 App 2 23
W 3 C’s DOM • “…platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents” • Level 0 – Functionality of Netscape 3. 0 and IE 3. 0 • Level 1 – Navigation and manipulation of HTML and XML doc – Oct. 1 1998 • Level 2 – Support for namespaces, plus changes to interfaces – Nov. 13, 2000 • Level 3 – Work under progress Venkat Subramaniam – svenkat@cs. uh. edu 24
The Tree Model • XML by nature provides relationships – Parent child relationship • This ideally falls into a tree model • Parent nodes connecting to child nodes gives logical view of data – Easy to conceptualize – Easy to abstract and model Nodes Parent Child Venkat Subramaniam – svenkat@cs. uh. edu Child 25
The Tree Model as seen from IE Venkat Subramaniam – svenkat@cs. uh. edu 26
Node and Node Types • A Node is a base type that is a generic node in the DOM Tree view model • Several types of specific node types exists • You will never create node of simply the type Node • You may treat all nodes as type Node, however Venkat Subramaniam – svenkat@cs. uh. edu 27
Document Node Types • Document – The master node – Parent node representing the document as a whole – Does not represent any specific piece of XML data – Allows creation and insertion of other nodes – Only one can exists in an XML document Venkat Subramaniam – svenkat@cs. uh. edu 28
Node. List Node Type • Node. List – Holds a collection of child nodes – Can provide information about child nodes • like how many is contained – Main purpose is to provide information and access to child nodes Parent Child Node. List Child Conceptual Model Child Venkat Subramaniam – svenkat@cs. uh. edu Child DOM Model 29
Named. Node. Map Node Type • Much like the Node. List in functionality • Provides the ability to access child nodes by name • Needed for accessing attributes – Typically attributes are lookup by their names • Used to hold attribute nodes Venkat Subramaniam – svenkat@cs. uh. edu 30
Element Node Type • Element node represents an element in XML doc • Each child element has a parent element node – Except topmost element node whose parent is the Document node • Each element may have optionally child elements • Top most element is given special name – document. Element Venkat Subramaniam – svenkat@cs. uh. edu 31
Text Node Type • Represent the text contained within element tags • This is what makes the content of the element – The PCDATA types Venkat Subramaniam – svenkat@cs. uh. edu 32
Attr Node Type • Generally specified within element • Represents attributes within scope of elements • Also used in Entity and Notation nodes Venkat Subramaniam – svenkat@cs. uh. edu 33
Tree Model with Elements, Attributes • Consider: <Catalog> <Book material="paper" cover="paperback"> <Title>Applied XML</Title> Document Node Attribute Node {material} Node. List Element Node {Catalog} Node. List Element Node {Book} Name. Node. Map Node. List Venkat Subramaniam – svenkat@cs. uh. edu Attribute Node {cover} Element Node {Title} Node. List Text Node {paperback} Node. List Text Node {Appli…}34
CDATA Section Node Type • Similar in nature to the Text node • Contains data that does not contain any markup • Arbitrary non parsed text makes up this Venkat Subramaniam – svenkat@cs. uh. edu 35
Document. Type Node Type • This represents a subset of what you put into DTD • This object provides you access to the DTD of a doc • Only ENTITY and NOTATION of DTD exposed – Known limitation of DOM • Child of the Document node • Parent to Entity node and Notation node Venkat Subramaniam – svenkat@cs. uh. edu 36
Entity. Reference Node Type • Entity. Reference node represents a reference to an entity that is declared in DTD • It contains a Text node • However – Text nodes under Entity. References are readonly – Pretty much use less since you can’t change this Venkat Subramaniam – svenkat@cs. uh. edu 37
A few other Node Types • Processing. Instruction – Represents a PI in a document – This is a child of the Document node • Comment – Represents a comment node • Document. Fragment – Stripped down version of Document node – Used as place holder when moving nodes around • Simply temporary storage of nodes to be reinserted into the tree Venkat Subramaniam – svenkat@cs. uh. edu 38
DOM API • DOM API comes in different languages and flavors • We will see the DOM API using Java. Script • Other scripting languages may also be used • The API pretty much maps over to other scripting languages and programming languages Venkat Subramaniam – svenkat@cs. uh. edu 39
var in Java. Script • Java. Script is not a strongly typed language • var refers to a variable that may be assigned any variable or object • It may be assigned just about any thing of any type • In case of xml data island, the id represents the Document node Venkat Subramaniam – svenkat@cs. uh. edu 40
Data Island Options • In an HTML file you may – Contain an XML file within – Refer to an external XML file <XML ID="xml. ID 101"> <!-- … content of the XML file> </XML> • Multiple data islands may appear with unique IDs • var doc. Node = an. ID; – Refers to a DOM document node object Venkat Subramaniam – svenkat@cs. uh. edu 41
Accessing XML DOM Node • Three ways to access an XML DOM node – The ID represents a document Node • var doc. Node = xml. ID 101; – The ID treated as HTML object model’s all collection • var doc. Node = document. all("xml. ID 101"); – You may obtain using the XMLDocument property • var doc. Node = document. all("xml. ID 101"). XMLDocument; Venkat Subramaniam – svenkat@cs. uh. edu 42
Using an independent XML DOC • IE 5 provides an XML parser as an Active. X object • The CLSID for the parser maps to the program alias – "microsoft. xmldom" • You may create an XML Parse object by calling – var parse = new Active. XObject("microsoft. xmldom"); • You may want to set parse. async = false to disable synchronous downloading • You may call load method to load your XML doc • Then use the functions on the Document object Venkat Subramaniam – svenkat@cs. uh. edu 43
Accessing an external XML Doc • You may place a XML within HTML – data island • You may also refer to an XML file outside • Simply – invoke the parser – ask it to load/parse external file • The document node object now refers to parsed external XML document Venkat Subramaniam – svenkat@cs. uh. edu 44
Displaying Document Node Info • The xml id represents the document node • We can create a variable that refers to this id • This is a reference or handle to a Document node object • You can now call document. Element to get to the root element • node. Name will tell you the name of the node Venkat Subramaniam – svenkat@cs. uh. edu 45
Classes in DOM API Venkat Subramaniam – svenkat@cs. uh. edu 46
Node Property: node. Name – String: name of node: effect depends on type of node • • • Document #document Element tag name Attribute attribute name Text #text CDATASection #cdata-section Comment #comment Entity entity name Notation name Entity. Reference name of entity reference Processing. Instruction target Document. Type document types name Document. Fragment #document-fragment Venkat Subramaniam – svenkat@cs. uh. edu 47
Node Property: node. Value – String: data of the node: effect depends on type of node • Attribute attribute value • Processing. Instruction text (following target) • Comment comment text • Text text • CDATASection text • Other nodes null Venkat Subramaniam – svenkat@cs. uh. edu 48
Node Property: node. Type – int: type of • The type of node and the corresponding int are • • • 1 2 3 4 5 6 7 8 9 10 11 12 Element Attribute Text CDATASection Entity. Reference Entity Processing. Instruction Comment Document. Type Document. Fragment Notation Venkat Subramaniam – svenkat@cs. uh. edu 49
Node Property: owner. Document • Document. Node: Document node in which the current node resides • Returns access to the highest level parent of any node • Very convenient for – creating other nodes – accessing top level details Venkat Subramaniam – svenkat@cs. uh. edu 50
Node Property: Accessing Other Nodes • child. Nodes – Node. List: holds collection of children nodes – If node does not have any children • then the returned Node. List will indicate a length of zero • parent. Node – Node: node of the parent • attributes – Named. Node. Map: holds all attributes of given node • • first. Child : Node last. Child : Node previous. Sibling : Node next. Sibling : Node Venkat Subramaniam – svenkat@cs. uh. edu 51
Node Methods Calling on non-supporting node type causes error • • insert. Before(new. Child: Node, ref. Child: Node) : Node – Inserts before ref. Child. At end if ref. Child null – DOMException thrown in case of invalid node type, … • replace. Child(new. Child: Node, old. Child: Node) : Node • remove. Child(old. Child: Node) : Node • append. Child(new. Child: Node) : Node – If new. Child is located somewhere else in tree • it is first removed from that location • then added to current list • has. Child. Nodes() : Boolean • clone. Node(deep: Boolean) : Node Venkat Subramaniam – svenkat@cs. uh. edu 52
Node Properties and Methods (Level 2) • normalize : void – moved from Element in Level 2 • is. Supported(feature : String , version : String) : boolean • has. Attributes() : boolean • namespace. URI : String • prefix : String • local. Name : String Venkat Subramaniam – svenkat@cs. uh. edu 53
Document Property: document. Element – Element node: highest level element in the document • This returns the top most element within the XML document • The given node is of type Element node Venkat Subramaniam – svenkat@cs. uh. edu 54
Document Property: doctype – Document. Type node: One that holds subset of DTDs • Returns the Document. Type object which holds a subset of the DTDs in the document Venkat Subramaniam – svenkat@cs. uh. edu 55
Document Property: implementation – DOMImplementation node: the DOM implemetation • DOMImplementation provides details about version • Mechanism to perform version checking on the doc Venkat Subramaniam – svenkat@cs. uh. edu 56
Document Methods • create. Element(tag. Name: String) : Element • create. Document. Fragment() : Document. Fragment • create. Text. Node(data: String) : Text • create. Comment(data: String) : Comment • create. CDATASection(data: String) : CDATASection • create. Processing. Instruction( target: String, data: String) : Processing. Instruction • create. Attribute(name: String) : Attribute • create. Entity. Reference(name: String) : Entity. Reference • get. Elements. By. Tag. Name(tag. Name: String) : Venkat Subramaniam – svenkat@cs. uh. edu 57 Node. List
Document Methods (Level 2) • import. Node(imported. Node : Node, deep : boolean) : Node • create. Element. NS(namespace. URI : String, qualified. Name : String) : Element • create. Attribute. NS(namespace. URI : String, qualified. Name : String) : Attr • get. Element. By. Tag. Name. NS(namespace. URI : String, local. Name : String) : Node. List • get. Element. By. ID(element. ID : String) : Element Venkat Subramaniam – svenkat@cs. uh. edu 58
Element Property: tag. Name • String: represents the tag name of the element • This information is the same as the one returned by node. Name on a Node • For an Element you may use either one interchangeably Venkat Subramaniam – svenkat@cs. uh. edu 59
Element Methods • • • get. Attribute(name: String): String set. Attribute(name: String, value: String) remove. Attribute(name: String) get. Attribute. Node(name: String) : Attribute remove. Attribute. Node(old. Attr: Attribute) : Attribute • set. Attribute. Node(new. Attr: Attribute) : Attribute • get. Elements. By. Tag. Name(name: String) : Node. List – Unlike Document’s method, returns only elements within the sub-tree of current element node, not whole doc Venkat Subramaniam – svenkat@cs. uh. edu 60
Element Methods (Level 2) • get. Attribute. NS(namespace. URI : String, local. Name : String) : String • set. Attribute. NS(namespace. URI : String, qualified. Name : String) : void • remove. Attribute. NS(namespace. URI : String, qualified. Name : String) : void • get. Attribute. Node. NS(namespace. URI : String, local. Name : String) : Attr • set. Attribute. Node. NS(new. Attr : Attr) : Attr • get. Elements. By. Tag. Name. NS(namespace. URI : String, local. Name : String) Node. List • has. Attribute(name : String) : boolean • has. Attribute. NS(namespace. URI : String, local. Name : String) : boolean Venkat Subramaniam – svenkat@cs. uh. edu 61
Attribute Properties • name: String • specified: Boolean – true if this attribute was specified in the XML document • value: String • owner. Element: Element – Introduced in DOM Level 2 – gives the element to which this attribute belongs Venkat Subramaniam – svenkat@cs. uh. edu 62
Node. List Properties and Methods • length: unsigned long int • item(index: unsigned long integer value) – Zero based index is used • On IE 5, a shortcut the. Node. child. Nodes(index) may be used instead of the. Node. child. Nodes. item(index) Venkat Subramaniam – svenkat@cs. uh. edu 63
Named. Node. Map Properties & Methods length: unsigned long integer • • get. Named. Item(name: String) : Node • set. Named. Item(node: Node) : Node – If another node with name same as given node exists • replaces that node – Exception thrown if • given node created in another document(OK in IE 5) • if read-only or given node in another element • remove. Named. Item(name: String) : Node • item(index: unsigned long integer value) : Node • Level 2 methods – get. Named. Item. NS(namespace. URI : String, local. Name : String) : Node – set. Named. Item. NS(arg : Node) : Node – remove. Named. Item. NS(namespace. URI : String, Venkat Subramaniam – svenkat@cs. uh. edu local. Name : String) : Node 64
Character. Data Properties, Methods • data: String • length: Integer • substring. Data(offset: unsigned long, count: unsigned long ) : String • append. Data(append. String: String) • insert. Data(offset: unsigned long, new. String: String) • delete. Data(offset: unsigned long, count: unsigned long) • replace. Data(offset: unsigned long, count: unsigned long, Venkat Subramaniam – svenkat@cs. uh. edu data: String) 65
Text Methods • split. Text(offset: long) : Text • Produces two text nodes from the text node on which it is called • First text node has characters from index 0 upto given offset • Second text node has characters from offset point to the original length – 1 Venkat Subramaniam – svenkat@cs. uh. edu 66
CDATASection & Comment • CDATASection – is identical to Text as it derives from it – no new properties or methods • Comment – is identical to Character. Data – no new properties or methods Venkat Subramaniam – svenkat@cs. uh. edu 67
Document. Type properites, Methods • name: String – Name of the root document that follows DOCTYPE – Read only access provided to this • entities: Named. Node. Map • notations: Named. Node. Map • No methods to manipulate any of these Venkat Subramaniam – svenkat@cs. uh. edu 68
Entity/Notation properties, Methods • systemid: String – This is what follows the SYSTEM declaration – If not present, will return null • publicid: String – This is what follows the PUBLIC declaration – If not present, will return null • The above two methods are also for Notation • notation. Name: String – Name of notation for unparsed entities (null for parsed ones) Venkat Subramaniam – svenkat@cs. uh. edu 69
Entity. Reference, Processing. Instruction • Entity. Reference does not add any more than Node • Processing. Instruction – target: String – data: String Venkat Subramaniam – svenkat@cs. uh. edu 70
DOMImplementation Methods • has. Feature(feature: String, version: String) : Boolean • If specified version exists for the specified feature, return true; otherwise returns false • Valid values as of now are – HTML and XML – Current version of XML is 1. 0 Venkat Subramaniam – svenkat@cs. uh. edu 71
DOMString • DOMString is really used to represent String • Based on language, it will map to String, BSTR, etc. • It represents a 16 -bit unicoded entity rather than a byte Venkat Subramaniam – svenkat@cs. uh. edu 72
DOMException • This is the exception class used in methods that throw exceptions • This maps to language specifics, as well Venkat Subramaniam – svenkat@cs. uh. edu 73
MS Extensions for DOM • Microsoft XML Parse provides extensions to the DOM model by adding support for – Data types support • Defines several data types like date, int, etc for validation – Namespace support • You can request for qualified name, prefix, URI – XSL support • transform. Node() method applies XSL transformation – Asynchronous downloads • async (enable/disable async download) • ready. State and parsed (describe state of document) • abort (abort async download and discard loaded document) – Thread safety support (Free threaded and rental model) • Microsoft. Free. Threaded. XMLDOM may be used to create Active. X object – xml property lets you persist XML tree • allows modification and save Venkat Subramaniam – svenkat@cs. uh. edu 74
MS DOM Interfaces • Similar to DOM interfaces, start with IXMLDOM – Provides additional properties and methods • IXMLDOMNamed. Node. Map, IXMLDOMNode. List • IXMLDOMParse. Error, IXMLDOMImplementation, IXMLDOMHttp. Request • IXMLDOMNode – IXMLDOMDocument. Fragment – IXMLDOMAttribute – IXMLDOMElement – IXMLDOMDocument Here we address Some of the – IXMLDOMDocument. Type interesting /important ones – IXMLDOMNotation – IXMLDOMEntity. Reference – IXMLDOMProcessing. Instruction – IXMLDOMCharacter. Data • IXMLDOMText, IXMLDOMCDATASection, IXMLDOMComment Venkat Subramaniam – svenkat@cs. uh. edu 75
IXMLDOMNode’s xml • xml: String • This produces an XML document starting from the current node • The XML document formed is useful for saving an XML document that has been manipulated using DOM Venkat Subramaniam – svenkat@cs. uh. edu 76
IXMLDOMNode’s text • text: String • Contents of the node concatenated with all the contents of the nodes found in the child. Nodes collection • For nodes with no children, simply returns the value of that node Venkat Subramaniam – svenkat@cs. uh. edu 77
IXMLDOMNode’s parsed • parsed: Boolean • Tells whether the node and its children have been parsed • Useful in the case of asynchronous loading of XML documents Venkat Subramaniam – svenkat@cs. uh. edu 78
IXMLDOMNode’s transform. Node() • transform. Node(stylesheet: Node): String • This methods applies the given stylesheet transformation on the current node • The result String contains the transformed XML • Pretty useful to apply one of select few stylesheets on an XML document Venkat Subramaniam – svenkat@cs. uh. edu 79
IXMLDOMDocument Properties • url: String – If load() was used, this returns the URL location of doc • parse. Error: IDOMParse. Error – Error object for this document • ready. State: Long integer – State of downloading and parsing progress – States are: UNINITIALIZED, LOADING, LOADED, INTERACTIVE, COMPLETED • async: Boolean – true for asynchronous loading • validate. On. Parse: Boolean – tells if the parser should check if the document conforms to DTD • preserve. White. Space: Boolean • resolve. Externals: Boolean Venkat Subramaniam – svenkat@cs. uh. edu 80
IXMLDOMDocument Methods • load(url: String): Boolean • load. XML(xml: String): Boolean – An XML document itself given as String, loaded, parsed • save(destination: String or IXMLDOMDocument or ASP Response object): integer – Saves the DOM tree to specified location – Intended for use on the server – Browse security will limit its usage on client side • create. Node(type: int, name: String, ns. URI: String): Node • node. From. ID(id: String): Node • abort() Venkat Subramaniam – svenkat@cs. uh. edu 81
IXMLDOMNode. List Methods • next. Node() : Node – Returns the first node first, subsequent nodes follows • reset() – Reset the iterator like next. Node() method so the next call would start at first method again Venkat Subramaniam – svenkat@cs. uh. edu 82
IXMLDOMNamed. Node. Map • get. Qualified. Item(name: String, name. Space: String): Node • remove. Qualified. Item(name: Stirng, ns: String): Node • next. Node(): Node • reset() Venkat Subramaniam – svenkat@cs. uh. edu 83
IDOMParse. Error • error. Code: Long integer – Error code of last parsing error • url: String – URL of the XML document with parsing error • Reason: String – Reason for the last error • src. Text: Long integer – Returns line of text on which parse found error • line: Long integer – Line number where parse found error • line. Pos: Long integer – Column number of error location • filepos: Long integer – Character position of error from beginning of document Venkat Subramaniam – svenkat@cs. uh. edu 84
- Slides: 84