473,327 Members | 1,919 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.

How is this done?

I am planning on writing an application, where, before the user can do
anything, he/she must open up a file...

.... it would be an XML file, which contains all the data that he/she
needs in order to work w/ the program.

The XML file has a corresponding .XSD (schema).

So there are really 2 files.

Here's the question: I would like the XML and XSD to be a SINGLE file.
So the user would start by going to File > Open, and selecting that
single file. I don't want the user to have to open up an XML and also
an XSD... too complicated, and it's not standard to the way most
programs work.

I also want it to be a single file, so it is easily portable from
computer to computer. (Like an MS word .doc is a single file that can
be opened anywhere MS Word is installed)

How is this done? Should all the data be combined in a single file, and
then when it's opened, it's parsed out: one part parsed out and saved
as an XML file, and the other parsed and saved as an XSD.

Can anyone give suggestions?

Thanks!
John

Nov 21 '05 #1
6 1004
John,

If I did understand you than is the answer for me

Use a dataset. That is extremely handy for what you want to do.

Cor
Nov 21 '05 #2
Why not have them open the XML file and then the program opens the XSD file
automatically (assuming they are named the same)

"johnb41" <or****@informatik.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I am planning on writing an application, where, before the user can do
anything, he/she must open up a file...

... it would be an XML file, which contains all the data that he/she
needs in order to work w/ the program.

The XML file has a corresponding .XSD (schema).

So there are really 2 files.

Here's the question: I would like the XML and XSD to be a SINGLE file.
So the user would start by going to File > Open, and selecting that
single file. I don't want the user to have to open up an XML and also
an XSD... too complicated, and it's not standard to the way most
programs work.

I also want it to be a single file, so it is easily portable from
computer to computer. (Like an MS word .doc is a single file that can
be opened anywhere MS Word is installed)

How is this done? Should all the data be combined in a single file, and
then when it's opened, it's parsed out: one part parsed out and saved
as an XML file, and the other parsed and saved as an XSD.

Can anyone give suggestions?

Thanks!
John

Nov 21 '05 #3
A dataset isn't actually a "file" that the user can open, is it? To
get info into a dataset, you have to either get it from a datasource
(database, or xml), or create a dataset from scratch. The user needs
to open data that already exists, so creating it from scratch is not an
option.

If a dataset can be opened as a standalone file, then please show me
how! :)

John

Nov 21 '05 #4
Terry,

Thanks for helping! The problem is that there are still 2 files. If
the XML file gets moved to a different computer, then the XSD will
probably get forgotten. To the end-user, it would not be obvious that
there are always 2 files that must be used.

John

Nov 21 '05 #5
John,

It is so easy I type it in this message so watch typos

\\\
Dim ds as new dataset
dim dt as new datatable
dt.columns.add("john")
dt.rows.add(dt.newrow)
dt.rows(0)(0) = "Hello John"
ds.tables.add(dt)
ds.writexml("C:\mydataset")
///

(reading is ds.readxml(":\mydatasert")

Is that difficult, I did not think so.

I hope this helps,

Cor
Nov 21 '05 #6
My current application actually is very similar to this. But instead
of creating a dataset from scratch, my dataset is created from a
ds.readxml. I then add rows, del rows, edit rows, etc. and then
ds.writexml it back to the same xml file.

Anyway, after seeing your code, I thought it still would not work
because I also need an xml schema (xsd), and that is a separate file.

But after playing around, i realized that when doing ds.writexml, there
is a constructor that actually adds a schema into the xml file. So the
result is a single file.

So as it stands, I think this will work for me, and not much XML
expertise is needed. Phew!

Thanks for your help!

John

Nov 21 '05 #7

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

Similar topics

6
by: Sugapablo | last post by:
I had an idea for something that I can't find any evidence if it exists, or if it can be done. I assume it can be done. What I'd like to be able to do, is to allow people who come to my website,...
9
by: Steven T. Hatton | last post by:
This was written for the gnu.g++.help list. It rather clearly spells out the most important feature of Java that I believe C++ lacks. I really don't believe the C++ Standard sepcifies enough for a...
11
by: Sharon | last post by:
I'm writing a new control derived from UserControl. I need to get an event when the control is done resizing. I tried the Resize, SizeChanged, Move and the Layout events and I also tried to...
59
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at...
17
by: blackswift | last post by:
code is from Warsaw university's CEPC code . They are world champion in the ICPC finals. #include <iostream> #include <cstdio> #include <algorithm> using namespace std; #define FOR(i,a,b)...
12
by: Ark | last post by:
Hello NG, I arrange data in structs like { members... uint16_t crc; more members, maybe... } Then I need to save them, up to and including crc, in non-volatile memory or a file, as the case...
15
by: Chris | last post by:
This is just some dummy code to mimic what's being done in the real code. The actual code is python which is used as a scripting language in a third party app. The data structure returned by the...
3
dfound
by: dfound | last post by:
#include<windows.h> #include<dos.h> #include<dir.h> #include<fstream.h> #include<stdio.h> #include<process.h> #include"resource.h" //resource header file
2
by: poolboi | last post by:
hey guys, i've done most of my web app. for searching almost done but then i got a small little problem with logging in i need to know how session tracking is done in perl if not my log in page...
2
by: Zerge | last post by:
I can launch threads just fine, but then I have to do a time.sleep(n) so the main thread from which they where launched will wait for all the threads to return. How can I detect when all threads...
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...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.