|
|
|
| Non-WTF Job: Web Developer at ZoomInfo (Waltham, Massachusetts) |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Next » |
Re: Notepad Translation Error
2007-11-29 11:32
•
by
Justin Haygood
(unregistered)
|
|
Gotta love third party vendors who think they know everything, eh?
|
|
If that's the biggest problem you've got with XML and interoperability, you're a very lucky person.
Just accept the single quotes. |
Re: Notepad Translation Error
2007-11-29 11:33
•
by
Paddington Bear
(unregistered)
|
|
{Sound of forehead hitting desk}
|
|
MSIE's behind-the-scenes error correction has effectively made erroneous HTML, XML, etc. the de facto standard, and for the sake of compatibility the rest of the world is forced to "comply" with this undocumented "standard." Suck!
|
|
The wtf is that they're using notepad on vista, right?
|
|
{Sound of a second forehead hitting desk}
|
|
The WTF is that they wrote "away" instead of "a way".
|
|
And these guys do programming for living ?
This story gives me the creeps. I do not think they were serious. Either they were joking or trying to save face. I refuse to believe that someone actually believes that notepad does ANY conversion when loading the file (other than maybe char-encoding). |
|
Follow up by posting screenshots of the XML file opened in WordPad, Word, TextPad, and a hex viewer.
|
|
{Sound of the vendor's head hitting my desk}
Captcha: ewww (the response from the vendor's head hitting my desk) |
|
I have fought very similar fights with clients/3rd party vendors. I finally got my point across when I made them open up the the file in a hex editor and take a look at the actual hex values.
|
|
OK, correct me if I'm wrong, but doesn't XML allow both single and double quotes to be used for attribute values?
|
Dear Vendor, thank you for your prompt reply. Consulting my calendar, I see that I will be busy early next week taking bids from your three main competitors. Pursue the Notepad issue if you wish; however, in all likelihood, by the time you respond I will be too involved with them to discuss your findings with you. Regards, Client |
Re: Notepad Translation Error
2007-11-29 11:50
•
by
cavemanf16
|
Well then you simply haven't lived in the business world long enough. This struck me as one of the more boring WTF stories, because responses like that happen so often. |
|
"XMLSpy and IE both correct minor errors". Maybe this should have given Rick a clue as to how to proceed.
|
|
Yeah, Ender, I had the same question. If they're sending valid XML, why do you care. The WTF is probably a do-it-yourself parser that doesn't hew to the standard.
|
Actually, attribute values should be delimited by double quotes. It does not say that they should not be delimited by anything else. Because of this, parsers were written to handle both. Because some parsers handle both (like IE's) but the spec says double quotes, IE will convert the singles to doubles and happily churn along. This doesn't seem bad until you start embedding quotes inside your attribute values and get away from the standard. Imagine what would happen when IE converts the following wrong implementation: value='He said "Hello" to her.' Please stick with the standard, encode your embedded quotes and let every parser work, not just those that look at your bad code and try to fix it for you. |
Except then Rick would have to use a home-grown XML parser or, potentially worse, fudge the incoming XML with a front-page-worthy replace function that finds 's and replaces them with "s only in the right situations. |
http://www.w3.org/TR/REC-xml/ 'string' matches a literal string matching that given inside the single quotes. |
Re: Notepad Translation Error
2007-11-29 12:01
•
by
Drake
(unregistered)
|
|
The spec does not say to use double quotes. It says either is acceptable. Here, I am assuming "the spec" refers to the XML 1.0 specification, Fourth Edition: http://www.w3.org/TR/2006/REC-xml-20060816/
And then, in the grammar:
|
Re: Notepad Translation Error
2007-11-29 12:03
•
by
Angstrom
(unregistered)
|
|
http://www.w3.org/TR/REC-xml/
[41] Attribute ::= Name Eq AttValue [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" |
|
Who uses an XML parser that only allows "" for attributes these days?
|
Re: Notepad Translation Error
2007-11-29 12:06
•
by
Pecos Bill
|
As if! Most of us peons are stuck with a wretched company like this because our "higher-ups" bought the sales pitch. And, couldn't agree more about Microsoft screwing up the standards. |
|
The vendor is correct. Notepad routinely translates and filters what you try to say to it.
Proof: http://www.entropiaforum.com/forums/wlwc/28871-things-you-cant-say-notepad.html |
Re: Notepad Translation Error
2007-11-29 12:10
•
by
Alin
(unregistered)
|
This is genius! |
No, actually, the standard says exactly what delimits attribute values: http://www.w3.org/TR/2006/REC-xml-20060816/#NT-AttValue [10] AttValue ::= '"' ([^<&"] | Reference)* '"' Notice that both single and double quotes are explicitly allowed. |
|
This reminds me of an incident I faced a few months ago. The vendor I was dealing with on my project requested that I send some samples of the web services requests we would be sending, so I sent them as .xml files. The vendor's representative (this *was* a tester, not a developer, but I still don't call it an excuse) asked that I please send the file as a .txt file, because, when she opened the file, it had little symbols in front of the text. It took me some time to realize that she was double clicking on the file and it was opening in IE, and the "little symbols" were the "+" and "-" icons IE provides to allow you to collapse and expand elements of an XML file.
|
|
well... we use text files because binary is harder. but seems even text is too hard for some people.
theres something called monospace. the concept of plant/text or tools called hex-editor hex-viewer anything of this will fix this people problem. but maybe whas originated on a non-tecnical guy, like the reply email was written by management, and not the tecnical guys. |
|
1. A hex dump shows reality.
2. When you argue against the contents of the hex dump, you are arguing against reality. 3. When you argue against reality, you are wrong. It's that simple. |
|
To sum up this dialogue:
Rick: "Hey Terry, my dick's bigger." Terry: "No, mine is." Rick: "No, mine is." |
Re: Notepad Translation Error
2007-11-29 12:18
•
by
AdT
(unregistered)
|
Please RTFStandard before asking other people to stick with it. The standard does not require you to use double quotes, or escape inner quotes that differ from the outer quotes.
This has been in the spec at least since the 1996 working draft.
I don't need to imagine it because I actually tested it: IE simply displays the outer and inner quotes in different colors, which IMO is acceptable for an XML viewer. |
|
As some commenters have already said, the clueless WTFer's are on both sides : QUOTES ON ATTRIBUTES ARE VALID XML.
So if you're having trouble parsing xml files because of quotes, it means you're parsing it with a homebrew and not so smart parser. Pot, meet kettle and go pool your resources to buy a clue. |
|
I always tought the utility of notepad was actually to see text files without any formatting....
|
|
The real WTF is that anyone thought this was a WTF
|
Re: Notepad Translation Error
2007-11-29 12:31
•
by
Thogek
(unregistered)
|
Amazing what outlandish stretches some people will argue when the alternative is simply admitting to a mistake. Unfortunately, not all that uncommon a phenomenon. :-( |
True enough, all too often... |
|
Yes, it does.
|
|
The worrying thing is, I can't think of any xml library in any language that would generate some attribute values enclosed in ' and others in "
Which can only mean they are hand crafting the xml... errk |
Re: Notepad Translation Error
2007-11-29 12:48
•
by
Ben4jammin
(unregistered)
|
Not only that, but add to it the fact that they will spend all this time in a pissing contest and not spend 5 minutes actually TRYING the fix to see if it works. Even after they verified his notepad screenshot. Which means they had it open in a medium that would allow them to fix it RIGHT THEN. They were literally a few clicks away from the fix, but chose to continue the arguement instead. Unfortunately, there is probably no way to explain (in terms they can understand) this to management which means you are stuck with this vendor regardless of the level of stupidity they exhibit. And for those that don't know, yes this happens ALL the time with some vendors. |
Re: Notepad Translation Error
2007-11-29 12:54
•
by
Cloak
(unregistered)
|
Indeed, it is the last member of not-so-intelligent programs. That's why you need it so badly: no transforms, no automatic changes of files, and simply open everything that is called a file. |
When the XML document is tiny and/or guaranteed to have a static structure, it's perfectly reasonable to decline involving a lumbering XML library. |
Re: Notepad Translation Error
2007-11-29 13:05
•
by
bpsm
(unregistered)
|
The real WTF is that they are fighting about wether attributes are delimited by single ' or double " when the standard clearly allows both. Insisting otherwise is just standardization-by-hearsay: STag ::= '<' Name (S Attribute)* S? '>' Attribute ::= Name Eq AttValue AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" http://www.w3.org/TR/REC-xml/#NT-AttValue The reason IE shows the attributes all as double quotes is because it's parsing the XML to a DOM tree, before displaying it again using the default style sheet. Parsing the XML loses the information about what delimiters were used around the attribute because it isn't actually important. I can accept confusion about XMLs dusty corners and gnarlier features: entity references, doctypes, system identifiers, DTDs, CDATA and namespaces. But XML at the simplest lexical level: element and attribute ought not be a source of confusion for a competent programmer. |
|
Am I the only one that finds it strange that XMLspy would change the 's to "s? If they're correct, then I would want to see them as they are. If they're wrong, then I still want to see them as they are. XMLspy's functionality is deteriorated IMHO because of this one bug.
|
|
I totally agree, this kind of "background correction of minor errors" is rahter a bug, not a feature.
|
Re: Notepad Translation Error
2007-11-29 13:15
•
by
krupa
(unregistered)
|
Agreed. If there's a mistake in the XML being viewed, the viewer should report the problem, not fix it on the sly. At least make a user-configurable option to fix small problems quietly, after prompting, or never. (Default to never.) |
|
WTF 1: insisting single quotes are not allowed
WTF 2: insisting notepad replaces quotes The Real WTF™: using XML Interestingly, feed this to IE: <l>You'll see something like: - <l>All correctly syntax-highlighted, mind you, so evidently it gets parsed correctly, but the resulting display is not valid XML even when we ignore the +/- thingies. |
Re: Notepad Translation Error
2007-11-29 13:16
•
by
real_aardvark
|
If the XML doc is guaranteed to be tiny and/or to have a static structure, it's even more reasonable to decline to involve XML in the first place. |
The real WTF is the idiot who thought the XML he was being sent was flawed for containing single quoted attribute values. That's different from what most people seem to have assumed, which is that the WTF was the person stating there was no problem with the XML but the viewer (though that might qualify as a WTF in its own right, albeit of a lesser proportion). |
|
It's seems every one is missing the point of the article... Those people thought that Notepad was changing the quotes as IE does.
Anyway, the RealWTF is that they're using Vista. $cat foo.xml That's it Tesla! |
Re: Notepad Translation Error
2007-11-29 13:19
•
by
Bejesus
(unregistered)
|
Dear Client It is with regret that we note our ironic humour did not hit the mark when we replied to your idiotic bug report with an equally idiotic response. I wish you luck finding a vendor willing to provide you with a system that automagically works around your obviously flawed software that is incapable of parsing correct XML. regards Competent People |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Next » |