473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

XSLT as a programming language - is this for real?

I've been wading through the O'Reilly XSLT book. All seemed OK and sensible
until I got to the "programming" bit - variables, loops, conditions and so
on.

Do people actually use this stuff for real work? I can the advantages of,
say, being able to number pages or something, but surely to do any real
work with this syntax is very difficult?

The concepts don't really intimidate me. I've done a little functional-style
programming, and fully understand how all the examples work. But the syntax
is awful - just about unreadable even for the simple stuff that's in the
book.

I'm wondering if this is an example of computer science gone mad, where
features have been added to the point of idiocy "because we can", or
whether people really use this stuff. Is it really easier - with real world
problems - to write XSLT "scripts" rather than find another way to do it,
using say Perl (or a "conventional" XML-friendly scripting language of your
choice)?
Jul 20 '05 #1
5 2556
Mariusz Sieraczkiewicz wrote:
I don't think that treating XSLT as next programming
language is good approach.
XSLT is perfect for XML transformation, and there is
hidden its all power. Stuff like variables, loops
are helpful while writing more complex transformation.

Begin to use xslt in practice and you'll see, that it's
a very good solution for XML


Yes, I learnt the basics a year or so back, but changed project and didn't
get to use it much. I'm now having another more detailed look.

I've no doubt that it's a great tool. To be honest, my doubt was whether I
need to learn all that horrible syntax and structure for calling functions,
passing parameters and so on. My inclination was not to bother; just make
myself aware of what might be possible in a pinch and move on.

I note the distinct lack of people screaming "it's invaluable! learn it
thoroughly and immediately!" so I'm currently inclined to go with my
instincts and skim those chapters.
Jul 20 '05 #2
I started using XSLT while exploring Cocoon and XML publishing.
It's most innovative set of tools I've met since I began to
write software (4 years ago).
Well designed XML documents and XSLT stylesheets gave me a great
opprtunity to create reusable XML 'components' (sic!)
(I mean XSLT+XML), so that with predesigned patterns for creating
HTML forms for editing, reading, adding or deleting data from DB,
making complex data driven sites is a really pleasant thing.
I really love it, it made me think efficiently.

Regards, Mariusz Sieraczkiewicz
Jul 20 '05 #3
If you do any serious XSLT work, sooner or later you will come across a
requirement that will need you to write programming style constructs (find
and replace for more than one character in a string for instance)

now you have two choices, either introduce another stage before or after the
XSL processing, or write that function in XSL. This will depend on how much
programming-style stuff you have to do. sometimes it will turn out better to
bite the bullet and introduce a whole new non-xsl process in the pipeline,
but definitely some of the time you'll find it's easier to code the function
in XSL (or find a fragement on the web) and have the advantages of a purer
system architecture.

Andy

"Derek Fountain" <no****@hursley.ibm.com> wrote in message
news:3f***********************@freenews.iinet.net. au...
I've been wading through the O'Reilly XSLT book. All seemed OK and sensible until I got to the "programming" bit - variables, loops, conditions and so
on.

Do people actually use this stuff for real work? I can the advantages of,
say, being able to number pages or something, but surely to do any real
work with this syntax is very difficult?

The concepts don't really intimidate me. I've done a little functional-style programming, and fully understand how all the examples work. But the syntax is awful - just about unreadable even for the simple stuff that's in the
book.

I'm wondering if this is an example of computer science gone mad, where
features have been added to the point of idiocy "because we can", or
whether people really use this stuff. Is it really easier - with real world problems - to write XSLT "scripts" rather than find another way to do it,
using say Perl (or a "conventional" XML-friendly scripting language of your choice)?

Jul 20 '05 #4
On Thu, 14 Aug 2003 09:10:42 GMT, "Andy Fish"
<aj****@blueyonder.co.uk> wrote:
If you do any serious XSLT work, sooner or later you will come across a
requirement that will need you to write programming style constructs (find
and replace for more than one character in a string for instance)


IMHO, that's time for a Javascript extension. XSLT works OK with
nodes, but I don't use it to work within a node (like slicing a single
string)

Jul 20 '05 #5
> I've been wading through the O'Reilly XSLT book. All seemed OK and
sensible
until I got to the "programming" bit - variables, loops, conditions and so
on.

Do people actually use this stuff for real work? I can the advantages of,
say, being able to number pages or something, but surely to do any real
work with this syntax is very difficult?
Yes, there exist people who do real work with XSLT.
The concepts don't really intimidate me. I've done a little functional-style programming, and fully understand how all the examples work. But the syntax is awful - just about unreadable even for the simple stuff that's in the
book.

Perhaps your perception of XSLT as a functional/procedural language is part
of the problem. XSLT gets its simplicity and power from its *declarative*
constructs. If you recognize it as more akin to expert system languages
like CLIPS, its nature will seem clearer. The procedural loop constructs
are more natural for many, but the declarative, rule-based approach is often
more elegant and easier to maintain.

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brett conklin | last post by:
I would like to not use the google groups as a crutch in my XSLT journey. What is the best xslt reference out there? Is it a book? Is it a web site? I am finding that I can come up with nearly...
6
by: arfinmail | last post by:
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...
5
by: Fred | last post by:
Not much expertise on XSLT and trying to understand it's uses when creating apps in VS.NET? If I wanted flexibility on the UI (View aspect of M.V.C.): - How does it compare with creating...
0
by: Christopher M. Lauer | last post by:
I have done my best to answer this question but can not find the proper set of commands. I would like to transform an xml file (in code behind) and display its output in a specific html tag,...
3
by: VMI | last post by:
I'm having trouble writing several records from an XML file into an html file. The problem is that it only outputs one record to the html file. I need to export all the records in the xml file to...
6
by: Neal | last post by:
Hi All, I used an article on XSLT and XML and creating a TOC written on the MSDN CodeCorner. ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dncodecorn/html/corner042699.htm However, it did'nt...
6
by: Neal | last post by:
Hi All, I wrote a TOC treeview using xml and xslt, with help from this forum and MSDN help(thanks) Great in IE 6. (expect IE 5 as well, articles were circa 2000) However, Mozilla FireFox...
6
by: naima.mans | last post by:
Hello :) I'm newbie to XSLT and i need some advice please: Here the action: I have to browse an XML file with xslt : For each node i have to determinate if it is a node where i need to add...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.