[Lazarus] Generic XML question

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Wed Feb 9 11:37:38 CET 2011



On Wed, 9 Feb 2011, Marc Weustink wrote:

> Hi,
> This is not a specific lazarus question, but since here might be xml users, 
> I'll ask it here.
> At my work our software interfaces with a lot of different systems, some of 
> them communicate through a binary protocol and some of them use xml to encode 
> data. YEars ago we coded our own xml parser (creates an object tree of 
> elements found) / generator (generates xml form such tree)
> Anyway each time I have to communicate with xml there are some "issues"
> One system for instance doesn't like spaces before the first element or a 
> linefeed after the closing element. Another system ignores the xml message 
> when it encounters an not yet known element (its hard to implement 
> forward/backward compatibility this way). Yesterday I was working on a new 
> system and that one complained about unparseble xml when I put some 
> whitespace (space, linefeed) between the first opening tag end the second 
> opening tag.
>
> Now I wonder, is xml supposed to be so strict or are this implementation 
> "issues"

I would think these are implementation issues. I have a case where the testsuite 
of a bank accepts an XML message, and the final implementation rejects the same
message. The XML is valid, and according to the namespace rules, the message
'content' should also be valid, but because the test/final implementation
process the XML differently, you get the weirdest results.

XML namespaces are a typical case of over-engineering, where the various XML
implementations differ wildly in their 'interpretation' of the specs.
In Delphi I use TXMLDocument, which in turn uses msxml - a pain by all
standards: the final output depends on the machine I am running my program on.

That's why I am happy that the FPC XML implementation does what it is told,
and does not try to be 'smart' - well, not too much, anyway ;) .

Michael.




More information about the Lazarus mailing list