| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |
|
Why not replace all ampersands with the the three characters AND ?!
Or would that inhibit their ability to apply SQL queries to the XML string? |
|
You obviously failed to read the article.
|
Re: The XML Escape
2012-01-11 09:06
•
by
Fr3nchie
(unregistered)
|
If they could have done that, they also could have replaced all ampersands with the five characters "&". |
|
We once asked a customer to properly xmlencode special characters when sending over xml. This is what we got:
<customer_name>Brandon & Sons</customer_name> :( |
|
I suppose before they change the &'s to $'s, they should change the $'s to something else... but they cannot change it to USD, so it'll have to be # (most likely), which will probably translate to the pound symbol... hahahaha.
They're fixing the symptom not the root cause... Wait until they get other special characters like "ë" etc... they also sometimes throw off home-grown (and M$, I mean M& developed) XML parsers. But that's a problem for another day I guess... |
|
Sweet. I'm naming my next company <FooCo/> -- I wonder how many XML apps will choke on that.
|
|
This WTF happens all the time at my company, except the trading partners say "We'll get right on it and fix it," but they never do.
|
Home-grown XML generators. Bleg.
2012-01-11 09:24
•
by
anonymous_coder()
(unregistered)
|
|
I've torn out like 10 different ones in our codebase, all written differently. It seems like a rite of passage for crap programmers to try and reimplement an XML parser or generator. Badly.
I actually had to do it because some of the homegrown solutions were bogging down the server... Yay XML::LibXML and Devel::NYTProf::Apache. My boss didn't believe me until I stepped through the profiling results with him. |
|
How about:
* U+FE60 ﹠ small ampersand * U+FF06 & fullwidth ampersand * U+214B ⅋ inverted ampersand |
That's cool. But what about the infinite recursion problem when replacing the leading character in "&" with "&"? Did you think about that? |
|
I hope his company isn't doing any business with Ke$ha's production company.
|
|
What if the content legitimately contains a dollar sign? Wouldn't that be wrongly converted to an ampersand? Bunch of losers..
|
|
CDATA to the rescue!
|
In theory, you can put things like that in an XML file without problems. As long as, in theory, the encoding is right. Anyway, seriously now. I don't understand why they didn't simply use a plus sign. Brandon + Sons sounds much more like Brandon & Sons than Brandon $ Sons. Doesn't it. |
|
because you would never need $ as a real character right....
awful |
Re: The XML Escape
2012-01-11 09:44
•
by
faoileag
(unregistered)
|
You don't like &&&&&&&&&&&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; constructs? CAPTCH: ingenium - a true ingenium way of handling &'s in XML |
Re: The XML Escape
2012-01-11 09:46
•
by
Hexadecima
(unregistered)
|
Hey, I just got off the phone with Micro&oft. |
|
The next time they invoice for maintenance, send them a check payable in &
|
Re: The XML Escape
2012-01-11 09:52
•
by
Andrew
(unregistered)
|
If they could do multi-character replacement, then I choose "WTF". |
|
The only proper way out of this mess is to change the name of the customer.
|
|
Instead of replacing the ampersand, try replacing the vendor.
|
|
They're changing all the longs to strings?!
|
Re: The XML Escape
2012-01-11 10:06
•
by
Laurent
(unregistered)
|
Because the original string might not be in english ? |
Which is fine as long as your data doesn't contain the sequence “]]>”… |
Maybe it's written in C. I seem to recall that multi-character search-and-replace wasn't exactly a straightforward process. As for "absolutely impossible"... maybe for their programmers, it seems... |
Test.java:4: unclosed character literal
|
I'm pretty sure you'd replace the leading character in "&" with " |
Re: The XML Escape
2012-01-11 10:21
•
by
Noread
(unregistered)
|
Why not go all the way and name your company <Foo]]>Co/>. |
You're lack of understanding of English Language syntax surprises me. |
|
Sometimes the solution to the problem is so simple that nobody seems to notice. Why not ask Brandon & Sons to rename their business? I wouldn’t advise ‘Brandon $ Sons’, but ‘Brandon, Bart and Bobbie’ would be just fine.
|
|
>You're
0/10 Try harder. |
|
What if the content legitimately contains a dollar sign? Wouldn't that be wrongly converted to an ampersand? Bunch of losers..
|
|
Infinite recursion of replacing & with &... unclosed character literals...
Code trolls make me cry inside. |
|
Our EDI team did exactly this to us a few years ago. We negotiated XML as an interchange format and in testing we started getting files with unescaped ampersands.
Also, when we sent them data, they choked on all of our data. The hand-built test files had each element on a separate line, and our chose parser didn't add line breaks between elements. We were blamed for "changing the format". I sent them a link to the XML spec and they responded "we can't do all that". To this day, we exchange pseudo-XML with a pre-processor on our end. |
Please attempt some sensitivity: I had a son who was retarded, and let me assure you it is no laughing matter. |
Your right, I forgot the period at the end of my sentence, silly me. Sorry. Sorry, everyone. |
Did he get better? |
|
The real WTF is XML.
The whole 'self-describing' thing is stupid, unnecessary, and nearly impossible to implement, so, avoid the hassle. Write data protocols which match your data, don't squeeze your data into a generic protocol. |
He probably got a job with this vendor. |
Don't worry. He takes after his father. |
FTFY - but I guess that's expected from somebody who includes their CAPTCHA in their post. |
I knew I am not alone! Fnac (http://en.wikipedia.org/wiki/Fnac) does exactly this. Plus you cannot use shorthands like <field/> for an empty field. |
|
One time I work on request to make sure that there are exact number of cariage return marks in an address field.
That was big WTF. I send story to Alex, but it not published yet. |
<Foo]]-->Co;/>'or 1=1;drop table customers And yes, we've all seen the XKCD reference, no need to repeat it. --Joe |
frits, you're high this morning |
Re: The XML Escape
2012-01-11 11:05
•
by
Ken B.
(unregistered)
|
ITYM ]]><![CDATA[. And, of course, Bobby Tables would be the CEO. |
|
Another stupid XML one... HP's iLO technology that allows low-level management of servers (things like remotely power cycling a hung server) has an XML based communications protocol. However, the response to any command is formatted like this:
<RIBCL VERSION="2.22"/> ... stuff ... </RIBCL> So, it's not possible to parse the response with any XML parser. It also occasionally returns multiple complete XML documents, complete with an XML directive for each. Example: <?xml version="1.0"?> ... result 1 ... <?xml version="1.0"?> ... result 2 ... |
Re: The XML Escape
2012-01-11 11:11
•
by
Ken B.
(unregistered)
|
Yes, you're supposed to have the period placed so that it's on your right, not my right. |
Right, because I totally meant that, Captchaman. |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |