This description indicates that an element with the tag name of line item contains the four elements product name, product code elements are strings. The cost per unit is presented as a currency (which is a unit that was defined elsewhere) and number of units is always an integer. Furthermore you can never have negative unit cost nor can you have less than one unit of the indicated item on the purchase order. The preceding fragment shows a small piece of the XML Scheme language that is being proposed by the W3C to define XML documents. While XML Schema offers a number of benefits over the older SGML DTDs, one of the most significant is that it is itself written in XML and can thus be manipulated with the same tools as the XML it describes. Additionally XML Schema lays the foundation for treating XML as an object-oriented data language complete with features as inheritance and polymorphism. XML as a Transformation Language.
In the preceding section, I introduced the notion of converting a table into an XML representation. While this makes the meaning of the table somewhat more tractable, it does raise the obvious question: Well yes but how the HTML browser knows to display it as a table now?” It doesn’t HTML has no contingencies for recognizing such tags as product code, nor should it the plethora of unnecessary tags was what made HTML unstable in the first place. However in order to make XML viewable outside of anything beyond a text editor you need some mechanism to convert the XML into a different format such as HTML. The Extensible Style language fits the bill. The name can be little deceptive especially if you come from the Web world and are used to HTML 4 Cascading Style Sheets. When the W3C was still looking at XML as principally being a document format, CSS made perfect sense: you could create a style sheet and associate one style rule with an XML element in a similar manner to the way that you worked with HTML tags.
The problem with CSS arises when you start treating XML as data. To format the invoice list in a table you’d have to be able to map the XML nodes back to their HTML equivalents. However CSS doesn’t have an option to format an element as a table or row. You could get away with it by using overlapping DIV elements but you would have to manipulate this through internet Explorer object model, which loses your portability.
Furthermore, with CSS there’s no way to reorder the data or to filter it. Since a significant proportion of data operation are built around those two operations, this meant that you would need to programmatically manipulate the XML using some other language (such as the XML documents Object Model covered in the next section) for even the simplest of operations. SGML’s DSSSL language considered once for CSS and rejected was brought back under consideration as a possible tool to aloe to more complex transformations.