Comment On Notepad Translation Error

For several days, Rick was fighting with a third party vendor. Rick's system was supposed to talk to his vendor's system using XML files, but their files were coming back with invalid XML data. Rick complained to a technical contact ("Terry") that the XML they returned was invalid. Terry argued that they were processing the file wrong. [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5Next »

Re: Notepad Translation Error

2007-11-29 11:32 • by Justin Haygood (unregistered)
Gotta love third party vendors who think they know everything, eh?

Re: Notepad Translation Error

2007-11-29 11:33 • by Alun (unregistered)
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}

Re: Notepad Translation Error

2007-11-29 11:33 • by Andy Goth (unregistered)
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!

Re: Notepad Translation Error

2007-11-29 11:34 • by atari (unregistered)
The wtf is that they're using notepad on vista, right?

Re: Notepad Translation Error

2007-11-29 11:41 • by NerfHerder (unregistered)
{Sound of a second forehead hitting desk}

Re: Notepad Translation Error

2007-11-29 11:41 • by Nacho (unregistered)
The WTF is that they wrote "away" instead of "a way".

Re: Notepad Translation Error

2007-11-29 11:44 • by Nelle
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).

Re: Notepad Translation Error

2007-11-29 11:44 • by Zylon
Follow up by posting screenshots of the XML file opened in WordPad, Word, TextPad, and a hex viewer.

Re: Notepad Translation Error

2007-11-29 11:45 • by Venda Killa (unregistered)
{Sound of the vendor's head hitting my desk}

Captcha: ewww (the response from the vendor's head hitting my desk)

Re: Notepad Translation Error

2007-11-29 11:48 • by Sean (unregistered)
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.

Re: Notepad Translation Error

2007-11-29 11:49 • by ender
OK, correct me if I'm wrong, but doesn't XML allow both single and double quotes to be used for attribute values?

Re: Notepad Translation Error

2007-11-29 11:50 • by FredSaw
If required we are able to look at why Notepad translates these files with ' and not ", however this investigation will not be able to commence until early next week, although our thoughts are that the way that the file opens in notepad, has only clouded the issues...
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
163427 in reply to 163421
Nelle:
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).


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.

Re: Notepad Translation Error

2007-11-29 11:52 • by gabba
"XMLSpy and IE both correct minor errors". Maybe this should have given Rick a clue as to how to proceed.

Re: Notepad Translation Error

2007-11-29 11:55 • by Ypsin (unregistered)
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.

Re: Notepad Translation Error

2007-11-29 11:57 • by KattMan
163430 in reply to 163425
ender:
OK, correct me if I'm wrong, but doesn't XML allow both single and double quotes to be used for attribute values?


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.

Re: Notepad Translation Error

2007-11-29 11:58 • by Welbog
163431 in reply to 163428
gabba:
"XMLSpy and IE both correct minor errors". Maybe this should have given Rick a clue as to how to proceed.
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.

Re: Notepad Translation Error

2007-11-29 12:01 • by XIU
163432 in reply to 163430
KattMan:
ender:
OK, correct me if I'm wrong, but doesn't XML allow both single and double quotes to be used for attribute values?


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.


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)
163433 in reply to 163430
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/

Literal data is any quoted string not containing the quotation mark used as a delimiter for that string. Literals are used for specifying the content of internal entities (EntityValue), the values of attributes (AttValue), and external identifiers (SystemLiteral). Note that a SystemLiteral can be parsed without scanning for markup.

And then, in the grammar:

AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"

Re: Notepad Translation Error

2007-11-29 12:03 • by Angstrom (unregistered)
163434 in reply to 163430
http://www.w3.org/TR/REC-xml/

[41] Attribute ::= Name Eq AttValue

[10] AttValue ::= '"' ([^<&"] | Reference)* '"'
| "'" ([^<&'] | Reference)* "'"

Re: Notepad Translation Error

2007-11-29 12:03 • by Bob (unregistered)
Who uses an XML parser that only allows "" for attributes these days?

Re: Notepad Translation Error

2007-11-29 12:06 • by Pecos Bill
163436 in reply to 163426
FredSaw:
Dear Vendor,.... taking bids from your three main competitors.


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.

Re: Notepad Translation Error

2007-11-29 12:09 • by Pap
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)
163438 in reply to 163426
FredSaw:
If required we are able to look at why Notepad translates these files with ' and not ", however this investigation will not be able to commence until early next week, although our thoughts are that the way that the file opens in notepad, has only clouded the issues...
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


This is genius!

Re: Notepad Translation Error

2007-11-29 12:11 • by derobert
163439 in reply to 163430
KattMan:
Actually, attribute values should be delimited by double quotes. [The standard] does not say that they should not be delimited by anything else.

No, actually, the standard says exactly what delimits attribute values:

http://www.w3.org/TR/2006/REC-xml-20060816/#NT-AttValue
[10]   	AttValue	   ::=  '"' ([^<&"] | Reference)* '"'

| "'" ([^<&'] | Reference)* "'"

Notice that both single and double quotes are explicitly allowed.

Re: Notepad Translation Error

2007-11-29 12:13 • by AnotherVictim (unregistered)
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.

Re: Notepad Translation Error

2007-11-29 12:14 • by Tei (unregistered)
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.

Re: Notepad Translation Error

2007-11-29 12:18 • by iToad (unregistered)
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.

Re: Notepad Translation Error

2007-11-29 12:18 • by Patrick (unregistered)
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)
163444 in reply to 163430
KattMan:
Please stick with the standard, encode your embedded quotes


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.

KattMan:
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 has been in the spec at least since the 1996 working draft.

KattMan:

Imagine what would happen when IE converts the following wrong implementation: value='He said "Hello" to her.'


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.

Re: Notepad Translation Error

2007-11-29 12:21 • by yartz (unregistered)
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.

Re: Notepad Translation Error

2007-11-29 12:28 • by Jonathan (unregistered)
I always tought the utility of notepad was actually to see text files without any formatting....

Re: Notepad Translation Error

2007-11-29 12:29 • by Anon (unregistered)
The real WTF is that anyone thought this was a WTF

Re: Notepad Translation Error

2007-11-29 12:31 • by Thogek (unregistered)
163449 in reply to 163421
Nelle:
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).
Amazing what outlandish stretches some people will argue when the alternative is simply admitting to a mistake.

Unfortunately, not all that uncommon a phenomenon. :-(

Re: Notepad Translation Error

2007-11-29 12:33 • by Thogek
163451 in reply to 163436
Pecos Bill:
Most of us peons are stuck with a wretched company like this because our "higher-ups" bought the sales pitch.
True enough, all too often...

The XML is valid

2007-11-29 12:35 • by Jez (unregistered)
163452 in reply to 163425
Yes, it does.

Re: Notepad Translation Error

2007-11-29 12:47 • by Grovesy
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)
163455 in reply to 163449
Thogek:
Nelle:
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).
Amazing what outlandish stretches some people will argue when the alternative is simply admitting to a mistake.

Unfortunately, not all that uncommon a phenomenon. :-(


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)
163457 in reply to 163421
Nelle:
I refuse to believe that someone actually believes that notepad does ANY conversion when loading the file (other than maybe char-encoding).


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.

Re: Notepad Translation Error

2007-11-29 12:59 • by Zylon
163458 in reply to 163454
Grovesy:
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


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)
163459 in reply to 163430
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.


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.

Re: Notepad Translation Error

2007-11-29 13:09 • by morry (unregistered)
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.

Re: Notepad Translation Error

2007-11-29 13:13 • by tray (unregistered)
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)
163464 in reply to 163461
morry:
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.


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.)

Re: Notepad Translation Error

2007-11-29 13:16 • by Shinobu (unregistered)
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>

<i value='He said "Hello" to her.' />
<i value="He said 'Hello' to her." />
<i value='He said &quot;Hello&quot; to her.' />
<i value="He said &quot;Hello&quot; to her." />
<i value='He said &apos;Hello&apos; to her.' />
<i value="He said &apos;Hello&apos; to her." />
</l>
You'll see something like:
- <l>

<i value="He said "Hello" to her." />
<i value="He said 'Hello' to her." />
<i value="He said "Hello" to her." />
<i value="He said "Hello" to her." />
<i value="He said 'Hello' to her." />
<i value="He said 'Hello' to her." />
</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
163466 in reply to 163458
Zylon:
Grovesy:
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


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.

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.

Re: Notepad Translation Error

2007-11-29 13:17 • by jwenting
163467 in reply to 163448
Anon:
The real WTF is that anyone thought this was a WTF


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).

Re: Notepad Translation Error

2007-11-29 13:18 • by Ubersoldat (unregistered)
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)
163469 in reply to 163426
FredSaw:
If required we are able to look at why Notepad translates these files with ' and not ", however this investigation will not be able to commence until early next week, although our thoughts are that the way that the file opens in notepad, has only clouded the issues...
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


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
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5Next »

Add Comment