• anonymous detractor (unregistered) in reply to Fubar

    Whatever. XSLT is great for transforming XML, you just have to know what you're doing.

  • (cs) in reply to NoName

    Anonymous:
    Please, please, would someone drag out this "programmer" and break his fingers. All of them. Or better yet, just shot him. He just needs killing.

    Perhaps first some axe for his fingers, later some bullets to face?

  • (cs) in reply to BlueEagle
    Anonymous:
    What, you've never seen this kind of code before??

    Am I the only one working with such morons on a regular basis? o.O



    Sadly, you're not alone. I have to maintain this guy's earlier projects. It may not be him per se, but I'm sure it is the same guy. And yes, XSLT sucks balls for anything more than simple XML -> HTML transformation. There are a few other small uses, but you're MUCH better off using XPATH + Java/Perl/.NET/whitespace/C++/whatever for any medium to large XML projects.

  • (cs) in reply to Djinn
    Djinn:
    Anonymous:
    What, you've never seen this kind of code before??

    Am I the only one working with such morons on a regular basis? o.O



    Sadly, you're not alone. I have to maintain this guy's earlier projects. It may not be him per se, but I'm sure it is the same guy. And yes, XSLT sucks balls for anything more than simple XML -> HTML transformation. There are a few other small uses, but you're MUCH better off using XPATH + Java/Perl/.NET/whitespace/C++/whatever for any medium to large XML projects.


    XSLT can be used for complex transformations onto the UI layer. It's just pretty obstuse and esoteric when it comes to advanced functions. Just because you do not have a handle on XSLT does not give you the right to run it down; you merely have the right to say you don't understand it very well. It has its place and its usage. And when applied properly can be very powerful.


  • Mhen (unregistered) in reply to b1xml2

    b1xml2:
    Djinn:

    Sadly, you're not alone. I have to maintain this guy's earlier projects. It may not be him per se, but I'm sure it is the same guy. And yes, XSLT sucks balls for anything more than simple XML -> HTML transformation. There are a few other small uses, but you're MUCH better off using XPATH + Java/Perl/.NET/whitespace/C++/whatever for any medium to large XML projects.


    XSLT can be used for complex transformations onto the UI layer. It's just pretty obstuse and esoteric when it comes to advanced functions. Just because you do not have a handle on XSLT does not give you the right to run it down; you merely have the right to say you don't understand it very well. It has its place and its usage. And when applied properly can be very powerful.

    XSLT 1.0 is verbose, I don't think anyone will argue that. That said, you can do pretty much anything you want with it. XSLT 1.0 has been a great learning experiance, and I think that XSLT 2.0 (in the works) addresses most (if not all) shortcomings in XSLT 1.0. Granted, much of the improvements come from XPath 2.0, but XSLT 2.0 is not your mothers XSLT

  • (cs)
    cat Internationalexemelization.xsl >/dev/dsp

    Now that sounds good!

  • (cs) in reply to Joost_
    Joost_:
    Cute, but that would leave him with invalid HTML, because the wëïrd characters would get copied into the output without being transformed to wëïrd. The fun thing is that XSL doesn't provide for this so everybody has to create their own solution; like having ë in the input and then doing the 'disable-output-escaping="yes"' thingy.


    One can always specify document encoding and it would be valid HTML. I write many texts in Polish, so this way of coding national diacritics would be really painful. Instead, I just write text in UTF-8 and specify document encoding.

    Down with this XSL crap.
  • (cs) in reply to Magic Duck
    Magic Duck:

    Anonymous:
    Please, please, would someone drag out this "programmer" and break his fingers. All of them. Or better yet, just shot him. He just needs killing.

    Perhaps first some axe for his fingers, later some bullets to face?



    That'd be too good for him; instead, use a hammer for both.
  • Rowan Lewis (unregistered) in reply to brazzy
    if ($Coder!IsSane) {
        case (@False) {
            $MentalInstitute!MissingPatient!Report($Coder);
        }
    }
    
  • Rowan Lewis (unregistered) in reply to Rowan Lewis

    Forgot to say,   is not a valid XML Entity, unless you add it to a Doctype.

    Not that it matters when all of the other code is bullshit!

  • (cs) in reply to brazzy
    brazzy:
    Magic Duck:

    Anonymous:
    Please, please, would someone drag out this "programmer" and break his fingers. All of them. Or better yet, just shot him. He just needs killing.

    Perhaps first some axe for his fingers, later some bullets to face?



    That'd be too good for him; instead, use a hammer for both.


    Programmer or Serial Killer?

    Nay!

    BOTH!
  • Thygrrr (unregistered)

    The WTF here is that I learned something from this.

    The &copy entity was new to me :D

  • Nihongophone (unregistered) in reply to Jackal von ÖRF

    Jackal von ÖRF:
    The real WTF is that he did not include replacements for all unicode characters.

    That code would not parse ????? (wa-te-fa-ku) correctly to ?????.

    First, the amusing thing: this POS board has automatically unparsed your entities to Unicode.  I'm impressed that you actually managed to get them to display correctly in the first place.

    Second, the obligatory nitpick: I think you mean "howatto za fuxakku", not "watefuxaku".  Or, perhaps, "nanda korya!?"  (Apologies for ro-mazi, there ain't no IME on this work PC.)

  • kekkonen (unregistered) in reply to Nihongophone

    All that code is just unnecessary, just output unicode encoded HTML document and all will be fine <3

  • bryan (unregistered) in reply to Brendan Kidwell

    This code was written by Steve Wolfram?
    It's a new kind of art.

  • (cs) in reply to Nihongophone
    Anonymous:
    Second, the obligatory nitpick: I think you mean "howatto za fuxakku", not "watefuxaku".  Or, perhaps, "nanda korya!?"  (Apologies for ro-mazi, there ain't no IME on this work PC.)

    You're right. I just made a wild guess at how WTF would be written the way it is pronounced in English. I've been learning Japanese only a short while.

    One thing came to my mind about the code. Doesn't the XML parser replace all those &something; entities with their unicode representations? In that case this code

    <xsl:with-param name="pattern" select="'à'"/>
    <xsl:with-param name="replacement" select="'&agrave;'"/>

    would be parsed to

    <xsl:with-param name="pattern" select="'à'"/>
    <xsl:with-param name="replacement" select="'à'"/>

    which would change nothing. Or am I missing something?
  • anon (unregistered)

    BLOAT (Binary Lexical Octet Ad-hoc Transport)

    ftp://ftp.isi.edu/in-notes/rfc3252.txt

  • (cs) in reply to Boofus McGoofus
    Anonymous:
    Anyone know why " " needs to be changed to " "?  Wasn't it valid html to start with?  (Yeah, I read through it.  I'll go be embarrassed now.)


    Valid HTML, but not valid XML without an entity declaration. I strongly suspect that this moron is doing all this because he's set the output format to XML instead of HTML (with an xsl:output element with the attribute method="html", and the appropriate "encoding" attribute to specify utf-8 or another suitable encoding supporting the characters he needs).

    If you don't use method="html" when using XSL to output HTML, you're in for a lifetime of pain.

    Vidar

  • (cs) in reply to Nihongophone
    Anonymous:

    First, the amusing thing: this POS board has automatically unparsed your entities to Unicode.  I'm impressed that you actually managed to get them to display correctly in the first place.

    They showed up correctly to me and are double-escaped in the HTML source, so it must be your browser.

    Anonymous:

    Second, the obligatory nitpick: I think you mean "howatto za fuxakku", not "watefuxaku".  Or, perhaps, "nanda korya!?"  (Apologies for ro-mazi, there ain't no IME on this work PC.)

    Which is great because this way, I learned that you can get small kana by prepending x. Thanks! [:D]

  • Asd (unregistered) in reply to b1xml2
    b1xml2:
    <font size="3">XSLT is a difficult dialect to fully master. Leaving aside for the moment the core issue of replacing textual content inside an XSLT document (which requires recursion), the following is an example of a cleaner implementation:</font><font size="2"></font>

    That is unfortunately dependent on a specific node-set extension. Why variables could not be treated like everything else in XSLT is probably the biggest WTF is any language ever.
    Anyway this is utterly retarded. As others have said serialize to UTF-8 and you don't have a problem with unicode. Otherwise any resaonable HTML Serializer (cocoon, xalan, xerces) will escape the characters for you.

    I find XSLT to be a bizarre mix of the incredibly powerful and the incredibly stupid; xsl:choose anyone? It is not just good for XML -> HTML/WML  but can be very useful for converting between XML file formats, scraping HTML, converting between XML interop languages e.g. SOAP to whatever.
  • sadmac (unregistered)

    Ugh. Reminds me of the last time I had to deal with the PayPal API. Is there a SOAP survivor's support group?

  • (cs) in reply to b1xml2

    b1xml2:
    Djinn:
    Anonymous:
    What, you've never seen this kind of code before?? Am I the only one working with such morons on a regular basis? o.O


    Sadly, you're not alone. I have to maintain this guy's earlier projects. It may not be him per se, but I'm sure it is the same guy. And yes, XSLT sucks balls for anything more than simple XML -> HTML transformation. There are a few other small uses, but you're MUCH better off using XPATH + Java/Perl/.NET/whitespace/C++/whatever for any medium to large XML projects.


    XSLT can be used for complex transformations onto the UI layer. It's just pretty obstuse and esoteric when it comes to advanced functions. Just because you do not have a handle on XSLT does not give you the right to run it down; you merely have the right to say you don't understand it very well. It has its place and its usage. And when applied properly can be very powerful.


    For some reason, some people become obsessed with XSLT and then they start trying to do everything with it.  I've seen this happen at work.  It's not just "pretty obtuse and esoteric" it is very obtuse and esoteric.  So after people go through the huge learning curve of getting something done with it, they start doing everything with it -- 95% of which should never have been done with XSLT in the first place.  Your argument in support of XSLT is weak -- the old you're too dumb to understand how great it is argument.  For a very limited set of circumstances, XSLT is useful.  Why people are trying to make it a complete language unto itself is beyond me.

  • CJ (unregistered)

    It certainly got a 'WTF' out of me.

  • (cs) in reply to Djinn
    Djinn:
    you're MUCH better off using XPATH + Java/Perl/.NET/whitespace/C++/whatever for any medium to large XML projects.


    That's an interesting order of preference in languages [:)]
  • (cs) in reply to LP

    Anonymous:
    Ever heard this?

    XML is like violence: if it doesn't work, use more.

    Sounds like sex ed programs (which attempt to promote responsibility, reduce disease, reduce unwanted pregnancies, abortions) as well. Also reminds me of Einstein's definition of insanity...

  • (cs) in reply to OneFactor
    OneFactor:
    Sounds like sex ed programs (which attempt to promote responsibility, reduce disease, reduce unwanted pregnancies, abortions) as well.


    Except that those generally have the intended effect. I think you meant the abstinence preaching usually proposed as an alternative.

  • Joost_ (unregistered) in reply to zgoda
    zgoda:
    Joost_:
    Cute, but that would leave him with invalid HTML, because the wëïrd characters would get copied into the output without being transformed to wëïrd. The fun thing is that XSL doesn't provide for this so everybody has to create their own solution; like having ë in the input and then doing the 'disable-output-escaping="yes"' thingy.


    One can always specify document encoding and it would be valid HTML. I write many texts in Polish, so this way of coding national diacritics would be really painful. Instead, I just write text in UTF-8 and specify document encoding.

    Down with this XSL crap.


    Please don't talk to me like I approve of this particular usage of XSL. I agree typing out entities is no fun, but that's what we write/have tools for.
  • trav (unregistered) in reply to Brendan Kidwell
    Brendan Kidwell:

    If you zoom out really far, you can see a dot and two right angle brackets.

    [image]



    Nah, it's a sail boat.  And I'm going to see it!  I'll stay here all day if I have to!
  • (cs) in reply to JohnO

    It is not my argument in support of XSLT that is weak. I have deliberately provided minimal content in defence of XSLT. Rather, it are the reasons put forward against XSLT that are weak.

    XSLT is not a platform. It is a limited dialect dealing with XML only, so I cannot see how it can and should be used everywhere. Sounds like you and those who run down XSLT have a hangover problem with developers going over the top trying to squeeze everything into a "XSLT" paradigm.

    I am merely positing that XSLT has and is a very powerful dialect in its own right and has been used in numerous internal and external applications with tremendous impact on both productivity as well as elegance.

  • (cs) in reply to JohnO
    JohnO:

    b1xml2:
    Djinn:
    Anonymous:
    What, you've never seen this kind of code before?? Am I the only one working with such morons on a regular basis? o.O


    Sadly, you're not alone. I have to maintain this guy's earlier projects. It may not be him per se, but I'm sure it is the same guy. And yes, XSLT sucks balls for anything more than simple XML -> HTML transformation. There are a few other small uses, but you're MUCH better off using XPATH + Java/Perl/.NET/whitespace/C++/whatever for any medium to large XML projects.


    XSLT can be used for complex transformations onto the UI layer. It's just pretty obstuse and esoteric when it comes to advanced functions. Just because you do not have a handle on XSLT does not give you the right to run it down; you merely have the right to say you don't understand it very well. It has its place and its usage. And when applied properly can be very powerful.


    For some reason, some people become obsessed with XSLT and then they start trying to do everything with it.  I've seen this happen at work.  It's not just "pretty obtuse and esoteric" it is very obtuse and esoteric.  So after people go through the huge learning curve of getting something done with it, they start doing everything with it -- 95% of which should never have been done with XSLT in the first place.  Your argument in support of XSLT is weak -- the old you're too dumb to understand how great it is argument.  For a very limited set of circumstances, XSLT is useful.  Why people are trying to make it a complete language unto itself is beyond me.



    It is not my argument in support of XSLT that is weak. I have deliberately provided minimal content in defence of XSLT. Rather, it are the reasons put forward against XSLT that are weak.

    XSLT is not a platform. It is a limited dialect dealing with XML only, so I cannot see how it can and should be used everywhere. Sounds like you and those who run down XSLT have a hangover problem with developers going over the top trying to squeeze everything into a "XSLT" paradigm.

    I am merely positing that XSLT has and is a very powerful dialect in its own right and has been used in numerous internal and external applications with tremendous impact on both productivity as well as elegance.

  • (cs)

    It caused a stack overflow in my brain...

  • (cs)

    What in holy hell is that?  In the end, I bet it is nothing more than a text box with a submit button. 

  • mazurek (unregistered) in reply to trollable
    trollable:
    cat Internationalexemelization.xsl >/dev/dsp
    Now that sounds good!


    It really does! This tune should be called "The XML anthem"! Brilliant!
  • dt2 (unregistered) in reply to mazurek
    Anonymous:
    trollable:
    cat Internationalexemelization.xsl >/dev/dsp
    Now that sounds good!


    It really does! This tune should be called "The XML anthem"! Brilliant!



    it sound more like guy who have farting problem
  • mazurek (unregistered) in reply to dt2
    Anonymous:
    Anonymous:
    trollable:
    cat Internationalexemelization.xsl >/dev/dsp
    Now that sounds good!


    It really does! This tune should be called "The XML anthem"! Brilliant!



    it sound more like guy who have farting problem


    And why do you think should "The XML Anthem" sound different from farting? I think it's very apropriate.
  • (cs)

    Does that actually run? I think the parser/transformer will stack overflow real quick.

  • jbode (unregistered) in reply to LP
    Anonymous:
    Ever heard this?

    XML is like violence: if it doesn't work, use more.


    The way I'd heard it was:

    When confronted with a problem, a programmer says, "I know, I'll use XML!"

    The programmer now has two problems.
  • (cs) in reply to jbode
    Anonymous:
    Anonymous:
    Ever heard this?

    XML is like violence: if it doesn't work, use more.


    The way I'd heard it was:

    When confronted with a problem, a programmer says, "I know, I'll use XML!"

    The programmer now has two problems.

    The meaning is very different, and yours is a spinoff of Jamie Zawinski's well known

    Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.

    (in comp.lang.emacs)

  • Anonymous Coward (unregistered)

    I think I played this as a solo in Guitar Hero.

  • Anon (unregistered)

    TRWTF is why this site does not have dynamically expanding DIVs even though it's only 2 columns or at least set the overflow to scrolling.

  • Jimmyanten (unregistered)
    Comment held for moderation.
  • Derekwaisy (unregistered)
    Comment held for moderation.

Leave a comment on “Internationalexemelization”

Log In or post as a guest

Replying to comment #:

« Return to Article