Hello!
One more question about xml.
I read in a book about basic xml and it says.
"An XML document could be a physical file on your computer or just a string
in memory."
The first part of the above sentence is normal that an xml document is a
physical file on disk.
But what does it mean when it says that it could be just a string in memory
?
//Tony
"Pavel Minaev" <in****@gmail.comskrev i meddelandet
news:db**********************************@2g2000hs n.googlegroups.com...
On Aug 12, 1:34 pm, "Tony Johansson" <johansson.anders...@telia.com>
wrote:
I just wonder does every xml document have a XSD schema or XDR schema ?
No. Aside from the fact that there are many other ways to define an
XML schema (e.g. old-fashioned DTDs, or RELAX NG), a document can have
no schema at all.
Is it possible to say that the purpose for schema is to have a definition
for syntax.
XML schema does not define the syntax - it defines the structure of
the document, in terms of XML infoset. In case of W3C XML Schema
(XSD), it can also augment the infoset of the document with things
such as types, and default values for missing attributes and elements.
Or can anyone else give a basic explanation what schema is used for in
..NET.
On the most basic level, to validate XML input and output against it.
There's also the aforementioned XML infoset augmentation - for
example, if you read an XML document with an associated schema into an
instance of XmlDocument with validation enabled, and the schema
defines some attributes with default values, those attributes will be
present in XmlDocument even if they were absent in the original XML,
and will have the default values as specified. In addition to that,
every element is associated with the corresponding type in the XSD
schema, and that type information can also be queried via .NET XML
APIs, and used as needed (and, of course, xsi:type attribute can be
used to explicitly specify types of elements in source XML).