XML question

Oct 09, 2005 13:33

So, to get the basics out of the way, I hate XML. I'm forced to deal with it for a hack I'm fiddling with right now, though. And having poked this with a stick for the last week, I've finally found the problem: I am sending data formatted as and the client wants , i.e. the order of the contained elements turns out to be important. Now, as far as I ( Read more... )

microsoft, stupidity, geek

Leave a comment

Comments 7

(The comment has been removed)

waider October 9 2005, 15:17:15 UTC
This is pretty much precisely where I bumped into it. I've got XML::Simple parsing the incoming stuff, but I have to either hand-generate the output or use one of the heavier XML modules. And frankly for the quantity of XML being output it doesn't seem worthwhile to use e.g. SAX.

Reply

anonymous October 9 2005, 15:26:11 UTC
A simple way to cope with order dependence would be a very welcome addition to XML::Simple IMHO. I did something using the underlying "real" XML stuff, and it wasn't much fun.

But I'm slouching towards Python anyway. tagsfrom10k was a mostly painless coding experience. Although there are some issues with internationalization that I don't get.

Reply

waider October 9 2005, 15:44:50 UTC
If I cared more about it, perhaps. But I don't, presently. Seems like you could just bolt Tie::IxHash into it and bob's your uncle.

Reply


brad October 9 2005, 18:28:28 UTC
XML Schemas can specify the order they want things, yeah.

Perl people thinking that everything's-a-hash often run into this problem. I remember Whitaker fighting XML::Simple too recently while talking to Wells Fargo.

Reply

waider October 9 2005, 19:14:22 UTC
It had occurred to me that order is certainly a desirable; in this instance, however, I'm calling short-sighted programming because, as I say, there's no ambiguity in processing the contained elements in any order. Of course, that's mainly my view because I'm annoyed it took me so long to figure it out.

Reply


bitpuddle October 9 2005, 22:12:28 UTC
One would think that if order mattered, your clients would have specified it in a schema or some-such mechanism.

Regardless, you may be bumping up against limitations in your processing library. Consider python, as its library is pretty robust.

To answer your other question, I'm routinely astounded at the odd decisions made by developers with which we exchange XML. I often think it would be easier to send the clients code to process the messages we plan to exchange. Here. Use this.

I'd rather process XML than binary files, however. For that, I'm grateful.

Reply

waider October 16 2005, 11:09:43 UTC
One would think that if order mattered, your clients would have specified it in a schema or some-such mechanism.
Well, it's a Microsoft protocol. The fact that there's any public documentation at all is something of a surprise to me. The protocol examples - and, indeed, the on-the-wire traffic - specifies namespace URLs which don't work.

Regardless, you may be bumping up against limitations in your processing library. Consider python, as its library is pretty robust.
Nah. The library is robust. It's that it hasn't got a way of preserving order. There's a more complex library to do that, and really for the amount of XML I'm generating it's easier to hand-code it. And really now. Changing the entire language I'm using (which would, incidentally, require me to learn a whole new language AND a library API) just because of some minor failing in the existing library? Seems a bit overkill...

Reply


Leave a comment

Up