Just Started XSL

Discussion in 'Java' started by Bluuuuuue Rajah, Aug 26, 2009.

  1. 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. :(
     
    Bluuuuuue Rajah, Aug 26, 2009
    #1
    1. Advertising

  2. Bluuuuuue Rajah

    Lew Guest

    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
     
    Lew, Aug 26, 2009
    #2
    1. Advertising

  3. Bluuuuuue Rajah

    Andy Dingley Guest

    On 26 Aug, 21:19, 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.  


    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.
     
    Andy Dingley, Aug 27, 2009
    #3
  4. 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?
     
    Harlan Messinger, Aug 27, 2009
    #4
  5. Bluuuuuue Rajah

    Andy Dingley Guest

    On 27 Aug, 14:57, Harlan Messinger <>
    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.
     
    Andy Dingley, Aug 27, 2009
    #5
  6. Andy Dingley wrote:
    > On 27 Aug, 14:57, Harlan Messinger <>
    > 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.
     
    Harlan Messinger, Aug 27, 2009
    #6
  7. Bluuuuuue Rajah

    David Lamb Guest

    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.
     
    David Lamb, Aug 27, 2009
    #7
  8. Harlan Messinger <> wrote in
    news::

    > Andy Dingley wrote:
    >> On 27 Aug, 14:57, Harlan Messinger
    >> <> 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.
     
    Bluuuuuue Rajah, Aug 27, 2009
    #8
  9. Lew <> wrote in
    news::

    > 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.
     
    Bluuuuuue Rajah, Aug 27, 2009
    #9
  10. Bluuuuuue Rajah

    Lew Guest

    On Aug 27, 3:03 pm, Bluuuuuue Rajah <> wrote:
    > Lew <> wrote innews::
    >

    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
     
    Lew, Aug 27, 2009
    #10
  11. Harlan Messinger <> wrote in
    news::

    > 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 scientific programming.
     
    Bluuuuuue Rajah, Aug 28, 2009
    #11
  12. Lew <> wrote in
    news::

    > On Aug 27, 3:03 pm, Bluuuuuue Rajah <> wrote:
    >> Lew <> wrote
    >> innews:5a224ed9-f8ed-429d-baee-6ede4de7436

    > :
    >>

    > 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.


    And so is a table of numbers, like -8.67382946*10^15, with attached
    names of the parameters they describe.

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


    A scientific graph *is* a data format, and the whole idea behind XML is
    to be a lot more general purpose than what came before.

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


    If XSL isn't pixel addressible, you can't do scientific graphics with
    it. Without graphics, scientific programming is a waste of time.

    > 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.


    All right. So you admit that XML and XSL are too limited for scientific
    programming and data display, even with schemas to represent the
    floating point data. A snorkle is insufficient, and I need an aqualung.
    You said it, not me.

    > I won't hear you if you answer this post through a megaphone.


    Like I didn't already know. Talking to you is like talking to a wall.
     
    Bluuuuuue Rajah, Aug 28, 2009
    #12
  13. Thomas 'PointedEars' Lahn <> wrote in
    news::

    > Bluuuuuue Rajah wrote:
    >> Harlan Messinger wrote:
    >>> Andy Dingley wrote:
    >>>> Harlan Messinger 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.

    >
    > You are mistaken. Those are declaration identifiers, of a markup
    > language (SGML, the Standard Generalized Markup Language, or XML, the
    > Extensible Markup Language, a subset of SGML, respectively).
    >
    > <http://en.wikipedia.org/wiki/Markup_language>
    >
    > And, as I already wrote you via PM, all of this is off-topic here
    > (where "here" applies to every newsgroup that you cross-posted to; can
    > you not read NG names?)


    If you don't like it, then don't read it.
     
    Bluuuuuue Rajah, Aug 28, 2009
    #13
  14. Bluuuuuue Rajah wrote:
    > Lew <> wrote in
    > news::
    >
    >> 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.


    So choose one of the tens of thousands of plotting libraries, in dozens
    of different languages, that are available.

    _If_ your original data is in XML, you might use XSLT (not XSL) to
    transform it some to a more useful form, at which point you'll use an
    appropriate programming language to actually do your math or science on
    the data, and pass the output to the plotting routines.

    AHS
     
    Arved Sandstrom, Aug 28, 2009
    #14
  15. Bluuuuuue Rajah

    Lew Guest

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


    Bluuuuuue Rajah wrote:
    > And so is a table of numbers, like -8.67382946*10^15, with attached
    > names of the parameters they describe.


    True, and you can't do scientific programming with that table of numbers,
    either, nor is it pixel addressable.

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


    Bluuuuuue Rajah:
    > A scientific graph *is* a data format, and the whole idea behind XML is
    > to be a lot more general purpose than what came before.


    But a scientific graph is not a programming language, and neither is XML.

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


    Bluuuuuue Rajah:
    > If XSL isn't pixel addressible [sic], you can't do scientific graphics with
    > it. Without graphics, scientific programming is a waste of time.


    True. Therefore don't try to do scientific programming with XSL. That isn't
    its purpose anyway. You can't complain if something fails to do something
    it's not designed to do.

    Lew:
    >> 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.


    Bluuuuuue Rajah:
    > All right. So you admit that XML and XSL are too limited for scientific
    > programming and data display, even with schemas to represent the


    I never said they were suitable. What I did say, and others have as well, is
    that they were never meant to be, so there's no reason to complain about it
    either.

    > floating point data. A snorkle is insufficient, and I need an aqualung.
    > You said it, not me.


    But you keep complaining about it, just as if you thought it was a bad thing
    that you can't use a snorkel to do deep diving.

    Lew:
    >> I won't hear you if you answer this post through a megaphone.


    Bluuuuuue Rajah:
    > Like I didn't already know. Talking to you is like talking to a wall.


    I'm simply presenting facts. That you don't like the facts is your problem,
    not mine.

    You should follow Arved Sandstrom's advice:
    > So choose one of the tens of thousands of plotting libraries,
    > in dozens of different languages, that are available.
    >
    > _If_ your original data is in XML, you might use XSLT (not XSL)
    > to transform it some to a more useful form, at which point you'll
    > use an appropriate programming language to actually do your math
    > or science on the data, and pass the output to the plotting routines.


    We're trying to help you here.

    --
    Lew
     
    Lew, Aug 28, 2009
    #15
  16. Bluuuuuue Rajah

    Nik Coughlin Guest

    "Bluuuuuue Rajah" <> wrote in message
    news:Xns9C73A61BF949Dfdgdfjhsrtg@188.40.43.213...

    > pixel adressability for display.


    XML -> XSLT -> SVG
     
    Nik Coughlin, Aug 28, 2009
    #16
  17. Bluuuuuue Rajah

    Lew Guest

    Thomas 'PointedEars' Lahn in
    >> And, as I already wrote you via PM, all of this is off-topic here
    >> (where "here" applies to every newsgroup that you cross-posted to; can
    >> you not read NG names?)


    Bluuuuuue Rajah wrote:
    > If you don't like it, then don't read it.


    When you come to a group asking for help, as you did here, it is wise to be
    friendly and conform at least minimally to the standards of the group. "When
    in Rome..." Otherwise you run a serious risk of being labeled a mere troll
    and not getting the help you wish for. Being snarky will not help you.

    --
    Lew
     
    Lew, Aug 28, 2009
    #17
  18. Lew <> wrote in news:h778oh$5ke$:

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

    >
    > Bluuuuuue Rajah wrote:
    >> And so is a table of numbers, like -8.67382946*10^15, with attached
    >> names of the parameters they describe.

    >
    > True, and you can't do scientific programming with that table of
    > numbers, either, nor is it pixel addressable.


    I'm not going to post a table of made-up, floating-point numbers here,
    and it would take only two simple mathematical operations, and one other
    floating point number, to make the number I posted into something that
    **is** pixel addressable.

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

    >
    > Bluuuuuue Rajah:
    >> A scientific graph *is* a data format, and the whole idea behind XML
    >> is to be a lot more general purpose than what came before.

    >
    > But a scientific graph is not a programming language, and neither is
    > XML.
    >
    > Lew:
    >>> Neither one prevents you from doing scientific programming. Neither
    >>> one is intended for programming.

    >
    > Bluuuuuue Rajah:
    >> If XSL isn't pixel addressible [sic], you can't do scientific
    >> graphics with it. Without graphics, scientific programming is a
    >> waste of time.

    >
    > True. Therefore don't try to do scientific programming with XSL.
    > That isn't its purpose anyway. You can't complain if something fails
    > to do something it's not designed to do.


    Now that I'm almost finished reading my XML text, I need to invent a
    project that will require three pages (or so) of code, to finish
    training myself in the language. My idea was to write a numerical
    integrator, matrix invertor and/or a curve plotting routine. XML's
    liitations have killed every single one of my ideas, so perhaps you can
    see why I'm unhappy with it.
     
    Bluuuuuue Rajah, Aug 28, 2009
    #18
  19. "Nik Coughlin" <> wrote in news:h7790g$1a4$1
    @news.eternal-september.org:

    > "Bluuuuuue Rajah" <> wrote in message
    > news:Xns9C73A61BF949Dfdgdfjhsrtg@188.40.43.213...
    >
    >> pixel adressability for display.

    >
    > XML -> XSLT -> SVG


    Are you saying that XSLT is pixel addressable?
     
    Bluuuuuue Rajah, Aug 28, 2009
    #19
  20. Arved Sandstrom <> wrote in
    news:5qFlm.41121$Db2.33746@edtnps83:

    > Bluuuuuue Rajah wrote:
    >> Lew <> wrote in
    >> news:5a224ed9-f8ed-429d-baee-


    >> :
    >>
    >>> 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.

    >
    > So choose one of the tens of thousands of plotting libraries, in
    > dozens of different languages, that are available.


    That won't help me teach myself XML.
     
    Bluuuuuue Rajah, Aug 28, 2009
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    3,690
    A. Bolmarcich
    May 27, 2005
  2. Replies:
    0
    Views:
    583
  3. Bluuuuuue Rajah

    Just Started XSL

    Bluuuuuue Rajah, Aug 26, 2009, in forum: HTML
    Replies:
    41
    Views:
    1,471
  4. Jake Barnes
    Replies:
    2
    Views:
    332
  5. Bluuuuuue Rajah

    Just Started XSL

    Bluuuuuue Rajah, Aug 26, 2009, in forum: Javascript
    Replies:
    51
    Views:
    487
Loading...

Share This Page