Handling invalid XML recommendation method

I am trying to use Delphi XE2 to integrate the program with a third-party service. The problem I encountered is that the service did not forward any values ​​in the XML document they sent me.

This is one of their “example” xml documents



1
A New Plan
January 16 & 17, 2010< br /> A New Plan For Your Family

...

My initial plan was to wrap all the data in CDATA tags, but this does not seem to be an ideal solution.

I also considered looking for the & character and replacing it with & amp; but it did not escape any users Input, including and searching and replacing each invalid xml character sounds like a bad idea.

Any suggestions on how to deal with invalid xml documents?

First refuse to call these documents “XML”-they are not XML.

Convince your supplier that many people have adopted XML and benefited from it. If they do the same, it would be a good idea.

If your supplier thinks they give you Send the XML, please make it correct. Almost XML does not help. It is like sending Java code that cannot be compiled.

I am trying to use Delphi XE2 to compare the program with the Three-way service integration. The problem I encountered was that the service did not forward any values ​​in the XML documents they sent to me.

This is one of their “sample” xml documents



1
A New Plan
January 16 & 17, 2010
A New Plan For Your Family< br />

...

My initial plan was to wrap all data in CDATA tags, but this does not seem to be an ideal The solution.

I also considered looking for & characters and replacing it with & amp; but it did not escape any user input, including and searching and replacing every invalid xml character sounds like the same A bad idea.

Any suggestions on how to deal with invalid xml documents?

First refuse to call these documents “XML”-they are not XML.

Convince your supplier, many People have adopted XML and benefited from it, and it would be a good idea if they did the same.

If your supplier thinks they send you XML, please correct it. It is almost XML and No help. It’s like sending Java code that cannot be compiled.

Leave a Comment

Your email address will not be published.