473,408 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

XML file & objects

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!

Mar 19 '06 #1
2 1095


David A. Osborn wrote:
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/default.asp?url=/library/en-us/cptools/html/cpconXMLSchemaDefinitionToolXsdexe.asp>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 19 '06 #2
Would this require me to regenerate the schema everytime I add a new object?
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...


David A. Osborn wrote:
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/default.asp?url=/library/en-us/cptools/html/cpconXMLSchemaDefinitionToolXsdexe.asp>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Mar 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # to open a file and write to file # do f=open('xfile.txt','w') # this creates a file "object" and name it f. # the second argument of open can be
3
by: Peter | last post by:
Hello, Two newbie questions: 1) I have a javascript file with a function in it. From this function I want to access a variable in another javascript file -which is not inside a function. I...
4
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3...
3
by: lkrubner | last post by:
I'm getting this error: <b>Warning</b>:...
7
by: GrandpaB | last post by:
While writing this plea for help, I think I solved my dilemma, but I don't know why the statement that solved the problem is necessary. The inspiration for the statement came from an undocumented...
1
by: Martin Widmer | last post by:
Hi guys I am wondering what is a proper way to persistently store objects into SQL-Server. I see four possible ways: 1.) Serialize to XML and then store the XML in the SQL server 2.) Write a...
0
by: fragmonster | last post by:
Hi, I need to manipulate XML files with PHP. So i need to extract and insert nodes in my files. For the extraction : no problem with XPath, it works fine. But, for inserting new nodes, it's...
1
by: mjobbe | last post by:
I have an installer that requires three merge modules (ATL, CRT, and MFC), and after adding them in, I get the following warnings when I build the MSI: WARNING: Two or more objects have the same...
42
by: coder_lol | last post by:
Thanks everyone again for contributing to helping me clear C++ confusions. I did some serious reading on copy constructors and assignments and I think I've got a good handle on the memory stuff. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.