• Justin Haygood (unregistered)

    Gotta love third party vendors who think they know everything, eh?

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

  • Paddington Bear (unregistered)

    {Sound of forehead hitting desk}

  • 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!

  • atari (unregistered)

    The wtf is that they're using notepad on vista, right?

  • NerfHerder (unregistered)

    {Sound of a second forehead hitting desk}

  • Nacho (unregistered)

    The WTF is that they wrote "away" instead of "a way".

  • (cs)

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

  • (cs)

    Follow up by posting screenshots of the XML file opened in WordPad, Word, TextPad, and a hex viewer.

  • Venda Killa (unregistered)

    {Sound of the vendor's head hitting my desk}

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

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

  • (cs)

    OK, correct me if I'm wrong, but doesn't XML allow both single and double quotes to be used for attribute values?

  • (cs)
    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

  • (cs) in reply to Nelle
    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.

  • (cs)

    "XMLSpy and IE both correct minor errors". Maybe this should have given Rick a clue as to how to proceed.

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

  • (cs) in reply to ender
    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.

  • (cs) in reply to gabba
    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.
  • (cs) in reply to KattMan
    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.
    
  • Drake (unregistered) in reply to KattMan

    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)* "'"
  • Angstrom (unregistered) in reply to KattMan

    http://www.w3.org/TR/REC-xml/

    [41] Attribute ::= Name Eq AttValue

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

  • Bob (unregistered)

    Who uses an XML parser that only allows "" for attributes these days?

  • (cs) in reply to FredSaw
    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.

  • (cs)

    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

  • Alin (unregistered) in reply to FredSaw
    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!

  • (cs) in reply to KattMan
    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.

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

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

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

  • Patrick (unregistered)

    To sum up this dialogue: Rick: "Hey Terry, my dick's bigger." Terry: "No, mine is." Rick: "No, mine is."

  • AdT (unregistered) in reply to KattMan
    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.

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

  • Jonathan (unregistered)

    I always tought the utility of notepad was actually to see text files without any formatting....

  • Anon (unregistered)

    The real WTF is that anyone thought this was a WTF

  • Thogek (unregistered) in reply to Nelle
    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. :-(

  • (cs) in reply to Pecos Bill
    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...
  • Jez (unregistered) in reply to ender

    Yes, it does.

  • (cs)

    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

  • Ben4jammin (unregistered) in reply to Thogek
    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.

  • Cloak (unregistered) in reply to Nelle
    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.

  • (cs) in reply to Grovesy
    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.

  • bpsm (unregistered) in reply to KattMan
    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.

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

  • tray (unregistered)

    I totally agree, this kind of "background correction of minor errors" is rahter a bug, not a feature.

  • krupa (unregistered) in reply to morry
    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.)

  • 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>
    
    
    
    
    
    
    </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." />
    
    
    </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.

  • (cs) in reply to Zylon
    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.

  • (cs) in reply to Anon
    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).

  • 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!

  • Bejesus (unregistered) in reply to FredSaw
    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

Leave a comment on “Notepad Translation Error”

Log In or post as a guest

Replying to comment #:

« Return to Article