Groups | Blog | Home
all groups > dotnet xml > august 2003 >

dotnet xml : Reading and Iterating through an XSD Schema?


Cy Huckaba
8/21/2003 6:01:11 PM
I have been looking around for a sample on how to read an XSD schema and iterate
through the elements to display them.

I am working in VB.Net and I have looked at all of the docs on msdn and can find
plenty of samples on how to read it in and then write it write back out...with
no manipulation or analysis before writing. I load the XMLSchema object but
can't get into the right collection of objects to get back any valid items.

I was just tyring to do a load a schema that is not terrible complex and list
the names of each of the Elements in a textbox control on a form...I will go for
attributes for each element after that.

Anyone have an article that I can read...any simple samples.

Thanks in advance,

Cy Huckaba
Austin, TX

lukezhan NO[at]SPAM online.microsoft.com
8/22/2003 3:14:17 AM
Hi Austin,

From XMLSchema object's property, we can only get the inforamtion about
namespace and SourceUri. However, XSD file is also a text file in XML
format. I think you can read it as a common XML file with XMLTextReader and
list all elements nodes in the textbox.

Luke

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026?? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026."
AddThis Social Bookmark Button