[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT vs. CSS (Re: Indexing)
At 06:17 PM 7/9/2003 +0100, you wrote: > Internet Explorer. No support for the new CSS2 display properties, on > grounds that if you're doing XML, you really should be using XSLT. > >This is probably true, although guessing why MS don't implement >standards is something of a black art. I'll have to hunt around for a reference - it's been years since this conversation - but I think this was from a public statement by an MSFT employee, if not MSFT officially. > Microsoft's expectation of XSLT for XML->WordML transformations has also > made some things (like present all new SALE elements in red) impossible, > while a CSS approach would have made such things pretty simple. > ><xsl:template match="SALE"> > <div style="color:red"> > <xsl:apply-imports/> > </div> ></xsl:template> > >Is probably all that's needed to enhance an existing stylesheet with >that styling. Certainly. The problem is that the transformation only happens when the user opens or closes the document, not when they edit the document. If you're editing a simple document with spaces where "red" has already been applied, this isn't a problem. If you do something (typically mixed content) where you don't have that information set up beforehand, it stays black while you edit it, until you run it through another transformation cycle. (At least it did in Beta 2 - I'll need to try this again in the update, but it seems like a genuinely tricky problem, not a simple bug.) CSS lets you say things like "SALEs are always red" - at least in my experience, that's easier to use in a situation (like dynamic HTML) where things change. > XSLT is pretty much perfect for cases where you can't be bothered to do > more than map existing structures to XML. > >I don't know what you mean here. If I write a document in docbook, or >xmlspec, and use xslt to generate html. (which is my normal mode of >operation) in what way "cant't I be bothered to do more than map >existing structures to XML."? >You obviously have something in mind here, but I have no idea what. In the WordML context, it's that the WordML format seems to be a pretty direct object serialization. This approach is much simpler to work with, since it doesn't involve tweaking the internal structures, but it doesn't exactly demonstrate flexibility. > Unfortunately, putting those > transformations into separate processes creates a lot of brittleness, as I > think Word demonstrates nicely. > >Not being a Word user, I wouldn't know, but I'll take your word for it >that Word demonstrates brittleness. I think many power users would have agreed with that statement long before XML came into the picture. :-)
|
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
|