I've got an XML Schema and an XML instance that is valid to that schema.
This XML instance contains some data.
I'd like to extend the XML instance with further data(my own meta-data per XML element in the XML instance) while keeping it valid to the provided schema.
The real use-case is that I've my own control that gets its data via XML and I'd like to generate a new XML that somehow keeps additional meta-data that is related to the control's serialization.
Couple of my solutions were to keep another document with a list of "XPath,Mode,Color" that I load in the second pass after loading the XML.
Another solution was to add id's to the XML nodes and this way referencing the nodes from another document (instead of using XPath).
And another idea was to somehow add attributes (that are in my namespace per element) to the data XML instance but problem is that I'll probably have trouble validating the XML with the new attributes later when trying to load it back again. (because the attributes I add to the XML are not defined in his schema)
Do you have a better solution for this problem? Which of the solutions you would vote on? (Please explain.)
Thanks!