Welcome to WebmasterWorld Guest from

Forum Moderators: open

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)

New User

10+ Year Member

joined:Feb 11, 2007
votes: 0

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)

Senior Member from CA 

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

joined:Aug 29, 2003
votes: 0

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)

New User

5+ Year Member

joined:Aug 13, 2008
votes: 0

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!

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members