I'm working on a university assignment where we're building a website that allows students to see available courses, enlist in them, show them their timetable, etc. When the user sees his timetable, it is produced in XML and we're using XSLT to view it (as in a previous question I asked). There are currently two different XSLT files and the user can choose (via a dropdown menu) which "theme" he wants to use.
We were asked to allow the user to upload his own .xsl
file and have it added to the list of themes (available to anyone). To accommodate this demand, I created a new XML file, called timetable_themes.xml
which looks something like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE TimetableThemes SYSTEM "timetable_themes.dtd" >
<TimetableThemes>
<Theme>
<Name>Classic</Name>
<FileName>classic.xsl</FileName>
</Theme>
<Theme>
<Name>Bullets</Name>
<FileName>bullets.xsl</FileName>
</Theme>
</TimetableThemes>
This file lists the different themes available and their file names. This XML file, and the XSL files reside at WebContent/timetable
. The two themes currently available were designed by us, but we need to allow the user to upload his.
My question is - how do I allow a user to upload files, how do I choose where to save them in the server? and thirdly - is my XML solution for the theme list a good idea?