Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Why use XSLT?

Reply
Thread Tools

Why use XSLT?

 
 
arfinmail@yahoo.com
Guest
Posts: n/a
 
      03-01-2005
When I read about XSLT for the first time I thought it was a cool toy,
but then I asked myself why use XSLT over ASP?

Can someone give a real world example where XSLT would be the best
choice and why?

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      03-01-2005


http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> When I read about XSLT for the first time I thought it was a cool toy,
> but then I asked myself why use XSLT over ASP?


I don't see that as using XSLT instead of ASP, rather you can use XSLT
within ASP (or PHP or JSP) as a nice tool to transform XML to HTML or
text or XML.


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
David Carlisle
Guest
Posts: n/a
 
      03-01-2005
(E-Mail Removed) writes:

> When I read about XSLT for the first time I thought it was a cool toy,
> but then I asked myself why use XSLT over ASP?


XSLT is a transformation language typically but not always from one xml
vocabulary to another xml vocabulary or html.

ASP is a framework for server side programming of content for a web
server.

So these aren't really comparable. people do all sorts of programming
called from an ASP page, including running XSLT if that is appropriate.

>
> Can someone give a real world example where XSLT would be the best
> choice and why?


If you had to convert (any) XML document into html I think it
would almost always be preferable to use XSLT rather than one of the
languages more commonly called from asp eg vbscript or javascript.
But choice of language is more to do with personal prefernce than
anything else.

If you were not using XSLT, how would _you_ get from

http://www.w3.org/TR/1999/REC-xslt-19991116.xml
to
http://www.w3.org/TR/1999/REC-xslt-19991116

for example?

David
 
Reply With Quote
 
Arfin
Guest
Posts: n/a
 
      03-01-2005
But since you can do the transformation with ASP/PHP/JSP with the same
effort, why use XSLT?

So far I think it's one of those things to have "stashed" just in case
you need it one day...

 
Reply With Quote
 
David Carlisle
Guest
Posts: n/a
 
      03-01-2005

> But since you can do the transformation with ASP/PHP/JSP with the same
> effort, why use XSLT?


Again ASP is just a calling convention. If you are going to transform an
XML file to something most people will find it _much_ easier to use a
programming language that's designed to do transformations than one that
isn't. If you are more familiar with **P and want to program the
the transfomration directly in some low level code that walks over a DOM
or some such structure than fine no one is stopping you doing that but
(apart from unfamiliarity with the language) it would almost certainly
be much easier and more maintainable in XSLT. An awful lot of XSLT
processing is totally unconnected with web server programming, so your
repeated comparison to **P seems rather strange.


> So far I think it's one of those things to have "stashed" just in case
> you need it one day...


I'm sure it is true that the vast majority of the world's population
will quite happily survive without ever needing to use XSLT, so that may
be stashed for a long time.


David
 
Reply With Quote
 
Peter Flynn
Guest
Posts: n/a
 
      03-02-2005
(E-Mail Removed) wrote:

> When I read about XSLT for the first time I thought it was a cool toy,
> but then I asked myself why use XSLT over ASP?
>
> Can someone give a real world example where XSLT would be the best
> choice and why?


a) XSLT is specifically designed to transform XML. It's the right tool
for the job (assuming transforming XML is what you want to do). ASP,
PHP, and JSP know nothing about XML (they have hooks into it, but that
isn't the same thing at all).

b) ASP is Microsoft-specific. There *is* a version for Linux, but it
requires you to use a vendor-supplied custom precompiled binary
of Apache, which no server operator in their right mind would do.
Seeing that most web servers run Linux nowadays, ASP looks like a
rather poor recommendation.

c) ASP is a scripting language for web serving. XSLT has nothing to do
with web serving, so comparing them is probably misleading anyway.

d) I have used ASP, PHP, and JSP to serve pages where the transformation
was done using XSLT, so they are actually complementary.

///Peter
--
"The cat in the box is both a wave and a particle"
-- Terry Pratchett, introducing quantum physics in _The Authentic Cat_
 
Reply With Quote
 
nospam@geniegate.com
Guest
Posts: n/a
 
      03-02-2005
In: <(E-Mail Removed) .com>, "Arfin" <(E-Mail Removed)> wrote:
>But since you can do the transformation with ASP/PHP/JSP with the same
>effort, why use XSLT?


Same effort? Some people might find XSLT easier, (well, for more complex
XML docs anyway)

>So far I think it's one of those things to have "stashed" just in case
>you need it one day...


XSLT can come in handy if you wanted to write a general purpose application
to transform XML to a native format, for example, suppose your application
expects

<plant>
<fruit type="apple" />
</plant>

But someone hands you a:

<menu>
<item type="fruit" name="apple" />
</menu>

Your application could accept as a parameter, a stylesheet to transform the input
document to something you can understand.

Another reason to use it is because it's "standard", if you were a consumer of
a web application and wanted to transform the XML to something else, XSLT is
a standard sort of wedge, they don't need to know PHP or ASP. (or perhaps
as may be the case with java, you don't want them to have the source)

I myself don't use XSLT very often.

Jamie
--
http://www.geniegate.com Custom web programming
(E-Mail Removed) (rot13) User Management Solutions
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Cisco 2611 and Cisco 1721 : Why , why , why ????? sam@nospam.org Cisco 10 05-01-2005 08:49 AM
Why, why, why??? =?Utf-8?B?VGltOjouLg==?= ASP .Net 6 01-27-2005 03:35 PM
Why Why Why You HAVE NO IDEA MCSE 31 04-24-2004 06:40 PM



Advertisments