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

read xml schema

hello,
ive got an xml schema wich is placed inside of an xml file
it is placed as one of the descendants of the first Node , this xml file represnt a table
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" standalone="yes"?>
  2. <NewDataSet>
  3.    <xs:schema .....    
  4.          .
  5.           <xs:element name="Table">
  6.           <xs:complexType>
  7.               <xs:sequence>
  8.                 <xs:element name="OrderID" type="xs:int" minOccurs="0" />
  9.                 <xs:element name="ProductID" type="xs:int" minOccurs="0" />
  10.                 <xs:element name="UnitPrice" type="xs:decimal" minOccurs="0" />
  11.                 <xs:element name="Quantity" type="xs:short" minOccurs="0" />
  12.                 <xs:element name="Discount" type="xs:float" minOccurs="0" />
  13.               </xs:sequence>
  14.             </xs:complexType>
  15.           </xs:element>
  16.           .
  17.           .
  18.    </xs:schema>
  19.    <Record>
  20.         // FIELD NODES
  21.    </Record>
  22.    <Record>
  23.        // FIELD NODES
  24.    </Record>
  25.    .
  26.    .
  27.        // MORE RECORDS 
  28. <NewDataSet>
i need to retrive the the name and the type of the fields in order to create an Entity that would represent a record , i cannot use built in ADO.NET function to create a dataset from this file.

i could use xmlDocument and traverse threw the schema untill finding the node with the name="table" , attribute .

im looking for a simple better looking way to do the above .
Linq to xml would of been the most appropriate way but it seems to have a problem with
Descendants("xs:element") with the ":" to be more specific .

thanks in advance .
Jun 15 '11 #1
0 1269

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Rohit Sharma | last post by:
Hi all.. ..NET + MSXML platform....VB Need to build a list of all the entities and attributes to allow the user to do search...how can i do that from the schema ?? Cheers Rohit
1
by: Christian | last post by:
Hi, I load an Xml-file "customers.xml" into a DataSet (works fine) but then how do I validate it against a schema (e.g. customers.xsd) ? my customers.xml: <?xml version="1.0"...
0
by: Greg | last post by:
I'm trying to read an xsd into a DataSet to generate the SQL db that I will import the data into. I get a couple errors (one of which make sense) but am not sure how to work around them I'm using...
4
by: Stefan Rotter | last post by:
Hi, I'm trying to load a schema into an XmlSchema object with the Read and Compile methods. I use Read with a ValidationEventHandler. No errors occurs but when I look at the XmlSchema properties...
1
by: Andy | last post by:
I am having some trouble validating XML using the XmlValidatingReader. I have created some xml and used the visual studio to generate the schema. So I am confident that the xml and schema match. ...
2
by: JMonnin | last post by:
I'm using an XmlValidatingReader to read an XML document and parse it against my schema. While I'm reading each node, I need to determine if the schema allows an ID attribute for the node. The ID...
1
by: RS | last post by:
I have a dataset that i read schema from the XSD file in to. After, i populate it with some values from the flat file. Fileds lend in to the right columns in the table however when i tell Dataset...
0
by: Peter | last post by:
I am having a problem reading an Excel file that is XML based. The directory I am reading contains Excel files that can be of two types. Either generic Microsoft based or XML based. I am reading...
0
by: RS | last post by:
I have a dataset that i read schema from the XSD file in to. After, i populate it with some values from the flat file. Fileds lend in to the right columns in the table however when i tell Dataset...
0
by: =?Utf-8?B?c3FsZXh0cmVtZQ==?= | last post by:
Hi Asp.net has some problem to read schema colletion of Sql Server 2005 or can read it as a xml normal? Thank Cristián
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.