Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Should XSLT reside in Dynamic Web Project or Database?

 
Jon Greenwood
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

My boss asked me a really good question yesterday, "Is XSLT data or code?".

We have a J2EE application that retrieves XML data from a database which is then sent on to customers.
Before being sent onwards it may have a stylesheet applied to it to transform the data.

There are less than 10 stylesheets and there will not be more (so no need to future-proof application).

Given these circumstances, should those stylesheets be retrieved from the database (are they data) or should they reside in the Dynamic Web project (are they code).

Either solution will work but can anyone guide me as to a preferred Design Solution?

Thanks in Advance
 
Matthew Brown
Bartender
Posts: 4567
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd say they're definitely code. Look at it this way - if you make a change to an XSLT file and get it wrong, you've broken the application. They've got the same status as any other application source code. I think the purpose of the file is more important than the fact it happens to be in the form of XML.
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would be agnostic as to whether an XSLT file was data or code -- I might even be convinced to call it configuration. But as soon as "data" means it's going in a database, then no. It isn't data.
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd say store the XSLT on the file system. It just as easily accessible and I'm guessing (guessing mind you) that it may also be faster, also you may not want to waste the tablespace. That is unless you've got a complex scenario going on where you also store meta-data about the XSLT (e.g. versioning) and are updating both frequently. In that case, if you store meta-data in the DB and the XSLT as files on the file system, and updates are part of a larger overall transaction that is prone to rollback (due to optimistic locking for instance) keeping the filesystem and DB in synch could get complicated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic