Search these areas:
Help
Support Forums
Product Info



Introduction
DataWeb: What's New
Creating an Application
The DataWeb Designer
Application Management
Data Tables
Data Tables
Views
Templates
Components
Data Analysis
Members
Security
Importing
Exporting
FTP
JavaScript
Object Model
JavaScript Objects
General Scripting Objects
Data Access Objects
File Access Objects
Http Client Objects
Security and Membership Objects
Document Object Model (DOM)
-DOMAttribute Object
-DOMCDataSection
-DOMCharacterData
-DOMComment
-DOMDocument
parseFile
parseResponse
createElement
createDocumentFragment
createTextNode
createComment
createCDataSection
createProcessingInstruction
createAttribute
createEntityReference
getElementsByTagName
importNode
createElementNS
createAttributeNS
getElementsByTagNameNS
getElementByID
-DOMDocumentType
-DOMElement
-DOMEntity
-DOMEntityReference
-DOMException
-DOMImplementation
-DOMNamedNodeMap
-DOMNode
-DOMNodeList
-DOMNotation
-DOMProcessingInstruction
-DOMText
Error Descriptions
Object Model Extensions
Full-Text Search
Domain and Email Hosting
HotBlock Modules
Account Management
Glossary
New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

DataWeb User's Guide

DOMDocument
The DOMDocument object represents an XML document.

The DOMDocument object inherits properties and methods from the DOMNode object.

The DOMDocument object represents the root of the DOM document node tree, and provides the primary access to the document's data.

Constructors

[new] DOMDocument(string)  Constructs and returns a new DOMDocument object instance.
[new] DOMDocument.parseFile(path) Constructs and returns a new DOMDocument object instance.  The path parameter is a string indicating the path of the file to parse, e.g. "AddressBook/default.view";
[new] DOMDocument.parseResponse(resp Constructs and returns a new DOMDocument object instance.  The parameter resp is a HTTPResponse object instance.

Instance Properties

doctype Returns a DOMDocumentType object instance.
implementation Returns a DOMImplementation object instance.
documentElement The value of this property is the root element of the DOMDocument object.

Instance Methods

createElement Creates and a returns a DOMElement object instance.
createDocumentFragment Creates and returns a DOMDocument fragment.
createTextNode Creates and returns a DOMText object instance.
createComment Creates and returns a DOMComment object instance.
createCDataSection Creates and returns a CDataSection object instance.
createProcessingInstruction Creates and returns a DOMProcessingInstruction object instance.
createAttribute Creates and returns a DOMAttribute object instance.
createEntityReference Creates and returns a DOMEntityReference object instance.
getElementsByTagName Creates and returns a DOMNodeList object instance.
importNode Creates and returns a DOMNode object instance.
createElementNS Creates and returns a DOMElement object instance.
createAttributeNS Creates and returns a DOMAttribute obejct instance.
getElementsByTagNameNS Creates and returns a DOMNodeList object instance.
getElementByID Creates and returns a DOMElement object instance.


Examples

The following examples demonstrate the constructors for the DOMDocument object.

Example #1

var doc = null; 
doc = DOMDocument("<person><name>Mark</name>
<email>mark@address.com</email></person>");

Example #2

var doc = null; 
doc = DOMDocument.parseFile("/AddressBook/AddressBook.view");

Example #3

var ua = new HttpUserAgent();
var resp = ua.Request(http://www.google.com);
var doc = new DOMDocument.parseResponse(resp);

Examples #4

The following example demonstrates the documentElement property of the DOMDoc object. It also shows how DOMDoc objects inherit the properties and methods of the DOMNode objet.

var str = '<table border="1" cellspacing="o" cellpadding="0"    
colspan="2"><tr><td>cell1</td><td>cell2</td></tr>
<tr><td>cell3</td><td>cell4</td></tr></table>';

    //doc is a DOMDoc object representing a table with four cells
var doc = new DOMDocument(str);


response.write("doc.documentElement: ",   
   doc.documentElement, "<br>");
response.write("doc.documentElement.nodeName: ", 
   doc.documentElement.nodeName, "<br>");
response.write("doc.documentElement.childNodes
.item(0).nodeName: ", 
   doc.documentElement.childNodes
.item(0).nodeName, "<br>");

Output:

doc.documentElement:
cell1cell2
cell3cell4

doc.documentElement.nodeName: table
doc.documentElement.childNodes.item(0).nodeName: tr

Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
Email Us