Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Just Started XSL

Reply
Thread Tools

Just Started XSL

 
 
Bluuuuuue Rajah
Guest
Posts: n/a
 
      08-26-2009

I just started reading the XSL chapter in my XML book, and I was struck by
the similarity in the general concept to the old Cobol Report Writer. I
used to criticize Cobol, because it was so much more fashionable to be a
Fortran programmer, but now I'm not so sure.

I sure wish XML had mathematical data types and pixel adressability for
display. I've got some good project ideas, and I can't do them, because
they're scientific programming and display projects.
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      08-26-2009
Bluuuuuue Rajah wrote:
> I sure wish XML had mathematical data types and pixel adressability for
> display. *I've got some good project ideas, and I can't do them, because
> they're scientific programming and display projects. *
>


The first part of your wish, "mathematical" data types, has been
granted long since.
<http://w3schools.com/schema/schema_dtypes_numeric.asp>

The other part, "pixel addressability", makes no sense whatsoever.
What could such a thing mean in the context of XML?

How exactly do being scientific programming or display projects
interfere with your ability to do them?

--
Lew
 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      08-27-2009
On 26 Aug, 21:19, Bluuuuuue Rajah <(E-Mail Removed)> wrote:
> I just started reading the XSL chapter in my XML book, and I was struck by
> the similarity in the general concept to the old Cobol Report Writer. *


Then you need a better XSLT tutorial.

There are any number of "templating" languages around: simplistic
JSP / classic ASP, Apache Velocity, DSSSL (&deity; preserve us), <*-
language> Report Writer, even the Access report tool. You have a
blank "document" which you can populate with "fields" and "labels"
that are either dynamic or static content, sourced by some predicate
expression. Maybe you get switch statements to control behaviours of
larger sections. The overall structure of the document is pretty
procedural though - "lumps" of content are in sequence, and the output
follows the sequence of the source.

XSLT isn't really one of these though. It _can_ be used in that way,
most commonly it is used that way, but that's not regarded as
particularly good XSLT style or as using XSLT's best features.

XSLT has a powerful pattern matching feature that allows templates to
be applied to describable pieces of content, but without hard-coding
the sequence in which these are expected to be encountered in the
input document. If your input is a SQL query resultset, then this
ordering is trivial and obvious so you hardly need this feature. If
your input is any arbitrary tree-structured XML (the market that XSLT
addresses) then you need something smarter than a traditional report
writer.

If you write "old school" XSLT in a purely procedural style, you're
missing out. In particular, you'll write XSLT that works, but it only
works for a narrower range of inputs than it needs to. This makes your
final product less robust against change. For more discussion of
this, try searching for "pull and push model" coding styles in XSLT.
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      08-27-2009
Bluuuuuue Rajah wrote:
> I just started reading the XSL chapter in my XML book, and I was struck by
> the similarity in the general concept to the old Cobol Report Writer. I
> used to criticize Cobol, because it was so much more fashionable to be a
> Fortran programmer, but now I'm not so sure.
>
> I sure wish XML had mathematical data types and pixel adressability


XML is a method of storing and transmitting data. What would pixels have
to do with it?

> for
> display. I've got some good project ideas, and I can't do them, because
> they're scientific programming and display projects.


Neither XML nor XSL is a programming language. What would you say to
someone who is unhappy that he can't use the copying machine--even
though it has drawers and generates heat--to bake a pizza?
 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      08-27-2009
On 27 Aug, 14:57, Harlan Messinger <(E-Mail Removed)>
wrote:

> Neither XML nor XSL is a programming language.


Whilst XML is used to represent several programming languages
(including XSLT), I'd agree with you that it isn't itself. However
XSLT certainly is.

> What would you say to
> someone who is unhappy that he can't use the copying machine--even
> though it has drawers and generates heat--to bake a pizza?


"You're not trying hard enough"

Page 42, the Dilbert Cookbook. Alongside how to cook noodles in a
coffee maker.
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      08-27-2009
Andy Dingley wrote:
> On 27 Aug, 14:57, Harlan Messinger <(E-Mail Removed)>
> wrote:
>
>> Neither XML nor XSL is a programming language.

>
> Whilst XML is used to represent several programming languages
> (including XSLT), I'd agree with you that it isn't itself. However
> XSLT certainly is.


Well, for certain values of "programming language". I don't really see
it as one, despite the control structures. Perhaps another way to state
my objection is that XSL is by design a *limited-domain* programming
language, and the corresponding analogy would be to expect to bake a
pizza in a rice steamer.

>> What would you say to
>> someone who is unhappy that he can't use the copying machine--even
>> though it has drawers and generates heat--to bake a pizza?

>
> "You're not trying hard enough"
>
> Page 42, the Dilbert Cookbook. Alongside how to cook noodles in a
> coffee maker.

 
Reply With Quote
 
David Lamb
Guest
Posts: n/a
 
      08-27-2009
Andy Dingley wrote:
> If you write "old school" XSLT in a purely procedural style, you're
> missing out.


A sad commentary on current practice: I seem to recall a JavaLobby
article recently (say, within 6 mths) where somebody basically said XSLT
is dying out, and good riddance, because it requires people to learn a
"functional" mindset and procedural is all people are willing to use.
 
Reply With Quote
 
Bluuuuuue Rajah
Guest
Posts: n/a
 
      08-27-2009
Harlan Messinger <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Andy Dingley wrote:
>> On 27 Aug, 14:57, Harlan Messinger
>> <(E-Mail Removed)> wrote:
>>
>>> Neither XML nor XSL is a programming language.

>>
>> Whilst XML is used to represent several programming languages
>> (including XSLT), I'd agree with you that it isn't itself. However
>> XSLT certainly is.

>
> Well, for certain values of "programming language". I don't really see
> it as one, despite the control structures. Perhaps another way to
> state my objection is that XSL is by design a *limited-domain*
> programming language, and the corresponding analogy would be to expect
> to bake a pizza in a rice steamer.


Sure it is. The commands are ELEMENT, ATTLIST, ENTITY, NOTATION and a
couple of more that I don't feel like looking up.
 
Reply With Quote
 
Bluuuuuue Rajah
Guest
Posts: n/a
 
      08-27-2009
Lew <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Bluuuuuue Rajah wrote:
>> I sure wish XML had mathematical data types and pixel adressability
>> for display. *I've got some good project ideas, and I can't do them,
>> because they're scientific programming and display projects. *

>
> The first part of your wish, "mathematical" data types, has been
> granted long since.
> <http://w3schools.com/schema/schema_dtypes_numeric.asp>
>
> The other part, "pixel addressability", makes no sense whatsoever.
> What could such a thing mean in the context of XML?
>
> How exactly do being scientific programming or display projects
> interfere with your ability to do them?


Scientific programming is useless without the ability to plot your
output data.
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      08-27-2009
On Aug 27, 3:03*pm, Bluuuuuue Rajah <(E-Mail Removed)> wrote:
> Lew <(E-Mail Removed)> wrote innews:(E-Mail Removed):
>

Bluuuuuue Rajah wrote:
> >> I sure wish XML had mathematical data types and pixel adressability
> >> for display. *I've got some good project ideas, and I can't do them,
> >> because they're scientific programming and display projects. *

>
> > The first part of your wish, "mathematical" data types, has been
> > granted long since.
> > <http://w3schools.com/schema/schema_dtypes_numeric.asp>

>
> > The other part, "pixel addressability", makes no sense whatsoever.
> > What could such a thing mean in the context of XML?

>
> > How exactly do being scientific programming or display projects
> > interfere with your ability to do them?

>
> Scientific programming is useless without the ability to plot your
> output data.


OK. The next question is what that has to do with XML. XML is a data
format.

XSL is a means of transforming XML data from one format to another.
It is not a general-purpose programming environment.

Neither one prevents you from doing scientific programming. Neither
one is intended for programming.

It's like complaining you can't use a rice steamer to bake a pizza.
If you don't like that simile, it's like complaining that you can't
cut wood with a hammer. You can't view a web page with a number 2
pencil, either. You can't breathe 50 feet under water with a
snorkel. I won't hear you if you answer this post through a
megaphone.

--
Lew
 
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
Just Started XSL Bluuuuuue Rajah Javascript 51 09-03-2009 12:26 AM
Just Started XSL Bluuuuuue Rajah HTML 41 09-03-2009 12:26 AM
if a variable is started inside a closure, can it ever be redeclared and started over, outside of the original function? Jake Barnes Javascript 2 02-15-2006 03:32 AM
xsl - ignore XSL:FO tags, just output them paul.rusu@gmail.com XML 0 12-21-2005 03:49 PM
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM



Advertisments