Delphi XML Bindings objects - exporting nodes

ShenUnlanny

New Member
I have the following scenario: using XML Data Bindings, I have an object created from schema A, and a different object created using schema B. However, schema B imports schema A in order to define children nodes of the A type.So, right now I have:
  • unit1, \[code\]objectA\[/code\] (from schema A)
  • unit2, \[code\]objectB\[/code\] (from schema B), \[code\]objectA\[/code\] (from schema B which imports schema A)
The \[code\]unit2.objectA\[/code\] class is, of course, incompatible with \[code\]unit1.objectA\[/code\]. The definition in unit2 is also different, because it doesn't include some namespace attributes (this is important: I think these are implicit because the parent node also have them.)And this is my problem: I can do lots of stuff given that these are just \[code\]IXMLDocument\[/code\] objects, but I want to be able to create \[code\]unit1.objectA\[/code\] from \[code\]unit2.objectA\[/code\].My initial thought was that one should be able to export nodes from a document, and that there should be an option to make this exported node "kosher" according to the correct schema (so, a node of type A inside a document B should export and validate against the schema A.) I understand that this may be wishing too much, so my question may be rephrased:How can I export a node from a \[code\]IXMLDocument\[/code\] object into a new \[code\]IXMLDocument\[/code\] object, while adding/overriding namespace attributes (\[code\]xmlns\[/code\], \[code\]xmlns:xsi\[/code\], \[code\]xsi:schemaLocation\[/code\]) in the exported node / document?
 
Back
Top