Bill Roper (billroper) wrote,
Bill Roper
billroper

XML Hell Redux

I have been frantically coding this week to try to fix a problem with formula translation as we move from the old account numbering regime to an account naming regime, because a function that I had hacked together that depended on the specific format of the old account numbers no longer worked. I had been trying to produce a solution that would require reverse parsing the byte stream that results from parsing the formula text, but that became increasingly unwieldy -- actually, it was more just a matter of it was a lot of work -- so I set that aside and went to a simpler solution using the parser with a flag setting that told it to correct the formula text on the fly so I could store the fixed version.

I think that works, but something went wrong when I tried to test it. So I pulled up the trusty audit dialog in the Excel add-in version of our product to see what the formula was in the debugger.

It immediately failed.

What the--?

A bit of debugging later, I discovered that this time they had remembered to encode the string with the quotation marks on the way in, but not to decode it on the way out from the XML format.

To quote the late Casey Stengel, "Can't anybody here play this game?"

I have now coded the XML retrieval to use one of my utility functions that automatically decodes the string output. I had to write a new version of the function, because the one that I had used boost::shared_ptr, while the function I was working with had used std::auto_ptr, but that was a quick substitution.

I don't really care which one we use, but it would be nice if we made up our minds...

Now to see if this damned thing works...
Tags: computers, musings, work, xml
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments