Archive for the ‘XML’ Category

Advantages and Disadvantages of XML

Thursday, August 14th, 2008

Advantages of XML

1)  It supports Unicode, allowing almost any information in any written human language to be communicated.
2)  It can represent common computer science data structures: records, lists and trees.
3)  Its self-documenting format describes structure and field names as well as specific values.
4)  The strict syntax and parsing requirements make the necessary parsing algorithms extremely simple, efficient, and consistent.
5)  XML is heavily used as a format for document storage and processing, both online and offline.
6)  It is based on international standards.
7)  It can be updated incrementally.
8)  It allows validation using schema languages such as XSD and Schematron, which makes effective unit-testing, firewalls, acceptance testing, contractual specification and software construction easier.
9)  The hierarchical structure is suitable for most (but not all) types of documents.
10)  It is platform-independent, thus relatively immune to changes in technology.
11)  Forward and backward compatibility are relatively easy to maintain despite changes in DTD or Schema.

Disadvantages of XML

1)  XML syntax is redundant or large relative to binary representations of similar data especially with tabular data.
2)  The redundancy may affect application efficiency through higher storage, transmission and processing costs
3)  XML syntax is verbose, especially for human readers, relative to other alternative ‘text-based’ data transmission formats.
4)  The hierarchical model for representation is limited in comparison to an object oriented graph
5)  Expressing overlapping (non-hierarchical) node relationships requires extra effort.
6)  XML namespaces are problematic to use and namespace support can be difficult to correctly implement in an XML parser.
7)  XML is commonly depicted as “self-documenting” but this depiction ignores critical ambiguities.
8)  The distinction between content and attributes in XML seems unnatural to some and makes designing XML data structures harder.
9)  Transformations, even identity transforms, result in changes to format (whitespace, attribute ordering, attribute quoting, whitespace around attributes, newlines). These problems can make diff-ing the XML source very difficult.
10)  Encourages non-relational data structures (data non-normalized)
11)XML is very concrete and highly non-canonical. It introduces a very strong coupling between the actual representation chosen and the processing program (unlike relational storage and SQL)

What is XML Parser ?

Friday, August 8th, 2008

Microsoft’s XML parser is a COM component that comes with Internet Explorer 5 and higher. Once you have installed Internet Explorer, the parser is available to scripts.
Microsoft’s XML parser supports all the necessary functions to traverse the node tree, access the nodes and their attribute values, insert and delete nodes, and convert the node tree back to XML.

To create an instance of Microsoft’s XML parser with JavaScript, use the following code:
var xmlDoc=new ActiveXObject(”Microsoft.XMLDOM”)

To create an instance of Microsoft’s XML parser with VBScript, use the following code:
set xmlDoc=CreateObject(”Microsoft.XMLDOM”)

To create an instance of Microsoft’s XML parser in an ASP page (using VBScript), use the following code:
set xmlDoc=Server.CreateObject(”Microsoft.XMLDOM”)

The following code loads an existing XML document (”note.xml”) into Microsoft’s XML parser:
<script type=”text/javascript”>
var xmlDoc=new ActiveXObject(”Microsoft.XMLDOM”)
xmlDoc.async=”false”
xmlDoc.load(”note.xml”)



</script>