xsl-list
[Top] [All Lists]

RE: Critique please!

2004-01-04 17:26:05

Nik Coughlin wrote:
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Nik Coughlin
Sent: 04 January 2004 23:51
Subject: [xsl] Critique please!
 
It has an XML file which contains all of the site's content, 
and also contains information about the look and feel of the site.
 
It then has an XSL file which uses a combination of XSL, HTML 
and JavaScript to display the content and control navigation.  

It has a number of fairly general functions, such as an image 
gallery, a function for FAQs, one for listing links etc.  

I would appreciate it if anyone who has some time could have 
a look at my code and let me know what I could have done 
better and how.
 
The url is http://homepages.ihug.co.nz/~nrkn/xml/

General comments;

- avoid using CDATA....there should be no reason for this...or let me
rephrase no good reason for wrapping textual data using CDATA. Though
this may seem a good fix now, you will pay in the long run, if you have
no control over the xml data, then why not run html tidy over it first

- remember xslt is data also, and it has a lot more functionality when
it comes to building a hiearchy; though you could also opt to have
separate files for 

- need to add application/xml mime type for xsl files for your web
server otherwise mozilla wont do in browser transformation; in apache
this is done via mime.conf or httpd.conf

- If you intend to generate XHTML/HTML websites for people try to keep
things in their natural state no need to define new elements...if at
best add or wrap meta data around valid html elements; as it will bode
well for others ( or other tools ) that want to make images and html.

- add some version and author information for your metatags and general
publishing ( Dublin Core is easy enough )

For something with a different approach take a look at the following
website format I updated last year, it allows you to componentize
assets, be them snippets of html, javascript, flash, whatever...in
addition it generates multilingual ( as in content-negotiation with
Apache mod-negotiation module ) content. 
You can download from here
http://www.ruminate.co.uk/samples/test_publication_lang.zip
And read a little bit about it here
http://www.ruminate.co.uk/MT/archives/cat_xslt.html

Generally, in content management situations I seriously advocate not
generating a schema until you gain benefit..some will say this is true
form the start; but I have found such 'early taxonomisation' to be
wasted effort. Use of DTD over schema is another decision that I find a
bit tricky; I tend to always go with RELAXNG and if I have to serve up
DTD and XML Schema from there...though different strokes for different
folks.

Generally, your approach is valid so no criticisms there...if I can
say...its more docbook then website...so perhaps you have seen all the
latest docbook website type stuff; very full featured, if you havent
already had a look in.

One last note, always look at the xml/xslt dist as something separate
from the framework that is serving it up; that way you will always have
valid transforms in both mozilla/microsoft as well as any XSLT server
side environment....if you make your dist expect something from the
framework then always push it through via xsl:param. If you can I would
suggest the simplest of server side solutions, something like SAXON
servlet.

gl, Jim Fuller


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                nrkn
http://www.livejournal.com/users/nrkn
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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