- 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
Who the fuck uses Vista?
(captcha answer: pirates)
Admin
When I posted the posts by Bpsm on the one side and those by Morry, Tray and Krupa on the other hand, where not there yet. I'll just say that an XML viewer is used to view the structure of the XML file and test for conformity. Such a viewer can happily change anything that would be the same according to the XML specifications. So yes, they can change single quotes to double quotes, as long as they remember to fix up the attribute value to account for this. Perhaps the actual byte values on disk would have been different, but it is the exact same XML, and everyone who doesn't understand that and particularly those who cry bug need to get a thorough thwacking with the standard.
Admin
I tried that with our contractor developers here when they wouldn't believe me that their document-transfer program was mangling documents and claimed it was "the way that WordPerfect on our system was opening the documents up."
"The documents were fine on the other side before being transferred!" they explained.
So I got a copy of the original document and compared it with one that we'd received via their transfer program and compared them with a hex viewer. "What is all that gibberish supposed to mean?" was their "developer's" reaction.
CAPTCHA: "pointer" -- I had a few for this dim-bulb.
Admin
you are overhead. I am profit. You are unwilling to edit two characters in your XML, thereby supplying a document with a consistent rather than random delimiter, in order to keep my business. In addition to your priorities, your concept of competence is strangely skewed. Good luck in the soup kitchen line.
Former Client
Admin
I have thought hard, and the best, most straightforward way for me to even react to this story is:
"Yes"
Because anything more will simply cause my brain to overload.
Admin
Try feeding the same thing to Firefox. You'll get the exact same output you get in IE, because both are displaying the XML DOM and not the actual raw XML. (Firefox's display is worse because it highlights the attribute quotes in the same color as the attribute values, but what can you expect for free.)
Both of them are created using a simple XSL sheet you can easily find online.
The Real WTF is that so many people don't know anything about XML while pretending that they do.
Although the ultimate WTF can be obtained by asking people what they think XML is appropriate for. Any answer that isn't "nothing" will be a WTF, and some will just be priceless.
Admin
Seems like they're backpedaling to save face, if you ask me.
Admin
http://worsethanfailure.com/Articles/Stand_Back,I_0x27_m_Educated!.aspx
When arguing against reality, it is often required to deny reality itself. ;-)
Admin
It's not because she's a tester. She's just a moron. Testers are just as necessary as developers, but the mindset is totally diffrent.
Admin
is the number of developers on this forum arguing that single quotes are not valid delimiters for XML attributes. This has been part of the standard for eleven years now (or more if you include the public drafts). It is well documented and easy to look up and others have noted.
The secondary WTF the is that the original poster is not using a (proven?) XML library to parse the valid XML, or else he wouldn't have encountered this as a problem. Worse than that, the parser was written by someone who never looked at/understood the XML spec.
Admin
I think my brain just broke from reading that.
Admin
Of course, it goes without saying that if you do normalize singles to doubles, you had better make damned sure you cover the below case correctly:
foo='bar "baz" bux' (original) foo="bar "baz" bux" (wrong wrong wrong) foo="bar "baz" bux" (right)
Admin
Just third party vendors? OMG when I read this WTF I immediately was reminded of people I work with.
Admin
Thats true, developers try to make something work (not nessasarily the right way but...). Testers try and make something NOT work.
This whole story is a WTF, first guy doesn't know how the parsers work, finds something wierd and tries to argue it as the problem, The second tries to pass off BS because they don't know how it works either and are too afraid to lose geek cred by saying so
Admin
About the Notepad-does-change-text issue: Here you go.
Admin
I've written XML by hand, but never parsed it that way, as our poster is obviously doing. That's stupid, and this single quote bug is an excellent example of why. There are other problems, of course: as soon as there's an encoded entity or unusual character encoding, the homebrew parser will barf. Using a homebrew parser shows a total lack of understanding of XML's design goals. Rick should either be using a standard parser or not using XML.
Admin
Try typing "Bush hid the facts" into Notepad, save it, reload it... it certainly takes guesses at the char-encoding :)
captcha: bathe Hilarious since I skipped my shower this morning...
Admin
NO! WRONG!
http://www.w3.org/TR/2006/REC-xml-20060816/#sec-common-syn
AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
Attributes can, according to the spec, use either single or double quotes.
Admin
Ahh, but it's more intelligent than people give it credit for. and that intelligence sometimes screws it up. For example, if a file has double-byte accented characters in the stream with single byte characters, it will do its best to correctly identify the accents. But if there are also single-byte ansi accents in the file, the double-byte accents will show up as two "unreadable" characters.
My only use for notepad is to cut-n-paste raw text into other applications. Otherwise, for investigation, etc, I use an old DOS version of VEDIT, and my own hex dump program
Admin
Dear retarded programmer,
Your XML parser can't handle valid XML? What's gonna happen when we introduce namespaces?
Just so you know, competence is reading the damn spec.
Good luck with the chewing gum and bailing wire, I'm sure your app will scale nicely.
Admin
A fun trick some years ago was to open Wordpad (or maybe it was Notepad?) and type "Bill Gates loves IBM" (I think that was the phrase...I'm getting old and forgetful), save it, close, then open again, and it came up with black squares. (It was some glitch with encoding in Unicode, but it certainly made for fun conspiracy theories.)
Admin
Yeah, you're smarter than the whole industry. XML, it's totally useless, yesiree. People that use it shure are stoopid.
Admin
Generally true, but not in this case.k
Admin
I would posit that the actual XML stream contains a mixture of double and single quotes, and that Notepad is in fact the ONLY program displaying it "faithfully". XMLSpy and IE are cleaning up the XML to show double quotes for all attributes. This article, while humorous, is plain wrong in saying that Notepad is arbitrarily changing single quotes into double.
Captcha: poindexter
Admin
"Although the ultimate WTF can be obtained by asking people what they think XML is appropriate for. Any answer that isn't "nothing" will be a WTF, and some will just be priceless."
Priceless. The only thing XML is good for is selling large disk drives.
Admin
How does that explain this?
Admin
[quote user="Anon"][quote user="Shinobu"] The Real WTF is that so many people don't know anything about XML while pretending that they do.[/quote]
Ding ding ding! That's the real WTF on this site, period. A bunch of idiots prancing around making fun of other people's code when they rarely know what they're talking about as well (save for a few).
Admin
No. ' is fine, unless you're using a crappy half-assed, home-rolled parser.
Admin
In fact, that's why XML is text, and not binary.
Admin
Both parties are stupid. One does not argue with examples. One pulls out the standard and cites the relevant standard clause.
Admin
Admin
Then you want a hex editor, not an XML editor, because the quotes don't matter after the document is parsed into the DOM. If you care about which quotes were used, or if or was used, or if " or " was used within text, you are concerning yourself with the serialization of the XML, not the document itself.
Admin
So, three WTFs in one post!
First, the support people who obviously think all computer programs are magic, especially so Notepad. Oh, well, not everyone is a programmer.
Second, the client who doesn't understand that XML allows both single and double quotes, and files a bogus bug report on the vendor.
Third, the client who doesn't use an existing parser. There are several quick and dirty parsers, who are quite capable of parsing any "sane" XML document, even if they are not 100% compliant. Tinyxml or XMLSCAN come to mind.
Admin
I don't know which is sadder: the comments of the majority here who think they know XML or that I can clearly picture every single co-worker of mine writing that reply.
Admin
The "real WTF" (or is that 'real WTF'?) is the number of people passing uneducated judgement when all is explained in existing comments.
Admin
You obviously didn't read the MSDN article Shinobu linked to. It's quite clear.
Admin
No, not at all. Particularly not when it comes to Unicode.
For example, if you have two text files with the same characters but in different encodings, or if one has a byte-order mark and the other doesn't, Notepad does just enough conversion to make it impossible to spot the difference.
A hex dump (or an editor that can show a hex dump) is your friend.
Admin
OK, but is that a big-endian hex dump, or a little-endian hex dump?
Admin
Admin
You aren't using it correctly. Remove it from your ear canal.
It's made my life far easier, and if you think it has no use at all, then that's just embarrassing for you.
Admin
Well, ok. Now we have a true WTF. If the info didn't reach you yet, XML is usefull because you can get an universal parser and deal with it in a few minutes.
Now, if you are able to write hierarchical parsers in a few minutes, you can go without XML.
Admin
Some time ago, I tried to argue with a Microserf that IE isn't free as in beer as its price tag is included as a hidden cost in that of MS Windows. He argued that you can download IE for other operating systems (read: select older versions of MS Windows) for free, so it really is free as in beer.
He must have been right because you'd expect a browser that actually costs money to understand the damn standard application/xhtml+xml MIME type instead of requiring server administrators to come up with the most insane workarounds.
Admin
Admin
Unlike your judgement, which is "Educated"!
Admin
For any use of XML I'm aware of, there exists another solution that's easier, less verbose, less error-prone, and faster to parse.
Admin
No, that's called "success". Competence is different.
Oops. Got me!
Admin
It is not a bug: attribute values have to be delimited with a quote or double-quote character. Once that attribute value is imported, exporting it with different delimiters does not change its meaning AT ALL.
Delimiters are not data.
Admin
XML is a virus that needs to be stamped out.
Admin
At my work we deliver XML files to our partners. One of the persons who is responsible for "selling" this doesn't have a technical education.
This is the same person who thought that "XML" was the name of a technology that we had invented, and had presented it as such to the TECHNICAL partners... When I tried to explain what XML was, I only got a blank stare and got the reply "but it said so in the original documentation". I then said that either the person who wrote the documentation didn't know much, or that it was some sort of error in the communication... I doubt that I was believed
Admin