RE: CSS and XSL
Hi Jelf, <YourComment> My rhetorical question was sort of tongue-in-cheek. :) There were good reasons for the "schizoid" nature of *ML+CSS. I question whether reversion to an "improved", well-formed Tag Soup is progress. </YourComment> <Reply> Sure there where good reason for having two different syntax. These two things evolved differently. However, it remains that all the discourse we have about XML as a _common_ _document_ syntax_ could also be applied to style languages. In fact, when you look closely at how CSS is structured, you can see all the property set concept percolating thru. Also, I you look closely at the DOM2 specs you'll notice that the underlying model is a hierarchy of objects with property sets attached to each type of object. We can question that DOM didn't used a composite pattern API but, it remains that the object/property set is there. Also, we created XML to simplify SGML. In the same vein your example just show a good simplification if we consider that a HTML object could have several properties or to be more conceptual that each HTML object has a property set that could be set with a _unique_ and _consistent_ syntax. So your tongue in cheek wasn't so foolish after all. Now, let's take a look through the eyes of somebody having to implement this stuff (And I have to do it each day :-) The style property value contains a property set that has to be parsed and each attribute/value pair attributed to the underlying model property set. For instance, the body object is in fact a formatting object container (abstract container or aggregator). This object contains other objects. The parser then creates a body object and will set this object property set with values extracted from HTML/XML (the latter for voyager) properties. One property is an exception, this is the style property which act as a container for an other property set. Thus, the parser has to change parsing rules and extract attributes/values from the style string and set the Body object property set (the container object)with them. We have here two syntax one being embedded in the other. I do not say we scrap today CSS syntax contained in the HTML/XML property (we have million of browsers out there that would reduce our fervour) but, it would be more easier to have a single syntax that would explicitly show the relationship between the object and its property set. Thus to retake your example: <BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" BACKGROUND="bg.gif" TOPMARGIN="0" LEFTMARGIN="0"> express explicitly in a single syntax the relationship between the body object and its property set. It is expressing it better than with the following expressing where one syntax is embedded into an other. <BODY style="BGCOLOR="#FFFFFF;...etc..." >. Of course, we have to deal with the legacy, but the work we are doing with XSL and XML is a good occasion to move toward a more simpler, concise and consistent model than we have today. XML gives us, after all, a good opportunity to unify into a coherent and simple syntax different element of a document facets or as a language used to convey the document objects/property set hierarchy. IN the short term we have to do some retrofit like, for instance, the style property. For the mid and long term find a more choherent solution. </Reply> Regards Didier PH Martin mailto:martind@xxxxxxxxxxxxx http://www.netfolder.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format