Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
685 views
in Technique[技术] by (71.8m points)

c# - Error tolerant XML reader

Does anyone have/make/sell an error tolerant XML reader for .NET?

Yeah, I know, XML isn't designed to have errors in it and should be rejected if it's not valid .. blah blah. But sadly the real-world is imperfect and developers do make mistakes and I still want to be able to read their feeds even if I'm missing the odd element here or there because it wasn't encoded properly or had some other error in it. So please, no answers "fix the source" or "reject it".

So, does anyone have a component that can recover and handle common mistakes in XML files?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It's precisely because the real world is imperfect that XML is so widely used. What would be the functional specification for an error-tolerant XML parser? It's an open-ended problem. It's hard enough to parse all variations of well-formed XML without trying to second-guess all possible errors.

[... Waits for downvote.]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...