- 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
Why not replace all ampersands with the the three characters AND ?!
Or would that inhibit their ability to apply SQL queries to the XML string?
Admin
You obviously failed to read the article.
Admin
Admin
I'll buy that for a &.
Admin
We once asked a customer to properly xmlencode special characters when sending over xml. This is what we got: <customer_name>Brandon & Sons</customer_name>
:(
Admin
I suppose before they change the &'s to $'s, they should change the $'s to something else... but they cannot change it to USD, so it'll have to be # (most likely), which will probably translate to the pound symbol... hahahaha.
They're fixing the symptom not the root cause...
Wait until they get other special characters like "ë" etc... they also sometimes throw off home-grown (and M$, I mean M& developed) XML parsers.
But that's a problem for another day I guess...
Admin
Sweet. I'm naming my next company <FooCo/> -- I wonder how many XML apps will choke on that.
Admin
This WTF happens all the time at my company, except the trading partners say "We'll get right on it and fix it," but they never do.
Admin
I've torn out like 10 different ones in our codebase, all written differently. It seems like a rite of passage for crap programmers to try and reimplement an XML parser or generator. Badly.
I actually had to do it because some of the homegrown solutions were bogging down the server... Yay XML::LibXML and Devel::NYTProf::Apache.
My boss didn't believe me until I stepped through the profiling results with him.
Admin
How about:
Admin
Admin
I hope his company isn't doing any business with Ke$ha's production company.
Admin
What if the content legitimately contains a dollar sign? Wouldn't that be wrongly converted to an ampersand? Bunch of losers..
Admin
CDATA to the rescue!
Admin
Anyway, seriously now. I don't understand why they didn't simply use a plus sign. Brandon + Sons sounds much more like Brandon & Sons than Brandon $ Sons. Doesn't it.
Admin
because you would never need $ as a real character right....
awful
Admin
Admin
Hey, I just got off the phone with Micro&oft.
Admin
The next time they invoice for maintenance, send them a check payable in &
Admin
If they could do multi-character replacement, then I choose "WTF".
Admin
The only proper way out of this mess is to change the name of the customer.
Admin
Instead of replacing the ampersand, try replacing the vendor.
Admin
They're changing all the longs to strings?!
Admin
Because the original string might not be in english ?
Admin
Admin
As for "absolutely impossible"... maybe for their programmers, it seems...
Admin
Test.java:4: unclosed character literal System.out.println("Substitution string = " + Nagesh.replace('&' , '&'); ^
Admin
Admin
Admin
Admin
Sometimes the solution to the problem is so simple that nobody seems to notice. Why not ask Brandon & Sons to rename their business? I wouldn’t advise ‘Brandon $ Sons’, but ‘Brandon, Bart and Bobbie’ would be just fine.
Admin
0/10 Try harder.
Admin
What if the content legitimately contains a dollar sign? Wouldn't that be wrongly converted to an ampersand? Bunch of losers..
Admin
Infinite recursion of replacing & with &... unclosed character literals...
Code trolls make me cry inside.
Admin
Our EDI team did exactly this to us a few years ago. We negotiated XML as an interchange format and in testing we started getting files with unescaped ampersands.
Also, when we sent them data, they choked on all of our data. The hand-built test files had each element on a separate line, and our chose parser didn't add line breaks between elements. We were blamed for "changing the format".
I sent them a link to the XML spec and they responded "we can't do all that". To this day, we exchange pseudo-XML with a pre-processor on our end.
Admin
Admin
Sorry, everyone.
Admin
Admin
The real WTF is XML.
The whole 'self-describing' thing is stupid, unnecessary, and nearly impossible to implement, so, avoid the hassle. Write data protocols which match your data, don't squeeze your data into a generic protocol.
Admin
Admin
Admin
FTFY - but I guess that's expected from somebody who includes their CAPTCHA in their post.
Admin
I knew I am not alone! Fnac (http://en.wikipedia.org/wiki/Fnac) does exactly this.
Plus you cannot use shorthands like <field/> for an empty field.
Admin
One time I work on request to make sure that there are exact number of cariage return marks in an address field.
That was big WTF. I send story to Alex, but it not published yet.
Admin
And yes, we've all seen the XKCD reference, no need to repeat it.
--Joe
Admin
frits, you're high this morning
Admin
Admin
Another stupid XML one... HP's iLO technology that allows low-level management of servers (things like remotely power cycling a hung server) has an XML based communications protocol. However, the response to any command is formatted like this:
<RIBCL VERSION="2.22"/> ... stuff ... </RIBCL>So, it's not possible to parse the response with any XML parser.
It also occasionally returns multiple complete XML documents, complete with an XML directive for each. Example:
<?xml version="1.0"?>... result 1 ...
<?xml version="1.0"?>... result 2 ...
Admin
Admin