Hi Imtiaz, This looks excellent. With the exception of the entity encoding (I'll comment inline below on that) this looks perfect.
On Sat, Jul 24, 2010 at 7:21 PM, Imtiaz Ahmed H E <[email protected]> wrote: > > 1. I thought, maybe, since both the addMsg and getNewMsgs API2 calls return > an XML response, the 'innards' of that xml should be entity encoded. That's > what happens naturally in Scala's xml handling and I have left it as such. > *Please confirm that we need to decode that.* I mean, ver generally > speaking, the metadata, though outputted as XML, can be in any format, JSON > included, and we 'don't know' about it. I mean the user could have his own > convention, or maybe we can enforce it, of enclosing the entire metadata > string in a specifically named tag, such as <json> to describe its format, > which the user then needs to entity-decode, before interpreting it. I could > be wrong here... I think if the user sends non-entity-encoded strings to the API for the metadata, then we need to return the same string. We're returning UTF-8 XML here, not HTML, so my thought was that no one would be expected entity-encoded output. If we return JSON or other formats in the future (and I do plan to do that), then we'll have to encode however necessary for that format. Maybe I'm fundamentally misunderstanding how this output is supposed to be encoded. Encoding is definitely not my area of expertise. If I'm not misunderstanding, then yes, I think we need to decode the entity-encoding so that we see " < and > in the output. I'm not sure if it is currently getting encoded because of something we do or because of Scala's XML handling. > 2. The extra <metadata></metadata> tag doesn't append anymore. Great! Was my code in the API adding that? I suspect so. Sorry :( > 3. There was another problem, if you will look again at the curl output text > file I attached with my patch attached previously to the Jira ticket, > metadata input of JSON alone without surounding xml tags was 'lost'. The > output showed empty metadata. This is fixed, but as I said, the JSON, since > it is enclosed in a <metadata></metadata> tag is entity-encoded. Yes! I had noticed this too but I forgot to mention it! Thank you for picking up on it and fixing it. Your example now looks like what I would have expected. > Let me know....and I will submit a patch to the metadata branch > appropriately. Please do. I or someone else will review and apply it when you notify the list. Thanks, Ethan
