473,387 Members | 1,579 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,387 software developers and data experts.

CSV to XML, now to validate

hiya,
I have a 3rd party function that converts a CSV to an XML doc.
I now need to validate the xmlDoc.I understand that I need a valid XSD for
the newly created xmlDoc, but the xmlDoc contains no schema definitions
etc.I'm not sure how to create an XSD, so that the fields are restricted to
"integer" datatypes etc.

Been looking for a while.I assume that I don't have to manually write an
XSD?maybe I should create a "dummy" table in sqlServer, then generate a
dataset to get the XSD?Or, maybe vis studio 2003 has tools to make this
easier?

Any suggestions appreciated.

cheers,
yogi

--
Message posted via http://www.dotnetmonster.com
Nov 12 '05 #1
4 969
use the tool XSD.exe that comes with Visual Studio to generate an XML Schema
from a XML doc

Gabriel Lozano-Morán

"chris yoker via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:0a******************************@DotNetMonste r.com...
hiya,
I have a 3rd party function that converts a CSV to an XML doc.
I now need to validate the xmlDoc.I understand that I need a valid XSD for
the newly created xmlDoc, but the xmlDoc contains no schema definitions
etc.I'm not sure how to create an XSD, so that the fields are restricted
to
"integer" datatypes etc.

Been looking for a while.I assume that I don't have to manually write an
XSD?maybe I should create a "dummy" table in sqlServer, then generate a
dataset to get the XSD?Or, maybe vis studio 2003 has tools to make this
easier?

Any suggestions appreciated.

cheers,
yogi

--
Message posted via http://www.dotnetmonster.com

Nov 12 '05 #2
cheers Lorenzo,
I have successfully located the xsd.exe
When I click on it, a DOS window opens up for a few seconds then closes.Is
this normal behaviour?I understand that I should probably supply args, but
I thought that it would open in DOS mode and stay open, waiting for input?

Is thare any way that I can:
1) assign this xsd.exe to my run directory, so that I can simply type in
Run --> Xsd.exe?
2) keep the xsd.exe open?

Sorry for the questions, command line stuff isn't my strongpoint ;-)

many thanks,
yogi

--
Message posted via http://www.dotnetmonster.com
Nov 12 '05 #3
You should open a Visual Studio .NET 2003 command prompt and type the
following:

XSD.EXE yourxml.xml /o:c:\outputdir

Gabriel Lozano-Morán

"chris yoker via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:6a******************************@DotNetMonste r.com...
cheers Lorenzo,
I have successfully located the xsd.exe
When I click on it, a DOS window opens up for a few seconds then closes.Is
this normal behaviour?I understand that I should probably supply args, but
I thought that it would open in DOS mode and stay open, waiting for input?

Is thare any way that I can:
1) assign this xsd.exe to my run directory, so that I can simply type in
Run --> Xsd.exe?
2) keep the xsd.exe open?

Sorry for the questions, command line stuff isn't my strongpoint ;-)

many thanks,
yogi

--
Message posted via http://www.dotnetmonster.com

Nov 12 '05 #4
thanks Gabriel.
this now creates them all with a default dataType of "string".I assume that
I now go in and manually change the datatypes (if required) to integer etc?
you've been a great help.

BTW, here's a wee article that I've just found, explaining the motivation +
approaches for xml schemas:
http://www.developerfusion.com/show/2386/1/

cheers,
yogi

--
Message posted via http://www.dotnetmonster.com
Nov 12 '05 #5

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

Similar topics

0
by: SHC | last post by:
Hi all, I have a VC++ .NET 2003 - Windows XP Pro PC. I created a Win32 console application in my VC++ .NET 2003 and copied validateDOM.cpp, books.xml and books.xsd (see the attached files below)...
5
by: Jim Heavey | last post by:
When should you use the Page.Validate() method? I thought you would use this method if you have some Server side validation (CustomControl's) you wanted to use and this would cause them to be...
11
by: jjbutera | last post by:
I know how to use the ErrorProvider in my winforms..or do I? I validate the values and set the ErrorProvider in the validating event. If not valid, I set e.Cancel = True. I clear the ErrorProvider...
0
by: Marc Scheuner | last post by:
Folks, I'm faced with a dilemma here - I have an XML document and for part of it, I have an XSD schema to validate it - but not for the rest of it. Can I still validate at least part of the...
4
by: Brybot | last post by:
I have a form that i've split up into multiple asp:panels, each panel has a number of validators which work correctly. At on the last panel, i want to commit the data collected to a database. I...
24
by: Mike Hofer | last post by:
Please forgive the cross-post to multiple forums. I did it intentionally, but I *think* it was appropriate given the nature of my question. I'm working on an open source code library to help...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.