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

Classes generated by XSD.exe

I have a schema that I've used to generate a class structure vis the xsd.exe
utility. I'm having to manually validate the resultant XML since the
resultant document is not necessarily compliant with the structure defined by
the original XSD.

Here's what I'm wondering, though.....
I have a server process that is going to have to process these documents
rather quickly. At the end of the document, there are going to be attached
files (base64encoded). During this processing, there isn't any sense in
loading up the entire XML statement into a DOM document because I only ned
the first few nodes in order to determine what to do.

The logical choice: Use a SAX parser (XmlReader).

My original XSD defined a number of complex types that consisted of
sequences of elements. According to a strict interpretation of the schema
(which would help SAX parsing) those elements would have to occur in that
exact order. This would REALLY simplify parsing the document via SAX. I
don't see anything in the generateds class that indicates an element's
cardinality, though.

Can I assume that even though the original schema stated that a sequence of
elements must ccur in a specified order, that does not necessarily mean that
the XmlSerializer will honor that definition?
Is there a way to control this, or do I have to take the route of loading
the entire document into a XmlDocument (in memory) instead of just pulling
the information I need out of a stream?
Jul 31 '06 #1
2 1607
I believe the order of elements generated by the XSD.exe is based on
the order the public properties (or public variables) appear in the
class.

Dickster

Jul 31 '06 #2
"David Jessee" <Da*********@discussions.microsoft.comwrote in message
news:D1**********************************@microsof t.com...
>I have a schema that I've used to generate a class structure vis the
xsd.exe
utility. I'm having to manually validate the resultant XML since the
resultant document is not necessarily compliant with the structure defined
by
the original XSD.

Here's what I'm wondering, though.....
I have a server process that is going to have to process these documents
rather quickly. At the end of the document, there are going to be
attached
files (base64encoded). During this processing, there isn't any sense in
loading up the entire XML statement into a DOM document because I only ned
the first few nodes in order to determine what to do.

The logical choice: Use a SAX parser (XmlReader).

My original XSD defined a number of complex types that consisted of
sequences of elements. According to a strict interpretation of the schema
(which would help SAX parsing) those elements would have to occur in that
exact order. This would REALLY simplify parsing the document via SAX. I
don't see anything in the generateds class that indicates an element's
cardinality, though.

Can I assume that even though the original schema stated that a sequence
of
elements must ccur in a specified order, that does not necessarily mean
that
the XmlSerializer will honor that definition?
Is there a way to control this, or do I have to take the route of loading
the entire document into a XmlDocument (in memory) instead of just pulling
the information I need out of a stream?
I'm confused. What are you using the XmlSerializer for?

Also, if you're processing XML, why not just stick with XML and not play
with XSD.EXE-generated classes? Are your first few complextype elements that
complicated?

John
Aug 1 '06 #3

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

Similar topics

0
by: vanGogh | last post by:
I have generated classes based on an Xml schema file (xsd) using the XSD.exe tool. My goal is to: - write an application that can parse XML documents - fill objects (based on the generated...
2
by: Peter Bates | last post by:
Hi, I'm just getting used to XSDObjectGen and i have the following question. Can i use a class inherited from a class generated by XSDObjectGen with XmlSerialize? Specifically, I have many...
1
by: Axel Dahmen | last post by:
I'd like to generate C# classes from an XML Schema file. All the generated classes should provide a basic member function framework like Save() and a basic member element like Dirty. Moreover, I'd...
5
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of different webservices. I don't use the webservices...
2
by: farseer | last post by:
Hi, First, sorry for this long post, but i'd like to explain my problem in detail... i have generated some classes from my schema. Classes are generated for the root (overall document),...
3
by: MIGUEL | last post by:
Hi all, I'm quite lost with how adding web references to a project creates proxy classes. I've developed a web service with two classes inside and that contains three references to three...
8
by: cd~ | last post by:
I can provide a test app, the news server won't allow me to post the files because they are too large (93KB and 1.2KB) I downloaded the ESRI ArcXml schema and generated the classes from the...
4
by: Chris F Clark | last post by:
Please excuse the length of this post, I am unfortunately long-winded, and don't know how to make my postings more brief. I have a C++ class library (and application generator, called Yacc++(r)...
26
by: nyathancha | last post by:
Hi, How Do I create an instance of a derived class from an instance of a base class, essentially wrapping up an existing base class with some additional functionality. The reason I need this is...
4
by: bob_jenkins | last post by:
C# allows code to be generated, but the generated code is in its own assembly. Is there a way for that generated code to access internal classes in the assembly that produced it? To have the...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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.