[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: CSS and XSL
Frank Boumphrey wrote: > > > As far as I see it CSS and XSL serve two different clientels. Those who > merely want to decorate a parse tree and those who want to transform it. > > > XSL and CSS use two different methods to decorate the parse tree. > > I > > > > why not put CSS in XML syntax. Well to retain all the information it would > not only be more verbose, it would also be more difficult to parse. Perhaps more verbose, but I will use my XML parser so it is quite easy to parse. > > CSS is a compact, easy to understand, and easy to program style language. > As written CSS syntax is sparing of resources. Even when one uses > a built in > xml parser > > > > > body{ > background-color:red; > color:green; > } > > .emphasis{ > font-weight:bold; > font-style:italic; > } > > Is not only terser, but technically easier to parse than: How can this be parsed using an XML parser? > > <css-style> > <css-rule> > <css-selector type="element">body</css-selector> > <css-declaration> > > <css-property>background-color</css-property> > <css-value>red</css-value> > <css-declaration> > > <css-declaration> > <css-property>color</css-property> > <css-value>green</css-value> > <css-declaration> > <css-rule> > > <css-rule> > <css-selector type="class">emphasis</css-selector> > <css-declaration> > <css-property>font-weight</css-property> > <css-value>bold</css-value> > <css-declaration> > > <css-declaration> > <css-property>font-style</css-property> > <css-value>italic</css-value> > <css-declaration> > <css-rule> > </css-style> The verbosity is an artifact of the syntax you define. why not: <css:style> <css:rule select="body" type="element"> <css:property name="background-color" value="red" /> <css:property name="color" value="green" /> </css:rule> <css:rule select="emphasis" type="class"> <css:property name="font-weight value="bold" /> <css:property name="font-style" value="italic" /> </css:rule> </css:style> This is hardly more verbose than CSS itself but is XML, and can be built via XSL. Same number of lines as your example (assuming you include the <style> </style> wrapper). I'll race you to parse the two :-) Jonathan Borden http://jabr.ne.mediaone.net 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
|