Read XML using XSD

Somebody gave me an XSD file to read a XML file. Can somebody give me an idea 
how to use this XSD file in C# to start reading XML files?

Thanks, Ben
0
BenvanErp (1)
3/6/2007 5:10:05 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
603 Views

Similar Articles

[PageSpeed] 21

Ben van Erp wrote:
> Somebody gave me an XSD file to read a XML file. Can somebody give me an idea 
> how to use this XSD file in C# to start reading XML files?

You can validate an XML document against an XSD schema. With .NET 2.0 
use an XmlReader with the proper XmlReaderSettings. With .NET 1.x use an 
XmlValidatingReader.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1777)
3/6/2007 6:33:45 PM
There are various ways. One way is to use a dataset to read the schema, and 
then the xml. You can use the ReadXMLSchema and ReadXML functions of a 
dataset for this.

Another way is to create a set of typed classes out of your xsd - using xsd 
tool or xsdobjectgen tool - and deserialize your xml file directly to the 
object model.

-- 
Thanks a lot

-----------------------------------------------------------------------

Anoop Madhusudanan,
Solution Architect,
Application Development,
Sumeru Software Solutions Pvt Ltd

http://www.sumeru.com
Ph: (91)9886976328
-----------------------------------------------------------------------

visit me: http://amazedsaint.blogspot.com

= = =

"Action without doership is meditation"
"Ben van Erp" <BenvanErp@discussions.microsoft.com> wrote in message 
news:DED2B302-DD6F-45D2-BC71-800221C0E6B4@microsoft.com...
> Somebody gave me an XSD file to read a XML file. Can somebody give me an 
> idea
> how to use this XSD file in C# to start reading XML files?
>
> Thanks, Ben 


0
3/7/2007 6:02:21 AM
Reply:

Similar Artilces:

"there has been an error reading or writing the file"
I have been having numerous problems lately with my Mny delux 2005. 1. portfolio does not show correct "Market Value" of most securities most of the time, 2. Lines listing securities on portfolio manager are duplicated and change upon being floated over by the mouse curser and 3. the program blows out after displaying the error message, "there has been an error reading or writing the file" after folowing the intructions at: http://help.msn.com/(ZmlsdGVyPUNEX0RMWCZwcm9qZWN0PW1vbmV5MDUmbWFya2V0PWVuLVVTJmN1PSZ0bXQ9dG1wOUYudG1wIC0gTWljcm9zb2Z0IE1vbmV5JmtjPSZmb3JtYXQ9)/help...

How do i sort contacts using more than one catagory ?
I am trying to create lists which have contacts sorted by more than one catagory. So including contacts that are linked to two or more specific catagories. Can this be done, if so how? thanks "samong" <samong@discussions.microsoft.com> wrote in message news:01E99022-AB21-487B-9365-2E66BB0C3F1B@microsoft.com... >I am trying to create lists which have contacts sorted by more than one > catagory. So including contacts that are linked to two or more specific > catagories. Can this be done, if so how? The Category field is non-sortable because it is a multi...

population pyramids using bar charts with a secondary axis
I have a problem that I had given up as unsolvable, but after recently learning about secondary axes, I've made encouraging progress. However, I'm stuck on the last step(s), and I'm hoping that someone will have some suggestions. My organization has been producing reports that contain population pyramids. In the past, all of their reports have been printed, so it didn't matter that in order to get the desired look, they had to use two charts slightly overlapping each other. However, we are getting to the point where we would like our charts to be available online for download....

Using OLE DB in MFC Project
Hi, I have developed an MFC application. I now want to add database functionality to it. I have had a look at the various database technologies and have decided to try using direct OLE DB rather than ADO as it is faster. However I have noticed that in tutorials it is recommended to use the wizards in an ATL project. As i have said before my application has been written in MFC. I was wondering how easy it is to add direct OLE DB to my MFC application. I would appreciate suggesstions on how i can manage this, Thanks In Advance Macca ...

an interesting read
FYI, an article on errors caused by Excel's automatic formatting wit indirect links to work-arounds which might be useful. http://www.theregister.co.uk/2004/07/16/excel_vanishing_dna/ Harlan, Thanks for posting that. It was interesting. Also, we now an addition to the jargon: "Symbol Mutation error" Regards, Jim Cone San Francisco, CA "Harlan Grove" <hrlngrv@aol.com> wrote in message news:d2c023b0.0407161303.5e5013df@posting.google.com... > FYI, an article on errors caused by Excel's automatic formatting wit > indirect links to work-arounds which ...

Custom Reports Using MS Access?
Ran across a thread where Glen Adams suggested using MS Access to create custom reports instead of Crystal Reports. But Glenn never said where to point Access to obtain the needed information to create the reports. Glenn, if you are watching can you give us some more info on how to use Access to create a report? I'm not Glen... I think you would use ODBC... to connect to the RMS database. Then use Access to connect via ODBC... Marc Wagner www.gmroii.net "Dan" <anonymous@discussions.microsoft.com> wrote in message news:0df801c46ea7$d79b00b0$a601280a@phx.gbl... &g...

Word 2008
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have created several files in Word 2008 using templates (.dot) files previously used with Word 2003/2007. Unfortunately, my customer keeps receiving an error when opening the new file I create. The new file (created in .doc format) has some hidden data that is pointing to the template folder on my Mac. The error looks like: Could not open: 'user:Libarary:Application Support:Microsoft:Offce:User Templates:template.dot My customer can fix this error by using the remove hidden data tool inside Office 2003, but that&...

How can I change the program used when following a hyperlink
I have a database which uses hyperlinks to take me to a set of image files, gif & jpeg. I have recently moved to Firefox. If I click on a link to a gif file it opens in Firefox, but if I do the same for a jpg it persists in using IE. The file association for jpg files on the computer are to Photoshop. But I prefer opening the links in the browser as I am only viewing, not editing, the files Anyone got any ideas JimR Use a button that when clicked calls this code (pass in the value on the hyperlink field): Public Sub OpenWebPage(url As String) Dim browser As Vari...

Excel opens as read only from IE
I'm not sure whether this problem is Excel related or IE related. Whenever we launch an Excel file, whether it be from the company intranet or even from a web-based email, it opens as a read only. Can anyone shed any light on how to alter this? -- Regards, Darren ...

counting using multiple criteria
Hi, I have a problem for which I can't seem to find a working solution. On the one hand I have a vertical table with employee names, the number of years they have been with the company, and all this sorted by the employee's age (in years). This table will be updated from time to time, and as such it doesn't have a fixed length. On the other hand I have a table which shows the number of employees in a particular age category (-20, 21-25, 26-30, etc) horizontally, and the number of years they have been with the company (again in groups: 0-5 yrs, 5-10 yrs, etc) vertically. ...

scripting adding obj-users and mdb-use-defaults to exchange 5.5 users
I have successfully created a script for creating exchange 5.5 users. I can't however, figure out how to add the assoc-nt-account to the obj-users [pseudo attribute] or set MDB-Use-Defaults to True :-( Can anyone offer advice on how to do this [other than generate a CSV file and use the exchange admin tool to import it]? Thanks Wayne ...

keeping footer from resizing when using the fit to page function
How do I keep the footer from shrinking in excel when i use the "fit to page" option for my worksheets. I'd like it to stay the same size no matter what the font of the worksheet is. ...

Database using Access 2.0
Our church purchased Church Windows software. When we asked if we could import our members from our existing database Greentree CDMS they said we couldn't because CW is an Access 2.0 database and we don't have that software. What would be the benefit of still using Access 2.0 for software development? Thanks, Linda Hi Linda I doubt there are many new programs being written in Access 2. It was a great piece of software, and many databases were writing using it. I don't know Church Windows, but I am guessing that it was written back in the Access 2 days (around 1994), ...

XML by J#
Can J# compiler generate XML file as C# compiler does. Thanks Raza wrote: > Can J# compiler generate XML file as C# compiler does. Sure, although I have no idea what do you mean saying "generate XML". -- Oleg Tkachenko [XML MVP] http://blog.tkachenko.com "Raza" <anonymous@discussions.microsoft.com> wrote in message news:072b01c4a07c$13e96bf0$a401280a@phx.gbl... > Can J# compiler generate XML file as C# compiler does. Raza, The J# compiler doesn't provide a command-line option like /doc on the C# compiler (that generates XML documentation for .cs sou...

Use Datedif but for future dates
I have a formula for identifying years, months, days from a past date to now. DATEDIF(C6,NOW(),"y")&" Y, "& DATEDIF(C6,NOW(),"ym")& " M, " & DATEDIF(C6,NOW(),"md") & " D" I'd like a formula that can produce the same format (years, months, days) between now and a future date. Any ideas? Thanks in advance, Bart Hi Bart Try this with the date in A2 =IF(TODAY()<=A2,DATEDIF(TODAY(),A2,"Y") & " y " & DATEDIF(TODAY(),A2,"ym") & " m","-"&...

Reading mail in Outlook Express
Hi, Whenever I open outlook express I have no problem downloading the messages, but when I try to read them either in the preview panel or opening them in a new window nothing shows up. There is just a blank space almost like they didn't send a message. When I put my mouse pointer over the message, the icon that tells me the computer is working shows up. Thanks for any help Kyle Hi, Kyle.... This is a group to support Outlook from the Office group of programs. Outlook Express is a part of Internet Explorer and is a quite different program, despite its similar name.. You will proba...

Creating opportunity using CRM api
Looking for an example of how to load the crm api to create an opportunity using C#. I'm way new to this and have downloaded the CRM 3.0 sdk but not sure how I access the information it contains. What I'm hoping to find is an example of creating an opportunity with just the necessary information so I can build on it from there. I appreciate any help! Hi Jeffa When you install the SDk you will notice there is a help file in the installed directory of the SDK, I think it is crmsdk3_0.chm Open the helpfile and search for create, there are lots of examples let me know if you get s...

Printout Method
In building a form to allow users to print a "blank form" I've constructed as an Access Report, I'd like the user to be able to select the number of copies to print. It looks like the PrintOut Method would be a good choice for this, but I'm not smart enough to know quite how to get the "Copies" argument to get its input from the textbox on my form, where the user will enter the number of copies they'd like to print. Suggestions? -- Thanks, Croy Does the report have a record source? -- Duane Hookom Microsoft Access MVP If I have helped you, please help...

Read-only files
I want to email an MS Publisher 03 file. It is read-only protected, but it can still be accessed and changes made, although it has to be saved with another file name. Is it possible to make it unaccessible - so that no changes can be made at all? no. and it doesn't even have to be saved with a different name, all you have to do is change the file attributes. "secretariat" <secretariat@discussions.microsoft.com> wrote in message news:0CFB98E4-29E7-4AC6-BBB4-177EE7F5C982@microsoft.com... |I want to email an MS Publisher 03 file. It is read-only protected, but it |...

Using Regular expressions in Excell 2007
I have code written in excell 2003 where I use Regular Expressions 'heavily'. In Excell 2003 you had to import the RegExp library to be able to use it. Is Regular Expressions part of VBA in Excell 2007? or do you still need to import the RegExp library? Same as in Excel 2003, the library is part of IE not Excel or VBA. -- HTH Bob "ncunha" <ncunha@discussions.microsoft.com> wrote in message news:7EF31D63-6C38-451B-9CEF-2E091DA7B2E7@microsoft.com... >I have code written in excell 2003 where I use Regular Expressions > 'heavily'...

how to use "barcode" in excel 2000??
Dear all, i would like to set up an inventory system for recording the stuff. previously, i have a long table of data in excel. i need to do some tasks: 1)print the barcode out for each item 2)scan the barcode for checking the inventory. i have no idea how to start, install barcode fonts? what i have to buy and do i need to write "MARCOS"? Please help me! manymany thanks. gg It depends on how you intend printing the labels. If you're wanting simple all in one solution, 'Bizfonts' (http://www.bizfonts.com/) ca help. Another way is to use a 'bar code module (ht...

Use of user's group with W2000
Two things: 1-If no MVP can answer a question, someone should tell the questioner so he/she can move on. Frustration is high enough without being ignored. 2-It is grossly unfair that I can't post questions because I have W2000 and am limited to Explorer6. I can't even get to this page. Microsoft should not squeeze us out of the loop. (I borrowed a friend's computer with XP and explorer7 to write this and to post my unaswered question.) ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for th...

Use specific printer for reports in view mode
I designed a report using printer HP5000 PLC6 and the paper size is A3 in landscape. When I open the report in my laptop and I want to show the report in my resentation, it can not showed all contents of the reort, just a hals is shown, my question is how can we assign this printer to this reprot when I open it, although I do not need to print it, this is just for my resentation. My printer default in mypc is lHP desckjet 690c -- H. Frank Situmorang Might try installing the printer driver for the HP5000 PLC6. Might try suing the printer "Microsoft Office Document Image Writer&qu...

How do I create an A3 size document using Windows 7
A3 is not listed in the pre-set schedule of document sizes in Windows 7 (unlike previous versions of Windows). How do I create such a document using Windows 7? Does your printer support A3? Word/Windows will display the paper sizes supported by the default (or currently active) printer. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "A3 documents in Windows 7" <A3 documents in Windows 7@discussions.microsoft.com> wrote in message news:F2647F06-5560-41A6-9C2F-462E6198C989@microsoft.com... > A3 is ...

Will pay for need help and occasional advise on using excel ....
"sorry if this is off post ...will be my last" Thx in advance for your help and interest. i am an independant oil and gas consultant and have a fair amount of computer experience but, am absolutely lost when it comes to data bases .... i found a database online (in .php format) that contains names, addresses, phone numbers, fax numbers and email addresses of companies and people within the oil and gas industry ... i want to be able to utilize this db in excel so i can sort certain companies or people and use excels "mail merge" system to send them emails. ...