Posted By
Reetika Chandra
on
6. September 2013 04:24
When working with XML, HTML is typically the display mechanism for an XML document. However, XML can also be used as a Data Island and embedded directly in an HTML document. These XML Data Islands load ML documents using a tag by accessing them though client-side / server-side scripting. Typically, JavaScript is used to call and display XML Data Islands.
Why Use XML Data Islands?
There are a few reasons why you might want to use XML Data Islands as opposed to traditional XML document calls. Some companies may have special security concerns and not wish to provide Database access or Web Services. In such cases, the company can achieve the same effect by using XML Data Islands.
Advantages of XML Data Islands
There are considerable benefits XML Data Islands have over traditional XML document calls. Using an XML Data Island loads data faster. This is because the XML data is fetched using JavaScript, which is a client-side script, so there are fewer server trips. XML, in general, is user-friendly and easy to read. Also, XML Data Islands give developers more control over costs as they can be implemented with less technical knowledge.
Disadvantages of XML Data Islands
Not that XML Data Islands are without their share of disadvantages. Since they use JavaScript for calls, the XML Data Island will only show up if the user has JavaScript enabled in their browser. However, this can be corrected if the data is displayed using server-side scripting, which displays information irrespective of browser settings. Another drawback of the use of JavaScript is that data is fetched from the cache rather than from the original source. This might cause some of the data displayed to be outdated. Finally, since Data Islands are so portable and the XML is embedded right in the HTML page, there is a security concern if the data is sensitive. Developers should maintain due diligence when using XML Data Islands to display data.
Implementing XML Data Islands
Implementing XML Data Islands consists of simply calling the XML data into the page using JavaScript.
Example of XML Data Island
Below example shows how XML Data Island is called using JavaScript on a page -
Call XML Data on to the page -
If the call is successful, load XML onto the page -
Fetch the data and parse -
Call us at 484-892-5713 or Contact Us today to learn more about implementing XML data islands with using JavaScript.