CSS, just style or mechanics?

Hey! It aint that hard!
Post Reply
SOD
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 5284
Joined: 12/06/01, 12:00 am
Location: here and there

Post by SOD » 08/25/03, 11:20 am

I just hacked a method that uses XSLT translate function and CSS to create uids for content frames. In use with xml/xsl CSS takes on a mechanical role...leaving style as a byproduct.
It is better to be here than there - SOD

AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 08/26/03, 1:51 pm

interesting. You're using the object IDs in CSS in this scheme? What exactly are the details? It sounds interesting. BTW, for XSLT, do you need any special interpereters? (An FAQ would be good I'm not even sure what it is other than it sounds "XML-Like" :( )
Keep Your Assets & ID Private! Can you afford not to?

SOD
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 5284
Joined: 12/06/01, 12:00 am
Location: here and there

Post by SOD » 08/26/03, 7:10 pm

Eventually I need a server side xslt processor to do a conversion from xslt to html so that the end user sees a html output....The neat thing is that the xslt proc can not only convert in this manner but can also be used to take elements from Beer and generate an rss .91 doc or for that matter extrapolate data from any xml page to build custom data sets that can output to xml html text. The xsl:translate function could easly be called a transform....I looked at the function and wondered if it could manipulate whitespace in this case it was the spaces in a article title. So the line is<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class=postbody>Code:</font><HR width=100% color=#333333 SIZE=1></TD></TR><TR><TD><FONT class=code><PRE>{translate(container_title, ' ', '')}</PRE></FONT></TD></TR><TR><TD><HR width=100% color=#333333 SIZE=1></TD></TR></TABLE><!-- BBCode End --> then I wondered if I could wrap it using
the lowercase selector in css to remove the caps.
<!-- BBCode Quote Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class=postbody>Quote:</font><HR width=100% color=#333333 SIZE=1></TD></TR><TR><TD><FONT class=quote><BLOCKQUOTE><xsl:value-of select="//article_title"/></BLOCKQUOTE></FONT></TD></TR><TR><TD><HR width=100% color=#333333 SIZE=1></TD></TR></TABLE><!-- BBCode Quote End --> so what I ended up with was this:
first concatenate the date value:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class=postbody>Code:</font><HR width=100% color=#333333 SIZE=1></TD></TR><TR><TD><FONT class=code><PRE><xsl:concat(born_on_year, born_on_month, born_on_day)/></PRE></FONT></TD></TR><TR><TD><HR width=100% color=#333333 SIZE=1></TD></TR></TABLE><!-- BBCode End --> this brings three date elements together ina string then a _ to separate it from the translate function in the address then I called the translate function to remove the white space from the article title. So from this data:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class=postbody>Code:</font><HR width=100% color=#333333 SIZE=1></TD></TR><TR><TD><FONT class=code><PRE> <born_on_year>2003</born_on_year>
<born_on_month>08</born_on_month>
<born_on_day>1</born_on_day></PRE></FONT></TD></TR><TR><TD><HR width=100% color=#333333 SIZE=1></TD></TR></TABLE><!-- BBCode End --> and this:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class=postbody>Code:</font><HR width=100% color=#333333 SIZE=1></TD></TR><TR><TD><FONT class=code><PRE><container_title>Two Articles From Bob</container_title></PRE></FONT></TD></TR><TR><TD><HR width=100% color=#333333 SIZE=1></TD></TR></TABLE><!-- BBCode End --> I end up with an output of:
"2003081_TwoArticlesFromBob" so I wondered... If I can do that why not use a css selector designed to convert it to lower case as a wrapper? It worked. I can even turn css classes on or off given weather or not a data condition exists. It was my first real contribution at work. There so meny things xml/xsl/css can accomplish.
The goal here is not to say "look at me" rather to be an early adaptor and maybe inspire others. The mix is powerful. We need less folks telling us HOW to use something and more folks showing us how to use it to our advantage. Impowerment is a much better tool than "standards". Of course if all you ever do is write standards.....

SOD
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 5284
Joined: 12/06/01, 12:00 am
Location: here and there

Post by SOD » 08/26/03, 7:13 pm

the quote function above^^^ should not be there....
you try getting up at 3:30 am for qlong commute! :-)
It is better to be here than there - SOD

Post Reply