In the XML document, I have something like this (sample only).
<Tag>
MyNetPackage.MyTagClass;<?xml version="1.0" encoding="utf-16"?><MyTagClass xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema"><ID>1234</ID></MyTagClass>
</Tag>
The .NET program serializes the tag of MyTagClass object type into the XML document. Each diagram node in the document has an associated tag. I want to deserialize the tag from the XML document into MyTagClass object so I can extract the data (e.g. ID=1234). I have an equivalent MyTagClass on the Java side. Any suggestion?
Another question: I have the following code.
Diagram diagram = new Diagram();
diagram.addDiagramListener(new DiagramAdapter() {
public void deserializeTag(SerializeTagEvent event) {
Element element = event.getTagElement();
event.setHandled(true);
Log.info("tag=" + element.getTextContent());
}
});
diagram.loadFromXml(myXmlDocFileName);
I see the deserializeTag events raised for all the nodes in the diagram upon loading the XML document, and getTextContent returns the content between the <tag> </tag> above. But all these events are fired one after another without telling me which tag associates with which node. How do I tell which node a particular deserializeTag event was raised for? I need to do additional processing for each node based on the tag data.