0

documentType=application/json?

On the flip side of the JSON output thread, it would be cool if Placemaker could extract references from JSON content. It already supports "text/xml" and "application/xml", so "application/json" could be processed with similar semantics.

Similar to many JSON APIs, it would probably make sense for a parameter specifying a JSON callback function to be provided when this documentType is used.

Since there is no standard equivalent of XPath for JSON that I know of, I'm not sure what you'd provide as a path descriptor for each reference, but it would ideally be directly usable as Javascript expression to extract the data item containing the reference.

-md

by
2 Replies
  • QUOTE (Mike Dillon @ May 26 2009, 09:56 PM) <{POST_SNAPBACK}>
    On the flip side of the JSON output thread, it would be cool if Placemaker could extract references from JSON content. It already supports "text/xml" and "application/xml", so "application/json" could be processed with similar semantics.

    Similar to many JSON APIs, it would probably make sense for a parameter specifying a JSON callback function to be provided when this documentType is used.

    Since there is no standard equivalent of XPath for JSON that I know of, I'm not sure what you'd provide as a path descriptor for each reference, but it would ideally be directly usable as Javascript expression to extract the data item containing the reference.

    So you'd like Placemaker to look in all strings anywhere in the JSON for place references? Or were you thinking of some specific geo-markup in JSON format?
    0
  • QUOTE (H Durer @ May 28 2009, 01:57 PM) <{POST_SNAPBACK}>
    So you'd like Placemaker to look in all strings anywhere in the JSON for place references? Or were you thinking of some specific geo-markup in JSON format?


    I didn't look at the details of how application/xml support works, but I'd expect that for JSON it would look at all "values", be they object properties or array items. I would guess that the XML parsing version looks at attribute values and chardata.
    0
This forum is locked.

Recent Posts

in Placemaker Enhancement Requests