Hello,

reading RFC7952 sections 5.2.2-5.2.4, it would seem that metadata object
(5.2.2) can occur at any position in a JSON object, as well as metadata
attachments to leaf/leaf-list/anyxml (5.2.3, 5.2.4) can occur any
distance (before or after) from the data element they attach to.

The examples list the metadata object as the first item, and attachments
immediately after the data element, but I could find no text which would
make this required or recommended for document producers.

While this is completely workable when the parsing state is received
into a mutable structure, it requires full parser event buffering in
streaming setups.

One example would be JSON->XML transformation using token streaming
interfaces (like GSON's JsonReader and
javax.xml.stream.XMLStreamWriter): since metadata can occur at any place
in JSON, but is required to be emitted just after opening XML element,
we must completely parse the JSON document before we can start emitting
the XML document.

Is this intentional or just an omission?

Thanks,
Robert

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to