- 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
greetings, eMBee.
Admin
It was actually in the description field. Not sure what was suggested during the interviews.
Admin
Trust me: If they can't do "&", they can't do unicode either.
Admin
I believe that problem can be solved with the recent advanced IT technique called, "Not calling the encode function again on the string that you just encoded." It's listed in many software development textbooks under the heading, "Foot, shooting yourself in the, not".
There are related technique called "Updating the variable you intended to update rather than another one with a similar name" and "Using the plus sign when you want to add two numbers instead of using the ampersand".
Admin
Admin
Internet Explorer can't tell if it's valid unless you've got a DTD or schema to validate against. I would be stunned if they had that, as very few users of XML bother with those.
Which is fine by me, as DTD/schema only contain a structure and no "meaning", while the Word document and "maximal example" files defines both structure and meaning.
My parsers for the data file from them have the effective "schema" hard-coded (based on a streaming XML parser. DOM is too slow for this, and SAX is just awful.)
Admin
"ё" is not special character, it's regular Cyrillic letter. It's need to be escaped only in non-unicode XML. And if you use non-unicode XML then it's real WTF.
Admin
I'd get the aspie neckbread down the hall to write a pearl script to deal with the unescaped ampersands.
Do I get the job?
Admin
The real WTF is being so f...ing stupid as to use XML for everything, everywhere, regardless of it's applicability -- just because XML is so cool and everyone else uses it. Thus if you use XML, you show your customers what a knowledgeable professional you are.
It doesn't matter whether XML is well-suited or whether your customers who may not have an understanding of the non-obvious rules run into problems like the one mentioned here. Clearly, if someone has a & character in their company name, and they don't realize that the underlying encapsulation chokes on that, they must be total idiots.
A similar issue comes from the human-readable property of XML. In many cases it is not necessary or even desirable that data be human-readable and editable (e.g. config files). Nevertheless, XML is still used, because it's there and hey, it's cool. It then comes as a total surprise when end-users actually edit data (some people feel COMPELLED to do that, because it's XML) and programs exhibit unexplainable behaviour.
Admin
Would you please show us that code? May I suggest using the "Submit your wtf" button above?
Admin
Admin
Yes, actually, there is something you could replace ampersands with "on your side". Please replace all ampersands with & Thank you.
Admin
That is sick and ingenious at the same time. Could XML be any uglier?
Admin
Whooot! Careful with this. Its dangerous.
Admin
mtom is what xml enconding should have been.
http://docs.oracle.com/cd/E15523_01/web.1111/e15184/mtom.htm
no "human readable" bullshit and bloat, its like binary xml.
i use it, because i develop both client and server programs (not same language).
Admin
Fools, open source only exist because hardware manufacturers like IBM wants software to be commodity, but Microsoft has turned hardware into commodity. Live with it. When all software is free, you will need to work in hardware, and everyone knows the price of hardware only drops. Because software is complement of hardware. We are really screwed. Thanks Microsoft for stopping this nonsense. In little time, we (developers) arent anymore enginers, we will be artists that need donations to be sustained, like painters.
Admin
TRWTF is the writers inability to convince.
Admin
Not sure if this was a joke, but I had to do that. So many vendors connecting to the system could not master sending valid XML that a cleanup process was added to the stream that would sanitize the input before parsing the "XML".
Let's not even get started on the problems when the vendors should implement valid HTTP cache headers.
Admin
Yep. Thanks to a kind offer from the W3C. The advantage to it is that it gets rid of the "bloat" that seems to be the chief complaint of most XML critics.
(inb4 Akismet says out)
Admin
I think the more accurate description of Ponsonby-Smythe is that he is a Joey.
Any biters?
Admin
Many comments seem to flirt with sarcarsm and sound like jokes, but also too many suggestion sound so serious, it make me feels there is way too much inspiration for all those WTF articles! :-)
Admin
why not just run a regex with this pattern: &(?![\w]*;)
would find the &s in bold: & & &hello daily & wtf daily & wtf this < > &; & abc &abc
Admin
&this; is an invalid entity and should therefore be failed.
Code review: pass!
Admin
Then I'd be more concerned about the guy who writes hard-coded invalid ampersand entities, but I think that this would do the job in this case.
Admin
So... what do you do if there's an actual dollar-sign in the company name?
Admin
Nvm, asked before...
Admin