Hello,
I am trying to find a good solution of how to notify the consumer of the XML that the data (that was being described by the XML) was deleted on the producer side.
Big picture:
producer ---encodeXML--> Network ---decodeXML--> consumer
The XML that I'm sending is not a list of all the data. The XML only contains the changes made to the data. For example, if I update data1's units attribute and add a data15 node, then that's all that is sent to the consumer is:
<consumer>
<data1 units="ms" />
<data15 units="s" V="50" />
</consumer>
This works fine for adding or updated data. However, the problem I have is how do I represent deletion of data in XML? For example if source deletes "data7"
My first thought was to have an attribute called "deleted" that I would set to true when I delete a node <consumer> <data7 deleted="true" /> </consumer>
This works except sometimes attributes represent data, and how would you specify that the attribute was deleted and not the element. Any thoughts?
If there isn't a good answer, maybe the option is to make sure that attributes (or what they represent) cannot be deleted.
Thanks for the help,
-Nate
I am trying to find a good solution of how to notify the consumer of the XML that the data (that was being described by the XML) was deleted on the producer side.
Big picture:
producer ---encodeXML--> Network ---decodeXML--> consumer
The XML that I'm sending is not a list of all the data. The XML only contains the changes made to the data. For example, if I update data1's units attribute and add a data15 node, then that's all that is sent to the consumer is:
<consumer>
<data1 units="ms" />
<data15 units="s" V="50" />
</consumer>
This works fine for adding or updated data. However, the problem I have is how do I represent deletion of data in XML? For example if source deletes "data7"
My first thought was to have an attribute called "deleted" that I would set to true when I delete a node <consumer> <data7 deleted="true" /> </consumer>
This works except sometimes attributes represent data, and how would you specify that the attribute was deleted and not the element. Any thoughts?
If there isn't a good answer, maybe the option is to make sure that attributes (or what they represent) cannot be deleted.
Thanks for the help,
-Nate