xml element | xml object
Defines an XML data island on an HTML page.
Members
The xml object has these types of members:
Events
The xml object has these events.
| Event | Description |
|---|---|
| afterupdate |
Fires on a databound object after successfully updating the associated data in the data source object. |
| beforecopy |
Fires on the source object before the selection is copied to the system clipboard. |
| beforeupdate |
Fires on a databound object before updating the associated data in the data source object. |
| cellchange |
Fires when data changes in the data provider. |
| dataavailable |
Fires periodically as data arrives from data source objects that asynchronously transmit their data. |
| datasetchanged |
Fires when the data set exposed by a data source object changes. |
| errorupdate |
Fires on a databound object when an error occurs while updating the associated data in the data source object. |
| filterchange |
Fires when a visual filter changes state or completes a transition. |
| layoutcomplete |
Fires when the print or print preview layout process finishes filling the current LayoutRect object with content from the source document. |
| ondatasetcomplete |
Fires to indicate that all data is available from the data source object. |
| readystatechange |
Fires when the state of the object has changed. |
| resize |
Fires when the size of the object is about to change. |
| rowenter |
Fires to indicate that the current row has changed in the data source and new data values are available on the object. |
| rowexit |
Fires just before the data source control changes the current row in the object. |
| rowsdelete |
Fires when rows are about to be deleted from the recordset. |
| rowsinserted |
Fires just after new rows are inserted in the current recordset. |
Methods
The xml object has these methods.
| Method | Description |
|---|---|
| addBehavior |
Attaches a behavior to the element. |
| applyElement |
Makes the element either a child or parent of another element. |
| clearAttributes |
Removes all attributes and values from the object. |
| componentFromPoint |
Returns the component located at the specified coordinates via certain events. |
| doScroll |
Note
doScroll is no longer supported. Starting with IE11, use scrollLeft or scrollTop. For info, see Compatibility changes.
Simulates a click on a scroll bar component. |
| fireEvent |
Fires a specified event on the object. |
| getAttributeNode |
Retrieves an attribute object referenced by the attribute.name property. |
| hasAttribute |
Determines whether an attribute with the specified name exists. |
| hasAttributes |
Determines whether one or more attributes exist for the object. |
| namedRecordset |
Retrieves the recordset object corresponding to the named data member from a DSO. |
| normalize |
Merges adjacent DOM objects to produce a normalized document object model. |
| removeAttributeNode |
Removes an attribute object from the object. |
| removeBehavior |
Detaches a behavior from the element. |
| replaceAdjacentText |
Replaces the text adjacent to the element. |
| setActive |
Sets the object as active without setting focus to the object. |
| setAttributeNode |
Sets an attribute object node as part of the object. |
| setCapture |
Sets the mouse capture to the object that belongs to the current document. |
Properties
The xml object has these properties.
| Property | Description |
|---|---|
|
Retrieves a collection of attributes of the object. | |
|
Gets a value indicating whether the object can contain child objects. | |
|
Retrieves the value indicating whether the object can contain rich HTML markup. | |
|
Sets or retrieves the string identifying the object. | |
|
Gets the value that indicates whether the user can edit the contents of the object. | |
|
Gets the value that indicates whether the user can interact with the object. | |
|
Retrieves the value indicating whether the content of the object contains one or more lines. | |
|
Retrieves the current state of the object. | |
|
Sets or retrieves from a data source object a reference to the default record set. | |
|
Sets or retrieves the role for this element. | |
|
Gets the namespace defined for the element. This property is not supported for Windows apps using JavaScript. | |
|
Sets or retrieves a URL to be loaded by the object. | |
|
Sets or gets the URN specified in the namespace declaration. This property is not supported for Windows apps using JavaScript. | |
|
Retrieves a reference to the XML DOM exposed by the object. |
Standards information
There are no standards that apply here.
Remarks
The readyState property of the xml element, available as a string value, corresponds to the readyState property of the XMLDOMDocument object, which is available as a long value. The string values correspond to the long values of the XML document object's property as shown in the Examples section.
The XMLDocument property is the default property.
This element is available in HTML and script as of Microsoft Internet Explorer 5.
Examples
This example uses the xml element to define a simple XML data island that can be embedded directly in an HTML page.
<xml id="oMetaData"> <metadata> <author>John Smith</author> <generator>Visual Notepad</generator> <pagetype>Reference</pagetype> <abstract>Specifies a data island</abstract> </metadata> </xml>
This example uses the readyState property of the xml object to determine whether the XML data island is completely downloaded.
if (oMetaData.readyState == "complete") window.alert ("The XML document is ready.");
This example uses the readyState property of the XMLDOMDocument object to determine whether the XML data island is completely downloaded.
if (oMetaData.XMLDocument.readyState == 4) window.alert ("The XML document is ready.");
This script example retrieves the text contained within the abstract field of the data island.
var oNode = oMetaData.XMLDocument.selectSingleNode("metadata/abstract"); alert(oNode.text);