spacer
Yehuda Shiran January 20, 2002
The Multiple States of XML Loading
Tips: January 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

The DOMDocument object has a very extensive set of properties, methods, and events to deal with reading XML files and loading their data in. The readyState property can give direct feedback on the reading processes. Here are the possible values for readyState:

StateShort DescriptionLong Description
1LoadingPreparing to read the XML file. Did not try yet.
2LoadedReading and parsing the XML file. Object model still not available.
3InteractivePart of the XML file successfully parsed and read in. Object model partially available for read only.
4CompletedLoading of the XML file has been completed, successfully or unsuccessfully.

When you read an XML file successfully, the readyState property goes through all four states: 1,2,3, and 4. When you are unsuccessful in reading an XML file, the readyState property may skip 3 on some operating systems. Obviously, it is very difficult to know exactly when the readyState property changes its value. For this very purpose the DOMDocument object provides the onreadystatechange event handler.


People who read this tip also read these tips:

Look for similar tips by subject:


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
UC Gaining a Foothold in Government · Workers Say Telework Is More Productive, Bosses Not So Sure · Kingston Debuts Power-Saving Memory Upgrades