XML file & objects

  • Thread starter Thread starter David A. Osborn
  • Start date Start date
D

David A. Osborn

Is there a way to take an xml file that I have created that lays out the
formating for custom objects with their properties and then pull them into
vb.net to use? For example the xml would look like:

<myobjects>
<object>
<name>object1</name>
<property>color</property>
<property>height</property>
<property>width</property>
</object>
<object>
<name>object2</name>
<property>weight</property>
<property>color</property>
</object>
</myobjects>


Then I would like to be able to work with object1 and object2 just like they
a standard vb.net object where I could do object1.color = 'blue' . Is this
possible?


Thanks!
 
David said:
Is there a way to take an xml file that I have created that lays out the
formating for custom objects with their properties and then pull them into
vb.net to use? For example the xml would look like:

<myobjects>
<object>
<name>object1</name>
<property>color</property>
<property>height</property>
<property>width</property>
</object>
<object>
<name>object2</name>
<property>weight</property>
<property>color</property>
</object>
</myobjects>


Then I would like to be able to work with object1 and object2 just like they
a standard vb.net object where I could do object1.color = 'blue' . Is this
possible?

..NET has support with the xsd.exe tool to serialize an object to XML,
based on a W3C XML schemas. You can derive .NET classes from XSD schemas.
See
<http://msdn.microsoft.com/library/d...s/html/cpconXMLSchemaDefinitionToolXsdexe.asp>
 
Back
Top