is parsed differently from this document:
This can make parsing difficult, depending on the parser library you use. You have to manually check all the child elements of the customer element to determine which one has the piece of information (the customer's name, for example) that is being searched for. Generating XML documents with this structure is also more difficult—the elements containing the data points must be serialized to the target document in exactly the right order, or the document does not validate against its DTD or schema.
On the other hand, attributes in an XML document are not order sensitive in much the same way that named columns are not order sensitive in a relational database table. Thus, the following two documents are parsed exactly the same way:
and
Because these two documents parse the same way, they both validate against the same DTD or schema. Creating documents is easier as well, because you can add attributes to the XML document in any order convenient to you.
Differences in document size
Because of the way XML documents are serialized to text, attribute values use fewer characters than their equivalent element representations. For example, compare our two sample documents (assuming that all white space is removed to minimize document size):
![]()
![]() | Advanced packages drive on-board programming innovations by Peter T. Larsen. Intel Corp. Vendors such as Intel recognize t... |
If you're interested in this topic, these articles may be helpful:
![]() | Custom ASP.NET DataGrid paging with Exact Count by Dimitrios Markatos, independent .NET architect. Anybody in the D... |
![]() | Semantic interoperability with universal data element framework by Neelima Vobugari, XML certified independent software consultant. ... |
![]() | Determine the correct XML parser type for a Java application by Padma Apparao, senior performance architect, Software Solutions Gro... |
![]() | Schema Plus Professional trial download from SchemaPlus Schema Plus is an array of robust database management... |
![]() | XMLSpy Home Edition 2005 from Altova Altova XMLSpy 2005 Home Edition is a free entry level X... |
![]()
Related Jobs:


