xsl-list
[Top] [All Lists]

RE: Adding css classes to xsl

2004-12-20 04:57:05
the normal way as far as im aware is to use the class attribute.
i.e. 
<td class="foo">
where foo is the style

and defining the stylesheet at the top of the xsl.

-----Original Message-----
From: Aaron Johnson [mailto:aaron2(_dot_)johnson(_at_)uwe(_dot_)ac(_dot_)uk]
Sent: 20 December 2004 11:48
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Adding css classes to xsl


Hi...

I have defined a set of styles in a separate .css file which I want to
define in my .xsl document.

Is it as simple as adding the required class to the hard coded element in
the style sheet?

example:

<form name="swsform" action="{$baseActionURL}#timetable" method="post">

...so I add:

<form name="swsform" action="{$baseActionURL}#timetable" method="post"
id="foo">

...foo being the class in the .css.

Thanks for any help...


<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:x='http://www.w3.org/1999/xhtml'>
    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
    <xsl:param name="baseActionURL">baseActionURL_false</xsl:param>
    <xsl:param name="type">Grid</xsl:param>
    <xsl:param name="weeks">Semester 1</xsl:param>
    <xsl:param name="days">All Weekdays (Mon - Fri)</xsl:param>
    <xsl:param name="duration">08:30 - 18:30</xsl:param>
    <xsl:template match="/">
        <script language="javascript" type="text/javascript"
src="http://timetables.uwe.ac.uk:8080/SWS_Custom/common/js/0405/form.js"/>
        <xsl:call-template name="form"/>
        <xsl:apply-templates select="//x:body"/>
    </xsl:template>
    <xsl:template name="form">
        <h2>Timetable Selection:</h2>
        <form name="swsform" action="{$baseActionURL}#timetable"
method="post">
                Select Timetable Type:
            <select name="type">
                <option>Grid</option>
                <option>List, seperate days</option>
            </select>
            <br/>
                Select Week(s):
            <select name="weeks">
                
<option>.....................................................</option>
                
<option>.....................................................</option>
                
<option>.....................................................</option>
                
<option>.....................................................</option>
                
<option>.....................................................</option>
                
<option>.....................................................</option>
                
<option>.....................................................</option>
                
<option>.....................................................</option>
                
<option>.....................................................</option>
                
<option>.....................................................</option>
            </select>
            <br/>
                Select Day(s):
            <select name="days">
                <option value="1-5">All Weekdays (Mon-Fri)</option>
                <option value="1-7">All Week (Mon-Sun)</option>
                <option value="6-7">All Weekend (Sat-Sun)</option>
                <option value="1">Monday</option>
                <option value="2">Tuesday</option>
                <option value="3">Wednesday</option>
                <option value="4">Thursday</option>
                <option value="5">Friday</option>
                <option value="6">Saturday</option>
                <option value="7">Sunday</option>
            </select>
            <br/>
                Select Start and End Time:
            <select name="duration">
                <option value="1-20">08:30 - 18:30</option>
                <option value="1-25">08:30 - 21:00 (All Day)</option>
                <option value="1-8">08:30 - 12:30 (Morning)</option>
                <option value="9-20">12:30 - 18:30 (Afternoon)</option>
                <option value="21-25">18:30 - 21:00 (Evening)</option>
            </select>
            <br/>
            <input type="submit" value="submit"/>
            <script language="JavaScript" type="text/javascript">
                // This method is called on submit and sets the
current position of the combos
                function runme() {
                    swsform.periodspos.value = swsform.periods.selectedIndex
;
                    swsform.dayspos.value = swsform.days.selectedIndex ;
                    swsform.weekspos.value = swsform.weeks.selectedIndex ;
                    swsform.stylepos.value = swsform.style.selectedIndex ;
                } // This method is called on startup and resumes
where runme left off
               
swsform.periods.options[swsform.periodspos.value].selected=true ;
                swsform.days.options[swsform.dayspos.value].selected=true ;
                swsform.weeks.options[swsform.weekspos.value].selected=true
;
                swsform.style.options[swsform.stylepos.value].selected=true
;
             </script>
        </form>
        <script language="JavaScript" type="text/javascript">
            BBSAddWeeksToHTML(document.swsform);
        </script>
    </xsl:template>
    <xsl:template match="x:body">
         <hr/>
         <xsl:copy-of select="x:table"/>
    </xsl:template>
</xsl:stylesheet>



......................................................................

Aaron Johnson
GUI / XSLT development
Academic Technologies Group [ATG]
University of the West of England

ext: 81051
t: 0117 3281051 
www: http://atg.uwe.ac.uk/aaron
e: aaron2(_dot_)johnson(_at_)uwe(_dot_)ac(_dot_)uk
......................................................................

......................................................................

SECURITY POLICY:

Please note that ATG will only accept
e-mail attachments in the following
formats:

.doc,.gif,.jpg,.mdb,.png,.xls,.zip,.psd

...as a mac user I will accept files
compressed using Dropstuff.
......................................................................

This communication is intended solely
for the use of the individual(s) to whom
it is addressed. Any opinions presented
are those of the author and do not
necessarily represent the University of
the West of England, Bristol.
......................................................................




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>