• Anonymous (unregistered)

    Who the fuck uses Vista?

    (captcha answer: pirates)

  • Shinobu (unregistered) in reply to bpsm

    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.

  • MATMAN (unregistered) in reply to Sean

    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.

  • (cs) in reply to Bejesus
    Bejesus:
    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

    Dear Clueless People,

    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

  • (cs)

    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.

  • Anon (unregistered) in reply to Shinobu
    Shinobu:
    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.
    That would be because IE isn't trying to show the raw XML, it's showing the XML structure.

    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.

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

    Seems like they're backpedaling to save face, if you ask me.

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

    http://worsethanfailure.com/Articles/Stand_Back,I_0x27_m_Educated!.aspx

    When arguing against reality, it is often required to deny reality itself. ;-)

  • Franz Kafka (unregistered) in reply to AnotherVictim
    AnotherVictim:
    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.

    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.

  • Anm_LA (unregistered)

    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.

  • Aaron (unregistered)

    I think my brain just broke from reading that.

  • mikecd (unregistered) 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 "
    Only reason I can think of would be a library smart enough to change the quote type to avoid entity encoding embedded quotes. This would cost a little more at runtime for the extra pass but would result in slightly smaller XML in some cases.
    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.
    I think it's fine, one of the nice things about XML is that the spec is sufficiently strict and well defined that we can do little bits of normalization like this, knowing that we haven't changed the data in the document.

    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)

  • CGomez (unregistered) in reply to Justin Haygood
    Justin Haygood:
    Gotta love third party vendors who think they know everything, eh?

    Just third party vendors? OMG when I read this WTF I immediately was reminded of people I work with.

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

    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

  • Shinobu (unregistered)

    About the Notepad-does-change-text issue: Here you go.

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

    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.

  • Figs (unregistered) in reply to Nelle

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

  • Brianary (unregistered) 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.

    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.

  • bramster (unregistered) in reply to Cloak

    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

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

    Dear Clueless People,

    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

    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.

    • Rare Vendor Who Honors Specs, and Doesn't Need Your Aggrevation
  • (cs)

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

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

    Yeah, you're smarter than the whole industry. XML, it's totally useless, yesiree. People that use it shure are stoopid.

  • Brianary (unregistered) in reply to Andy Goth
    Andy Goth:
    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!

    Generally true, but not in this case.k

  • Anonymous David (unregistered)

    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

  • bramster (unregistered) in reply to Anon

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

  • SNF (unregistered) in reply to Shinobu
    Shinobu:
    About the Notepad-does-change-text issue: Here you go.

    How does that explain this?

  • Adam (unregistered) in reply to Anon

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

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

    No. ' is fine, unless you're using a crappy half-assed, home-rolled parser.

  • Brianary (unregistered) 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.

    In fact, that's why XML is text, and not binary.

  • Sarni (unregistered)

    Both parties are stupid. One does not argue with examples. One pulls out the standard and cites the relevant standard clause.

  • (cs) in reply to anonymous
    anonymous:
    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.
    Yes, I was only thinking about generating XML, which fortunately is all I've ever had to do (SCORM manifest files... yech). Reading XML is of course much more hairy.
  • Brianary (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.

    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.

  • Jon W (unregistered)

    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.

  • N. K. (unregistered)

    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.

  • (cs) in reply to Brianary
    Brianary:
    Good luck with the chewing gum and bailing wire, I'm sure your app will scale nicely.
    Bailing wire? Is that a money transfer to secure your release until the day of your trial?

    The "real WTF" (or is that 'real WTF'?) is the number of people passing uneducated judgement when all is explained in existing comments.

  • (cs) in reply to SNF
    SNF:
    Shinobu:
    About the Notepad-does-change-text issue: Here you go.

    How does that explain this?

    You obviously didn't read the MSDN article Shinobu linked to. It's quite clear.

  • Tim Lesher (unregistered) in reply to Jonathan

    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.

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

    OK, but is that a big-endian hex dump, or a little-endian hex dump?

  • (cs) in reply to Brianary
    Brianary:
    Just so you know, competence is reading the damn spec.
    Silly me, imagining that competence is making a success of your business.
    Brianary:
    - Rare Vendor Who Honors Specs, and Doesn't Need Your Aggrevation
    Nor a spell checker, apparently.
  • Brianary (unregistered) in reply to bramster
    bramster:
    "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.

    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.

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

    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.

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

    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.

  • 8879Factor (unregistered) in reply to Sean
    Sean:
    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.
    You're lucky. They may have said that the hex editor is converting data. Yeah!
  • Brianary (unregistered) in reply to swordfishBob
    swordfishBob:
    Brianary:
    Good luck with the chewing gum and bailing wire, I'm sure your app will scale nicely.
    Bailing wire? Is that a money transfer to secure your release until the day of your trial?

    The "real WTF" (or is that 'real WTF'?) is the number of people passing uneducated judgement when all is explained in existing comments.

    Unlike your judgement, which is "Educated"!

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

    Yeah, you're smarter than the whole industry. XML, it's totally useless, yesiree. People that use it shure are stoopid.

    What industry would that be? Let's hear it.

    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.

  • Brianary (unregistered) in reply to FredSaw
    FredSaw:
    Brianary:
    Just so you know, competence is reading the damn spec.
    Silly me, imagining that competence is making a success of your business.

    No, that's called "success". Competence is different.

    FredSaw:
    Brianary:
    - Rare Vendor Who Honors Specs, and Doesn't Need Your Aggrevation
    Nor a spell checker, apparently.

    Oops. Got me!

  • Richard C Haven (unregistered) in reply to tray
    tray:
    I totally agree, this kind of "background correction of minor errors" is rahter a bug, not a feature.

    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.

  • blindman (unregistered)

    XML is a virus that needs to be stamped out.

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

    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

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

    Yeah, you're smarter than the whole industry. XML, it's totally useless, yesiree. People that use it shure are stoopid.

    What industry would that be? Let's hear it.

    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.

    http://www.google.com/search?q=microsoft%20bets%20xml So you're the one I keep having to learn new pet formats because of! Not sure how you missed this, but nearly ever major, successful corporation is using XML pretty extensively. Every (living) programming language supports XML, some natively. Here's an exercise: show me how to do the following without XML.

    • ASP.NET config files
    • .NET serialization
    • SOAP
    • RSS/Atom feeds
    • transforms of heirarchical data
    • transferring complex data between systems, some of which you may not control (Bonus points for pointing out successful commercial enterprises or open source projects that have bet against XML.) I don't use XML as a database backend format, nor as a compression format, obviously, but to say that it's useless is just oversimplification and overstatement. Especially if you consider mature libraries to both produce and consume it are not "easy" and are "error prone". Kudos to you if your biggest problems are verbosity and speed in transferring complex data.

Leave a comment on “Notepad Translation Error”

Log In or post as a guest

Replying to comment #:

« Return to Article