"David Jessee" <DavidJessee@discussions.microsoft.comwrote in message
news:D1ABF838-AF0E-4B7A-AC75-958DFF78FC2B@microsoft.com...
Quote:
>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