- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Whatever. XSLT is great for transforming XML, you just have to know what you're doing.
Admin
Perhaps first some axe for his fingers, later some bullets to face?
Admin
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.
Admin
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.
Admin
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
Admin
cat Internationalexemelization.xsl >/dev/dsp
Now that sounds good!
Admin
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.
Admin
That'd be too good for him; instead, use a hammer for both.
Admin
Admin
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!
Admin
Programmer or Serial Killer?
Nay!
BOTH!
Admin
The WTF here is that I learned something from this.
The © entity was new to me :D
Admin
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.)
Admin
All that code is just unnecessary, just output unicode encoded HTML document and all will be fine <3
Admin
This code was written by Steve Wolfram?
It's a new kind of art.
Admin
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="'à'"/>
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?
Admin
BLOAT (Binary Lexical Octet Ad-hoc Transport)
ftp://ftp.isi.edu/in-notes/rfc3252.txt
Admin
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
Admin
They showed up correctly to me and are double-escaped in the HTML source, so it must be your browser.
Which is great because this way, I learned that you can get small kana by prepending x. Thanks! [:D]
Admin
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.
Admin
Ugh. Reminds me of the last time I had to deal with the PayPal API. Is there a SOAP survivor's support group?
Admin
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.
Admin
It certainly got a 'WTF' out of me.
Admin
That's an interesting order of preference in languages [:)]
Admin
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...
Admin
Except that those generally have the intended effect. I think you meant the abstinence preaching usually proposed as an alternative.
Admin
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.
Admin
Nah, it's a sail boat. And I'm going to see it! I'll stay here all day if I have to!
Admin
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.
Admin
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.
Admin
It caused a stack overflow in my brain...
Admin
What in holy hell is that? In the end, I bet it is nothing more than a text box with a submit button.
Admin
It really does! This tune should be called "The XML anthem"! Brilliant!
Admin
it sound more like guy who have farting problem
Admin
And why do you think should "The XML Anthem" sound different from farting? I think it's very apropriate.
Admin
Does that actually run? I think the parser/transformer will stack overflow real quick.
Admin
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.
Admin
The meaning is very different, and yours is a spinoff of Jamie Zawinski's well known
(in comp.lang.emacs)
Admin
I think I played this as a solo in Guitar Hero.
Admin
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.