|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: CSS and XSL
> 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 :-)
Don't you think *mentally* parsing
body { background-color: red; color: green; }
.emphasis { font-weight: bold; font-style: italic; }
is easier on eyes and brain than the proposed above XSL equivalent?
As to *machine* parsing, what's the deal? *Approximate* pseudo code:
Loop through declared styles:
Non-whitespace before '{' becomes SELECTOR.
Repeat until '}':
Non-whitespace before ':' becomes PROPERTY.
Non-whitespace between ':' and (';' or '}') becomes VALUE.
End Repeat
End Loop
Avoid *that* just so we can have pointy-bracket parsers for Style?
Why not have XFL just parse (as above), then apply the styles to the XTLed tree?
/Jelks
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
|

Cart








