473,327 Members | 2,112 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,327 software developers and data experts.

Document Class as XML?

Hello!

I have written a few Classes and inheriting Classes in VB and I would like
to export these as XML...

Is there any programs or maybe even features in Visual Studio to produce
this?

The reason is that the classes are to be populated thru XML files (that I
recieve from another company) in runtime and I need to create the XML schema
and give to the the company so they know how to send the information to
me...

best regards
/Lars
Nov 21 '05 #1
1 942
I dunno if i'm on the right track here as I've never used classes to xml.
However, it's data so like any other form of data so I have always defined
my schema, loaded it and fed the structure into a datas et through
ReadXMLSchema & XML Text Reader as follows:

Dim fs As FileStream = New FileStream(fileName, FileMode.Open,
FileAccess.Read)
Dim xtr As XmlTextReader = New XmlTextReader(fs)
dsSettings = New DataSet
Try
dsSettings.ReadXmlSchema(xtr)
Catch ex As XmlException
MessageBox.Show(ex.ToString)
End Try

xtr.Close()

Then... loaded the XML file with data(in your case your class has the data)
with...

If File.Exists(SettingsFileName) Then
Dim fsXML As FileStream = New FileStream(SettingsFileName,
FileMode.Open, FileAccess.ReadWrite)
Dim xtrXML As XmlTextReader = New XmlTextReader(fsXML)
dsSettings.ReadXml(xtrXML)
xtrXML.Close()
Else
Return -1
End If

And used a getData function like:

Private Function GetSettings()

Dim tbl As DataTable = dsSettings.Tables("Settings")
If tbl.Rows.Count > 0 Then
Dim row As DataRow = tbl.Rows(0)
XMLData1 = row("data1")
XMLData2 = row("data2")....etc
Else
Return -1
End If

End Function

hope this helps
Nov 21 '05 #2

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

Similar topics

2
by: Brett Baisley | last post by:
Hello I have a block of html code that I want to run by calling a javascript function to print it. Its basically a table with menu items in it that is the same for many pages, and instead of...
8
by: lawrence | last post by:
I'm a beginner with Javascript and especially cross-browser Javascript. I got this working in IE, but not in Netscape 7. It seems like, in Netscape, every time I click on a button, the focus shifts...
1
by: davo | last post by:
I've been puzzled by this one for ages. I've tried everything I can think of, and now it is time to ask for help. THE APPLICATION A J2EE application which reads an XML file from the /WEB-INF/xml...
3
by: davidkarlsson74 | last post by:
Error: document.getElementById("folderMenu").cells has no properties File: http://www.volkswagen.se/tillbehor/js/foldermenu.js Rad: 49 The function activates different DIV:s, but doesn't seem to...
10
by: Simon Brooke | last post by:
The DOM API has included public Node importNode(Node,boolean) as a method of the Document interface for a long time. Does anything actually implement it? Xerces 2 is giving me: ...
10
omerbutt
by: omerbutt | last post by:
hi there i am working on an inventory rpoject and for that i have made a stock entry form which is pasted below,I have included this form in the main Add Stock page, having the following inputs to be...
10
by: AC | last post by:
I had a page that does some event setup on window.onload: function prepEvents() { document.getElementById("menumap_sales").onmouseover = swapMenuSales; // etc } window.onload = prepEvents;
5
by: ankit1999 | last post by:
I have a problem, everytime i'm run this page http://click2travel.in/index.php i get the this error,,,
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.