Welcome to WebmasterWorld Guest from

Forum Moderators: httpwebwitch

Message Too Old, No Replies

XML/XSL best method to display a record set?

what are the pros ands cons of using xml/xsl



2:06 pm on Aug 15, 2008 (gmt 0)

5+ Year Member

Lets say I've got a database full of movie titles and web page that lets you search it. When someone does a search there are two ways I'm thinking of to display the results.

One is to return the results in a record set, and then just use server side scripting to loop through them and add each one in the html.

The other option is to have the database return the results in XML format and use an xsl to display them.

What are the pros and cons of these methods and which is best from a speed/efficiency point of view?


11:41 pm on Aug 17, 2008 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

using XML/XSL
- easy to transform the data into a variety of formats and alternative HTML layouts
- improved ease of maintainance
- the data is ripe for offering as a public API
- you're less likely to allow XSS vulnerabilities
- the XSLT layer offers separation from the data access layer

- it is more expensive in terms of CPU/memory. (But not by that much)
- XSLT has a challenging learning curve
- dealing with data that contains escaped characters and text/html markup can be challenging (just make sure your test data contains lots of nasty tainted stuff, so your code handles it properly)


10:43 am on Aug 18, 2008 (gmt 0)

5+ Year Member

If you just have a db full of movie titles then why not use asp.net and fetch data directly into a DataSet then bind it to a control such as a GridView. Takes about 3 lines of code, no xml and no server side scripting to loop through them. Easy!

Featured Threads

Hot Threads This Week

Hot Threads This Month