When an XML payload - with attributes that don't have values (e.g. are empty) - gets converted into JSON with y.xmlToJson, the attributes end up with a
{} value instead of a
null value. Here's a small example; look at the y.log line:
CODE
use "http://yql.s3.amazonaws.com/ip.xml" as i; select * from i where ip="158.67.15.42"
{"results":{"Response":{"RegionCode":{},"Longitude":"8","CountryCode":"EU","RegionName":{},"CountryName":"Europe","Ip":"158.67.15.42","City":{},"Status":"OK","ZipPostalCode":{},"Gmtoffset":"1.0","Latitude":"47","Dstoffset":"2.0"}}}</log>
On the other hand - when selecting JSON as the YQL output format - the conversion is ok. In my Execute scripts, I only work with JSON and convert it back at the end to XML, so this is a painful bug.