<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Microsoft XML Team's WebLog : XSD</title><link>http://blogs.msdn.com/xmlteam/archive/tags/XSD/default.aspx</link><description>Tags: XSD</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Understanding XML Schema Sets in the XSD Designer</title><link>http://blogs.msdn.com/xmlteam/archive/2009/06/04/understanding-xml-schema-sets-in-the-xsd-designer.aspx</link><pubDate>Thu, 04 Jun 2009 22:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9700139</guid><dc:creator>XmlTeam</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/xmlteam/comments/9700139.aspx</comments><wfw:commentRss>http://blogs.msdn.com/xmlteam/commentrss.aspx?PostID=9700139</wfw:commentRss><description>&lt;p&gt;We have recently blogged about the new XML Schema Designer and the various views over schemas offered by it. We visit here the concept of schema sets, which are actually the central organizing concept around what is shown in the designer for a buffer in Visual Studio for which we have XML Schema information (be it an XSD file or an XML file or Visual Basic project with associated schemas). A schema set can be thought of as a collection of pairs, the first part of each pair being an XML namespace and the second part being the location of an XSD file that is associated to that namespace in the set. A namespace can have multiple files associated to it in a particular set and a file can be part of a multiple namespaces (due to the XML Schema concept of chameleons, whereby a file without a targetNamespace attributed defined for its schema element automatically assumes the targetNamespace of any and all files that include it). We explore below the ways in which schema sets are built and computed and how they are visualized in the XML Schema Designer.&lt;/p&gt;  &lt;p&gt;A schema set is basically built by walking the tree of external references from a particular set of root XSD files. An external reference is either an include element, which brings in the schema at the specified schemaLocation attribute into the schema in the same namespace as the current schema, or an import element, which specifies a particular XML namespace to import as well as, optionally, a particular schema location where the schema processor can find an XSD file for that namespace (there is also a redefine element defined in XML Schema, but we can treat as essentially equivalent to an include for this discussion). To illustrate these concepts and how they get applied, let’s see them in use in a particular sample industry schema (brainml.xsd, an XML Schema for neurological modeling defined at &lt;a href="http://brainml.org"&gt;http://brainml.org&lt;/a&gt; ).&lt;/p&gt;  &lt;p&gt;When we first open brainml.xsd in Visual Studio, this becomes the root of the XML Schema Set to be constructed and displayed in the Schema Explorer tree that comes up to help visualize the hierarchy of a schema set. Analyzing the external references (which must always be declared at the top before any globals are defined), we see the following two:&lt;/p&gt;  &lt;p&gt;&amp;lt;xs:import namespace=&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;xs:import namespace=&amp;quot;urn:bml/brainml.org:internal/BrainMetaL/1&amp;quot; schemaLocation=&amp;quot;citation.xsd&amp;quot;/&amp;gt;&lt;/p&gt;  &lt;p&gt;This gets interpreted as a request to bring in schemas for the two namespaces “&lt;a href="http://www.w3.org/XML/1998/namespace"&gt;http://www.w3.org/XML/1998/namespace&lt;/a&gt;” and “urn:bml/brainml.org:internal/BrainMetaL/1”. In the second case, we are also given a location hint where to find an xsd file for this namespace (more on how the first one is resolved a bit later), so we bring in the citation.xsd file into the set and, analyzing it, we see the following externals:&lt;/p&gt;  &lt;p&gt;&amp;lt;xs:import namespace=&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;xs:import namespace=&amp;quot;http://www.w3.org/1999/xlink&amp;quot; schemaLocation=&amp;quot;xlink.xsd&amp;quot;/&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;xs:include schemaLocation=&amp;quot;brainmetal.xsd&amp;quot;/&amp;gt;&lt;/p&gt;  &lt;p&gt;The first import is like the one we had previously seen for the XML namespace and will get resolved the same way. The second again brings in a new namespace into the set and a new file (xlink.xsd) for this namespace. The third includes another file (brainmetal.xsd) that has the same namespace (“urn:bml/brainml.org:internal/BrainMetaL/1”) as the targetNamespace of the current file. This process gets repeated for the rest of the unprocessed files in the set, though no new references are introduced in any of these, so finally we end up with the following tree view in our schema explorer of the namespaces and files in the set.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/xmlteam/WindowsLiveWriter/UnderstandingXMLSchemaSetsintheXSDDesign_B45B/clip_image002_2.jpg"&gt;&lt;img title="clip_image002" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="374" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/xmlteam/WindowsLiveWriter/UnderstandingXMLSchemaSetsintheXSDDesign_B45B/clip_image002_thumb.jpg" width="514" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So how did the xml.xsd file get found and associated to the xml namespace in the set? The answer is that, aside from schema location, Visual Studio also has other places that it looks in for schemas to resolve namespaces when a specific schema location is not provided (remember, the schemaLocation is just a hint to the schema processor, which can apply its knowledge of the environment to figure out how to resolve a namespace). Visual Studio will look in the current project, solution and even other open schemas to resolve schema references, and also comes preconfigured with a set of well known schemas, such as the schema for the xml namespace that is being referenced here.&lt;/p&gt;  &lt;p&gt;So how would we know what the well known namespaces and associations that are available in a particular context are? This can be seen through the schema dialog. For example, in the case above, the property window for the brainml.xsd code buffer shows a “Schemas” property and, clicking on it, brings up the following dialog.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/xmlteam/WindowsLiveWriter/UnderstandingXMLSchemaSetsintheXSDDesign_B45B/clip_image004_2.jpg"&gt;&lt;img title="clip_image004" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="339" alt="clip_image004" src="http://blogs.msdn.com/blogfiles/xmlteam/WindowsLiveWriter/UnderstandingXMLSchemaSetsintheXSDDesign_B45B/clip_image004_thumb.jpg" width="507" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This dialog shows a table view of namespaces for which Visual Studio has a known association and the locations of the files that are known to provide schemas for those namespaces. The left hand column, labeled “Use”, allows us to control when or if these known associations are used. The default option is “Automatic”, which means use the schema if needed to resolve an import (such as the current scenario of finding a schema for the well known xml namespace). An option of “Use” says the schema is to be used in the current set. Note that this option is pre-selected for the files computed to be in the set; selecting it for a new file would essentially introduce a new root into the set computation described above. Finally, there is also a do not use option to allow us to exclude a file from a set that would otherwise be included in one of the above scenarios.&lt;/p&gt;  &lt;p&gt;There are also two special values (localized strings that are not valid XML identifiers) used where a namespace name would normally appear in the schema explorer to help visualize and distinguish two error conditions that could arise in building a schema set. One is the “Not Found or Invalid” name that is used when the path specified in a schemaLocation is either not found (i.e. an include of a non-existent or non-readable file) or if the file is present but cannot be parsed as an XML schema (i.e. it is either not valid XML or we do not find a schema root element). For example, if we edit brainmetal.xsd in the set above to have the root element read “schemaInvalid” our schema explorer view of the schema changes as in the following diagram.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/xmlteam/WindowsLiveWriter/UnderstandingXMLSchemaSetsintheXSDDesign_B45B/clip_image006_2.jpg"&gt;&lt;img title="clip_image006" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="360" alt="clip_image006" src="http://blogs.msdn.com/blogfiles/xmlteam/WindowsLiveWriter/UnderstandingXMLSchemaSetsintheXSDDesign_B45B/clip_image006_thumb.jpg" width="495" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;There is another special name that can appear in place of the namespace, and that is the “Unauthorized Zone” name. The files that appear under this name are files that were attempted to be imported or included into the schema set by a schema file in a different security zone that does not have permissions to access the zone that file is in. This is similar to the Internet Explorer policy whereby a web page cannot redirect or read from a location on the user’s machine or intranet (i.e. a different security zone) unless the machine’s zone policy has been configured to allow this. The schema processor is essentially acting as a proxy for the remote site when requesting included or imported files on their behalf and thus enforces the zone security policies that are in place. This prevents any possible attacks whereby processing schema externals can be used by a malicious external site to either force opening a file or be used in combination with other exploits to potentially post back or gleam information about the user system.&lt;/p&gt;  &lt;p&gt;For example, imagine there is a schema available in an external web site named “Remote_Import_Local.xsd” that attempts to import a local file from the path “d:\schemas\Security\Local.xsd”. Even if this path exists in your local machine and there is a valid schema file there, it will not be included in the schema set (and will in fact not even be opened as part of building the set), and you will instead get the following view in the schema explorer.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/xmlteam/WindowsLiveWriter/UnderstandingXMLSchemaSetsintheXSDDesign_B45B/clip_image008_2.jpg"&gt;&lt;img title="clip_image008" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="366" alt="clip_image008" src="http://blogs.msdn.com/blogfiles/xmlteam/WindowsLiveWriter/UnderstandingXMLSchemaSetsintheXSDDesign_B45B/clip_image008_thumb.jpg" width="503" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The inclusion of Local.xsd in the “Unauthorized Zone” and the warnings in the error pane about not being able to resolve the schema location are an indication to the end user that the schema they were visiting attempted to bring in a schema from a zone that it is not authorized to access.&lt;/p&gt;  &lt;p&gt;-Fred Garcia&lt;/p&gt;  &lt;p&gt;SDE, XML Tools Team&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9700139" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XSD/default.aspx">XSD</category></item><item><title>XmlSchemaSet Thread Safety</title><link>http://blogs.msdn.com/xmlteam/archive/2009/04/27/xmlschemaset-thread-safety.aspx</link><pubDate>Tue, 28 Apr 2009 00:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9572118</guid><dc:creator>XmlTeam</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/xmlteam/comments/9572118.aspx</comments><wfw:commentRss>http://blogs.msdn.com/xmlteam/commentrss.aspx?PostID=9572118</wfw:commentRss><description>&lt;P&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;Here's a good word of warning: even if an object "feels" read-only because you're not calling code to modify it, if it's not documented as safe for use from multiple threads, then you shouldn't risk it.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;As an example, let’s look at &lt;A href="http://msdn.microsoft.com/en-us/library/system.xml.schema.xmlschema.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.xml.schema.xmlschema.aspx"&gt;&lt;FONT color=#0000ff&gt;XmlSchema&lt;/FONT&gt;&lt;/A&gt; and &lt;A href="http://msdn.microsoft.com/en-us/library/system.xml.schema.xmlschemaset.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.xml.schema.xmlschemaset.aspx"&gt;&lt;FONT color=#0000ff&gt;XmlSchemaSet&lt;/FONT&gt;&lt;/A&gt;. Initializing these has a cost associated with it, and so it's nice to be able to build them once and then reuse them. But you have to be very careful in doing this. The docs say that all instance methods are not safe for multiple thread usage, but you don't really use them directly during validation, so it's hard to tell from the outside what's safe and what's not.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;In a nutshell, the only thing you can do that is safe for concurrent usage is to use a validating reader. Here's the sample code to try this out (for some reason, this "breaks" more on 64-bit machines, but it's unsafe on all architectures).&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;First, a little helper to create an XmlSchema.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Consolas; mso-ansi-language: EN"&gt;private&lt;/SPAN&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-ansi-language: EN"&gt; &lt;SPAN style="COLOR: #2b91af"&gt;XmlSchema&lt;/SPAN&gt; CreateSchema()&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; schemaText = &lt;SPAN style="COLOR: #a31515"&gt;@"&amp;lt;?xml version='1.0'?&amp;gt;&lt;BR&gt;&amp;lt;xs:schema id='play' targetNamespace='http://tempuri.org/play.xsd'&lt;BR&gt;&amp;nbsp;elementFormDefault='qualified' xmlns='http://tempuri.org/play.xsd'&lt;BR&gt;&amp;nbsp;xmlns:xs='http://www.w3.org/2001/XMLSchema'&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;xs:element name='myShoeSize'&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;xs:complexType&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;xs:simpleContent&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:extension base='xs:decimal'&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:attribute name='sizing' type='xs:string' /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:extension&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:simpleContent&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/xs:element&amp;gt;&lt;BR&gt;&amp;lt;/xs:schema&amp;gt;"&lt;/SPAN&gt;;&lt;BR&gt;&lt;BR&gt;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;StringReader&lt;/SPAN&gt; reader = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;StringReader&lt;/SPAN&gt;(schemaText))&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;XmlSchema&lt;/SPAN&gt;.Read(reader, &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;Next, a simple XmlSchemaSet.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Consolas; mso-ansi-language: EN"&gt;private&lt;/SPAN&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-ansi-language: EN"&gt; &lt;SPAN style="COLOR: #2b91af"&gt;XmlSchemaSet&lt;/SPAN&gt; CreateSchemaSet(&lt;SPAN style="COLOR: #2b91af"&gt;XmlSchema&lt;/SPAN&gt; schema)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;XmlSchemaSet&lt;/SPAN&gt; set = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;XmlSchemaSet&lt;/SPAN&gt;();&lt;BR&gt;&amp;nbsp; set.Add(schema);&lt;BR&gt;&amp;nbsp; set.Compile();&lt;BR&gt;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; set;&lt;BR&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;Finally, some validation:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Consolas; mso-ansi-language: EN"&gt;private&lt;/SPAN&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-ansi-language: EN"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ValidateDocument(&lt;SPAN style="COLOR: #2b91af"&gt;XmlSchemaSet&lt;/SPAN&gt; set)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; doc = &lt;SPAN style="COLOR: #a31515"&gt;@"&amp;lt;myShoeSize xmlns='http://tempuri.org/play.xsd' sizing='123' /&amp;gt;"&lt;/SPAN&gt;;&lt;BR&gt;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;XmlReaderSettings&lt;/SPAN&gt; settings = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;XmlReaderSettings&lt;/SPAN&gt;();&lt;BR&gt;&amp;nbsp; settings.Schemas = set;&lt;BR&gt;&amp;nbsp; settings.ValidationEventHandler += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ValidationEventHandler&lt;/SPAN&gt;(settings_ValidationEventHandler);&lt;BR&gt;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;StringReader&lt;/SPAN&gt; reader = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;StringReader&lt;/SPAN&gt;(doc))&lt;BR&gt;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;XmlReader&lt;/SPAN&gt; x = &lt;SPAN style="COLOR: #2b91af"&gt;XmlReader&lt;/SPAN&gt;.Create(reader, settings))&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;while&lt;/SPAN&gt; (x.Read()) { }&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;BR&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; failCount;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;BR&gt;void&lt;/SPAN&gt; settings_ValidationEventHandler(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: #2b91af"&gt;ValidationEventArgs&lt;/SPAN&gt; e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; System.Threading.&lt;SPAN style="COLOR: #2b91af"&gt;Interlocked&lt;/SPAN&gt;.Increment(&lt;SPAN style="COLOR: blue"&gt;ref&lt;/SPAN&gt; failCount);&lt;BR&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;Now, armed with these, I will show you some code that &lt;EM&gt;is&lt;/EM&gt; thread-safe, but that a single line reorder would cause to break.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: Consolas; mso-ansi-language: EN"&gt;XmlSchema&lt;/SPAN&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-ansi-language: EN"&gt; schema = CreateSchema();&lt;BR&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Thread&lt;/SPAN&gt;[] threads = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Thread&lt;/SPAN&gt;[10];&lt;BR&gt;&lt;SPAN style="COLOR: #2b91af"&gt;XmlSchemaSet&lt;/SPAN&gt; set = CreateSchemaSet(schema);&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; i = 0; i &amp;lt; threads.Length; i++)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; threads[i] = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Thread&lt;/SPAN&gt;((x) =&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; j = 0; j &amp;lt; 1000; j++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// If the CreateSchemaSet were here&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // instead of outside this would break!&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Don't add the schema to the &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // XmlSchemaSet from multiple threads!&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // XmlSchemaSet set = CreateSchemaSet(schema);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ValidateDocument(set);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Array&lt;/SPAN&gt;.ForEach(threads, (t) =&amp;gt; t.Start());&lt;BR&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Array&lt;/SPAN&gt;.ForEach(threads, (t) =&amp;gt; t.Join());&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Text = &lt;SPAN style="COLOR: #a31515"&gt;"Failure count: "&lt;/SPAN&gt; + failCount;&lt;/SPAN&gt;&lt;SPAN lang=EN style="FONT-FAMILY: Consolas; mso-ansi-language: EN"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;The part before the thread creation runs on a single thread, and so there are no multi-thread concerns; the stuff inside the callback&amp;nbsp;is happening on multiple threads at the same time. You can only use the set for validation here!&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;
&lt;P&gt;Marcelo Lopez Ruiz&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;&lt;o:p&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;A href="http://blogs.msdn.com/marcelolr/"&gt;http://blogs.msdn.com/marcelolr/&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9572118" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XSD/default.aspx">XSD</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/Schema+Validation/default.aspx">Schema Validation</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/xml/default.aspx">xml</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/threading/default.aspx">threading</category></item><item><title>LINQ to XSD Alpha 0.2</title><link>http://blogs.msdn.com/xmlteam/archive/2008/02/21/linq-to-xsd-alpha-0-2.aspx</link><pubDate>Thu, 21 Feb 2008 19:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7840014</guid><dc:creator>XmlTeam</dc:creator><slash:comments>33</slash:comments><comments>http://blogs.msdn.com/xmlteam/comments/7840014.aspx</comments><wfw:commentRss>http://blogs.msdn.com/xmlteam/commentrss.aspx?PostID=7840014</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;I’m happy to announce that today we are re-releasing the LINQ to XSD Preview Alpha 0.2 for Visual Studio 2008. The previous preview release of LINQ to XSD targeted Beta 1 of Visual Studio 2008 but did not work on later builds. Many of the people who originally downloaded and tried the LINQ to XSD Preview Alpha requested an update for the final release of Visual Studio 2008 – this release is it. You can download it from &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a45f58cd-fcfc-439e-b735-8182775560af&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a45f58cd-fcfc-439e-b735-8182775560af&amp;amp;displaylang=en"&gt;&lt;FONT face=Calibri color=#0000ff size=3&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;The LINQ to XSD preview illustrates our initial thinking on a strongly-typed programming experience over LINQ to XML. Instead of working with untyped XML trees, LINQ to XSD allows you to program in terms of strongly-typed classes, generated based on an XSD schema. &amp;nbsp;The LINQ to XSD project is still incubation, but we are looking at ways to incorporate its functionality into future Visual Studio and .NET Framework releases. We are very much interested in gathering your feedback on the product, so please download it, give it a try, and send us some feedback. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;I know it’s taken us a while to get this release out and some of you have been wondering what’s happening with this project. The team has only recently resurfaced from the Visual Studio 2008 release push and has begun looking at how we can take LINQ to XSD forward again. We’re looking forward to getting your feedback on this preview and on our future work on strongly-typed XML programming. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Please send us your comments, questions, and suggestions via the LINQ forum on MSDN:&lt;SPAN style="COLOR: #1f497d"&gt; &lt;A href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=123&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=123&amp;amp;SiteID=1"&gt;&lt;FONT color=#0000ff&gt;http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=123&amp;amp;SiteID=1&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT color=#000000&gt;Shyam Pather&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Calibri size=3&gt;Dev Manager, Data Developer Experience Team&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7840014" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XML+Futures/default.aspx">XML Futures</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XSD/default.aspx">XSD</category></item><item><title>Chris Lovett Interview</title><link>http://blogs.msdn.com/xmlteam/archive/2007/11/16/chris-lovett-interview.aspx</link><pubDate>Fri, 16 Nov 2007 11:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6294636</guid><dc:creator>XmlTeam</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/xmlteam/comments/6294636.aspx</comments><wfw:commentRss>http://blogs.msdn.com/xmlteam/commentrss.aspx?PostID=6294636</wfw:commentRss><description>&lt;P&gt;Chris Lovett was interviewed by book author &lt;A class="" href="http://michiel.vanotegem.nl/" mce_href="http://michiel.vanotegem.nl "&gt;Michael van Otegem&lt;/A&gt; recently and he asked some very interesting questions:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please tell us who you are and what you do.&lt;BR&gt;&lt;/STRONG&gt;I’m an architect on the Data Programmability Tools team in SQL Server, and I work on XML tools that ship in Visual Studio.&amp;nbsp; As an architect I do lots of different things including: product development on the XML editor in Visual Studio 2008; cross-group collaboration to make sure all our tools work together; playing with other concepts like XML Notepad; and thinking about and communicating our strategy and future directions for our technologies.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&lt;STRONG&gt;How long have you&amp;nbsp;worked for Microsoft and what did you do before your current position?&lt;/STRONG&gt;&lt;BR&gt;I have worked on pretty much every XML core technology from Microsoft starting with MSXML in 1997, then to System.Xml in the .NET frameworks v1, and v2. and for the last few years I’ve been focusing on building XML tools in Visual Studio – for example, I was the primary developer on the XML editor in Visual Studio 2005.&amp;nbsp; Before Microsoft I worked at IBM on OS/2 applications, then I joined the IBM Apple/IBM joint venture called Taligent, then I started my own company in Sillicon Valley with friends from Taligent during the height of the .com boom and that’s what led me to Microsoft.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&lt;STRONG&gt;A lot of the .NET Framework works with XML in some form or another. Why is XML such a key component and what were the challenges you faced because of that?&lt;BR&gt;&lt;/STRONG&gt;For one thing the .NET frameworks were designed during the peak of the XML hype curve, but more seriously, many folks at Microsoft were waking up to the fact that not everything had to be buried in code.&amp;nbsp; Some things could be very neatly described at a higher “declarative” level and Tim Berners-Lee showed the world that “markup” is a great way to do that.&amp;nbsp; So XML became the way to specify configuration information (.config files), and build information (MSBuild files), and setup information (WIX), object remoting with SOAP, and security permissions and so on.&amp;nbsp; All of these domain specific uses of XML were then supported by our core System.Xml classes.&amp;nbsp; It’s interesting to note that even those teams that didn’t adopt XML back in .NET v1.0 are fixing that. For example,&amp;nbsp;we have the new AJAX work from the ASP.NET team and we have XAML in the Windows Presentation Framework (I’m a huge fan of WPF by the way.&amp;nbsp; I’ve done a lot of UI development in the last 20 years and I have to say WPF totally rocks).&amp;nbsp;&amp;nbsp; So XML is touching everything from database, management, communications, content publishing and now even into the user interface layer.&amp;nbsp; I was amazed at the last PDC where just about every talk showed some snippet of XML somewhere during their talk.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;I remember when we started XML at Microsoft most people thought we were crazy.&amp;nbsp; The biggest challenge was convincing people the cost of parsing and storing verbose XML tags was worth it and our team has been working on performance, and scalability ever since.&amp;nbsp; But the&amp;nbsp;real reason XML become a key component of .NET, (and Windows, and SQL Server and Office) is because it achieved true cross-platform interoperability and because it was good enough for that job.&lt;BR&gt;&amp;nbsp; &lt;BR&gt;&lt;STRONG&gt;What do you (personally) like the most about XML and its associated standards?&lt;BR&gt;&lt;/STRONG&gt;Simplicity, cross-platform interoperability and huge adoption.&amp;nbsp; The great thing about XML is that it is humble.&amp;nbsp; It’s not trying to solve world hunger.&amp;nbsp; Just invent your own tags, group them into structures that make sense for your domain and voilà.&amp;nbsp; It is very simple and it is this same simplicity that helped HTML take the world by storm.&amp;nbsp;&amp;nbsp; XML then improved on HTML by providing a clean separation between data and UI.&amp;nbsp; It brought MVC to the masses so to speak.&amp;nbsp; &lt;BR&gt;&amp;nbsp;&lt;BR&gt;The other day my 12 year old son was all excited and just had to show me what he discovered.&amp;nbsp; He was editing Age of Empires XML files to tweak the behavior of the game using Notepad.&amp;nbsp;&amp;nbsp;&amp;nbsp; I asked him how he knew that he could do that and how he knew the XML syntax.&amp;nbsp; He didn’t know what “syntax” meant, but he knew how to edit XML!&amp;nbsp; Then the same week my doctor was all excited when he heard I worked on XML because he was involved in a software purchasing decision at our local hospital and it came down to their level of XML support.&amp;nbsp; I couldn’t believe my ears.&amp;nbsp; &lt;BR&gt;&amp;nbsp;&lt;BR&gt;The funny thing is that most programmers don’t really like XML.&amp;nbsp; Probably because it doesn’t use curly brackets, so most programmers treat XML a bit like the ugly duckling.&amp;nbsp; But the reality is that the whole world gets markup – to them markup makes our programming world more approachable.&amp;nbsp; There are still way too many programmers that don’t get&amp;nbsp;this.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;STRONG&gt;What would be your #1 tip to people learning XML, XML Schema, XSLT and XQuery?&lt;BR&gt;&lt;/STRONG&gt;First of all I would say that XML 1.0 is the foundation.&amp;nbsp; A must have.&amp;nbsp; Can’t go wrong there, learn it, and learn how XML encoding works – that’s the number one issue people have with XML 1.0 – people don’t take the time to understand how UTF-8 encoding works which is a pretty important foundation to XML.&amp;nbsp; Don’t worry too much about DTD, because we now have XML schema.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;XML Schema (XSD) is a layer on top of XML 1.0.&amp;nbsp; When you need a way to describe your XML structure in “standard contract” XSD is handy and most importantly – it’s there and it’s a standard.&amp;nbsp; So don’t re-invent the wheel, but I’m not going to say that XSD is the be all and end all of data modeling, because it isn’t.&amp;nbsp; A lot of things are missing, which is why people had to invent things like Schematron, and why Microsoft is working on &lt;A class="" href="http://blogs.msdn.com/adonet/archive/2007/10/26/entity-data-model-designer-video.aspx" mce_href="http://blogs.msdn.com/adonet/archive/2007/10/26/entity-data-model-designer-video.aspx"&gt;EDM&lt;/A&gt; and &lt;A class="" href="http://www.w3.org/XML/SML/" mce_href="http://www.w3.org/XML/SML/"&gt;SML&lt;/A&gt; and so on.&amp;nbsp; Model driven development is now on the peak of the hype curve so I expect that modeling will be a battle ground for a long time to come.&amp;nbsp; So take a pragmatic approach to XSD - use it if it fits your purpose.&amp;nbsp; Some folks use other modeling approaches then have a tool that spits out the XSD – and that’s fine too.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;Same goes for XQuery and XSLT – I think of these as being yet another layer above XSD.&amp;nbsp; We did XSLT and XQuery because we figured that XML is data therefore people will want ways to query and transform that data.&amp;nbsp; Makes sense, and I’ve done a lot of XSLT development, I still use it for specific tasks, but some things are a bit tedious.&amp;nbsp; I find myself escaping to script a lot.&amp;nbsp; XSLT 2.0 is a good improvement, but again, these things are not going to be the be all and end all of query and transformation languages. &lt;BR&gt;&amp;nbsp;&lt;BR&gt;For example, I’m a huge fan of the work they are doing in Visual Basic 9 with &lt;A class="" href="http://channel9.msdn.com/ShowPost.aspx?PostID=329405" mce_href="http://channel9.msdn.com/ShowPost.aspx?PostID=329405"&gt;XML literals &lt;/A&gt;connected to our new Language Integrated Query (LINQ).&amp;nbsp; It makes a lot of sense, because instead of having to “escape” to script, you just write the code you need right there in place – you have a complete general purpose programming language at your finger tips.&amp;nbsp;&amp;nbsp; VB-XML integration is big leap forward for VB programmers and allows those developers, who may not be as familiar with the standard XML technologies like XSLT, to easily process XML data inside their programs.&amp;nbsp; It’s a huge advantage to the VB programmer and we think it helps make VB an extremely compelling language for XML programming – it makes me want to write VB again, and I’ve heard many others say the same thing.&amp;nbsp; However, it is VB-specific so development teams that need cross-platform interoperability at the query/transform layer are likely to stick to the standard technologies like XSLT and XQuery.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;There’s a very interesting tension going on here where general purpose languages like VB and C# are moving up into declarative space with LINQ but not going all the way into declarative, versus SQL, XQuery and XSLT which are fully declarative with no side effects, which are therefore more optimizable, but sometimes rather incomplete as programming languages go and rather hard to author in some cases.&amp;nbsp; I really don’t know how it’s going to end up.&amp;nbsp; I think we should continue innovating on both approaches and see what happens.&amp;nbsp; It should be very interesting.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;As for all the myriad other XML standards out there, there’s a lot of hype that you have to sort though.&amp;nbsp; To me it’s a funny thing to see programmers going to town making XML more complicated with layer upon layer of new concepts.&amp;nbsp; I remember going to a conference and people were telling me “stop! – we can’t take any more”.&amp;nbsp; There is genius in simplicity.&amp;nbsp; I’m glad to see the renewed focus on simple REST-ful XML based services for this reason.&amp;nbsp; If simple works, why complicate it.&amp;nbsp; Conversely, if it isn’t simple, chances are people just won’t use it.&amp;nbsp; &lt;BR&gt;&amp;nbsp;&lt;BR&gt;&lt;STRONG&gt;What can we expect from Microsoft in the future in the XML arena? Will support for XQuery 1.0 and XSLT 2.0 become part of Microsoft’s offering?&lt;/STRONG&gt;&lt;BR&gt;Microsoft is a pretty big place, so it’s hard for me to know all that is going on with XML across the company.&amp;nbsp; But I do know about .NET, Visual Studio and SQL server.&amp;nbsp; As I’ve mentioned before we are shipping the XML support in Visual Basic 9.0 with XML literals, XML axis properties and integration with LINQ to XML.&amp;nbsp; LINQ to XML is our API which we are adding to the XML runtime in .NET 3.5, it is a new XML object model that is designed to work well with the Language Integrate Query capabilities of C# and VB.&amp;nbsp;&amp;nbsp;&amp;nbsp; We are also shipping some cool new features in the XML tools in Visual Studio 2008, including an &lt;A class="" href="http://www.code-magazine.com/article.aspx?quickid=0710042&amp;amp;page=1" mce_href="http://www.code-magazine.com/article.aspx?quickid=0710042&amp;amp;page=1"&gt;incremental parser with extensibility API&lt;/A&gt; based on LINQ to XML that 3rd party XML designers can build on. We are also adding data breakpoints in the XSLT debugger and we have a new command line tool named “xsltc.exe” which takes XSLT and generates a .NET assembly which you can then deploy with your app instead of the XSLT source so you don’t have to compile XSLT on the server.&amp;nbsp; &lt;A class="" href="http://blogs.msdn.com/antosha/" mce_href="http://blogs.msdn.com/antosha/"&gt;Anton Lapounov &lt;/A&gt;has a great blog that talks about that.&amp;nbsp;&amp;nbsp; There is not much else new in the System.Xml runtime because&amp;nbsp; Visual Studio 2008 is essentially a service pack release of the .NET 2.0 runtime, so we’ve fixed some bugs there.&amp;nbsp; We are also working on some XML features in Silverlight and we put up a preview of our &lt;A class="" href="http://blogs.msdn.com/xmlteam/archive/2007/06/05/linq-to-xsd-preview-alpha-0-2-to-go-with-orcas-beta-1.aspx" mce_href="http://blogs.msdn.com/xmlteam/archive/2007/06/05/linq-to-xsd-preview-alpha-0-2-to-go-with-orcas-beta-1.aspx"&gt;LINQ to XSD&lt;/A&gt; work on MSDN.&amp;nbsp; We are working on a new &lt;A class="" href="http://www.microsoft.com/downloads/info.aspx?na=22&amp;amp;p=1&amp;amp;SrcDisplayLang=en&amp;amp;SrcCategoryId=&amp;amp;SrcFamilyId=&amp;amp;u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d4de12c98-1221-4a0e-b5aa-bfc7daf02550%26DisplayLang%3den" mce_href="http://www.microsoft.com/downloads/info.aspx?na=22&amp;amp;p=1&amp;amp;SrcDisplayLang=en&amp;amp;SrcCategoryId=&amp;amp;SrcFamilyId=&amp;amp;u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d4de12c98-1221-4a0e-b5aa-bfc7daf02550%26DisplayLang%3den"&gt;XSD designer&lt;/A&gt; and you will see&amp;nbsp;more CTP's on as this takes shape.&amp;nbsp; &lt;BR&gt;&amp;nbsp;&lt;BR&gt;As for XQuery, you probably know we have a subset of XQuery already supported inside SQL Server.&amp;nbsp; We currently have no official plans that we can announce on a client side XQuery engine but we are definitely interested in expanding client side query processing.&amp;nbsp; LINQ offers a path to this (for both relational as well as XML).&amp;nbsp; ESQL provides another client-side investment.&amp;nbsp; We are open to customer feedback on the relative importance of client side XQuery compared to all these other possibilities.&amp;nbsp; Meanwhile we are doing some XQuery improvements in SQL Server 2008, adding LET, better datetime support, and lax validation.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;As for XSLT 2.0 - we’ve heard from customers and understand the improvements in XSLT 2.0 over XSLT 1.0, but right now we’re in the middle of a big strategic investment in LINQ and EDM for the future of the data programming platform which we think will create major improvements in programming against all types of data.&amp;nbsp; But we are always re-evaluating our technology investments&amp;nbsp; so if your readers want to ramp up their volume on XSLT 2.0 please ask them to &lt;A class="" href="http://blogs.msdn.com/xmlteam/contact.aspx" mce_href="http://blogs.msdn.com/xmlteam/contact.aspx"&gt;drop us a line&lt;/A&gt; with their comments.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;Meanwhile I was rather surprised by the positive feedback to my little &lt;A class="" href="http://www.microsoft.com/downloads/info.aspx?na=22&amp;amp;p=1&amp;amp;SrcDisplayLang=en&amp;amp;SrcCategoryId=&amp;amp;SrcFamilyId=&amp;amp;u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d72d6aa49-787d-4118-ba5f-4f30fe913628%26DisplayLang%3den" mce_href="http://www.microsoft.com/downloads/info.aspx?na=22&amp;amp;p=1&amp;amp;SrcDisplayLang=en&amp;amp;SrcCategoryId=&amp;amp;SrcFamilyId=&amp;amp;u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d72d6aa49-787d-4118-ba5f-4f30fe913628%26DisplayLang%3den"&gt;XML Notepad 2007&lt;/A&gt; tool.&amp;nbsp; It now has over 1 million downloads and is still going strong.&amp;nbsp; Not bad for a few weeks work and no marketing.&amp;nbsp; So something about this tool hit the sweet spot.&amp;nbsp; The interesting thing there is it reaches out to the non-programmer community and I think that is the key and it has the right balance of simplicity and usability.&amp;nbsp; A Swedish customer said it is “&lt;EM&gt;logam&lt;/EM&gt;” – just enough.&amp;nbsp; I think you should expect to see more from Microsoft in the future that helps to make XML something that everyone on the planet can deal with easily and in a way that integrates deeply with everything else Microsoft provides.&amp;nbsp; &lt;BR&gt;&amp;nbsp;&lt;BR&gt;As the XML hype is wearing off, folks are realizing that not everything that made it through the standards process needs to be implemented.&amp;nbsp;&amp;nbsp; So I think you will see Microsoft continue to innovate on new XML technologies and tools like LINQ to XML and VB 9.0 XML and you’ll see Microsoft taking a more pragmatic customer-demand-driven approach to standards.&amp;nbsp;&amp;nbsp;&amp;nbsp; Microsoft will probably never implement every standard that comes out but I’m confident you will see Microsoft continue to be committed to the really important XML standards, like XML 1.0 and XSD, and any other standard that is essential to achieving cross-platform interoperability, including Open XML.&amp;nbsp; There is enormous power in the cross-platform reach of XML and the huge industry adoption it has and I’m happy to see that Microsoft is continuing to do some really innovative work with XML.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6294636" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XML+Futures/default.aspx">XML Futures</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XSD/default.aspx">XSD</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XSLT/default.aspx">XSLT</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/xml/default.aspx">xml</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/xquery/default.aspx">xquery</category></item><item><title>XML Tools Screencasts</title><link>http://blogs.msdn.com/xmlteam/archive/2007/06/04/xml-tools-screencasts.aspx</link><pubDate>Mon, 04 Jun 2007 20:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3083779</guid><dc:creator>XmlTeam</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/xmlteam/comments/3083779.aspx</comments><wfw:commentRss>http://blogs.msdn.com/xmlteam/commentrss.aspx?PostID=3083779</wfw:commentRss><description>These videos provide some great information and a preview of the new &lt;A class="" href="http://datajunkies.net/screencasts/XML%20Editor%20Demo/XML%20Editor%20Demo.html" target=_blank mce_href="http://datajunkies.net/screencasts/XML%20Editor%20Demo/XML%20Editor%20Demo.html"&gt;&lt;FONT color=#0000cc&gt;XML Editor&lt;/FONT&gt;&lt;/A&gt;, &lt;A class="" href="http://datajunkies.net/screencasts/XSLT%20Debugger%20Demo/XSLT%20Debugger%20Demo.html" target=_blank mce_href="http://datajunkies.net/screencasts/XSLT%20Debugger%20Demo/XSLT%20Debugger%20Demo.html"&gt;&lt;FONT color=#669966&gt;XSLT Debugger&lt;/FONT&gt;&lt;/A&gt;, and &lt;A class="" href="http://datajunkies.net/screencasts/EDM%20Wizard%20Demo/EDM%20Wizard%20Demo.html" target=_blank mce_href="http://datajunkies.net/screencasts/EDM%20Wizard%20Demo/EDM%20Wizard%20Demo.html"&gt;&lt;FONT color=#669966&gt;EDM Wizard&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp;coming in Orcas, as well as a sneak preview of&amp;nbsp;a new &lt;A class="" href="http://datajunkies.net/screencasts/XSD%20Designer%20Demo/XSD%20Designer%20Demo%20[skits].html" mce_href="http://datajunkies.net/screencasts/XSD%20Designer%20Demo/XSD%20Designer%20Demo%20[skits].html"&gt;&lt;FONT color=#669966&gt;XSD Designer&lt;/FONT&gt;&lt;/A&gt; and &lt;A class="" href="http://datajunkies.net/screencasts/EDM%20Designer%20Demo/EDM%20Designer%20Demo%20[noamba].html" target=_blank mce_href="http://datajunkies.net/screencasts/EDM%20Designer%20Demo/EDM%20Designer%20Demo%20[noamba].html"&gt;&lt;FONT color=#669966&gt;EDM Designer&lt;/FONT&gt;&lt;/A&gt; that we can expect to see released after the upcoming Orcas release. &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3083779" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XML+Futures/default.aspx">XML Futures</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XSD/default.aspx">XSD</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XSLT/default.aspx">XSLT</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/EDM/default.aspx">EDM</category></item><item><title>XML Schema Facets</title><link>http://blogs.msdn.com/xmlteam/archive/2007/05/31/xml-schema-facets.aspx</link><pubDate>Fri, 01 Jun 2007 00:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3013573</guid><dc:creator>XmlTeam</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/xmlteam/comments/3013573.aspx</comments><wfw:commentRss>http://blogs.msdn.com/xmlteam/commentrss.aspx?PostID=3013573</wfw:commentRss><description>&lt;P&gt;I have received a number of requests over a period of time asking how to get all the facets defined on simple types or complex types with simple content&amp;nbsp;in&amp;nbsp;an XML Schema. I recently wrote a code sample for the same and I thought i will post it for wider consumption. The code sample will handle restrictions on lists, unions as well as facets defined on base types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;public static void GetSchemaTypeFacets(XmlSchemaType schemaType) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;if (schemaType == null || schemaType.Datatype == null) { //Complex&amp;nbsp;type with complex&amp;nbsp;content&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;XmlSchemaSimpleType st = schemaType as XmlSchemaSimpleType;&lt;BR&gt;&amp;nbsp;&amp;nbsp;if (st != null) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;GetSimpleTypeFacets(st);&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;else { //Complex type simple content&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlSchemaComplexType ct = schemaType as XmlSchemaComplexType;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Debug.Assert(ct != null);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlSchemaSimpleContent simpleContent = ct.ContentModel as XmlSchemaSimpleContent;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Debug.Assert(simpleContent != null);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlSchemaSimpleContentRestriction simpleRest = simpleContent.Content as XmlSchemaSimpleContentRestriction;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (simpleRest != null) { //Can also be simple content extension&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PrintFacets(simpleRest.Facets);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;GetSchemaTypeFacets(ct.BaseXmlSchemaType);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;public static void GetSimpleTypeFacets(XmlSchemaSimpleType st) {&lt;BR&gt;&amp;nbsp;&amp;nbsp; if (st == null || st.QualifiedName.Namespace == XmlSchema.Namespace) { //Built-in type, no user-defined facets&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp; switch(st.Datatype.Variety) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case XmlSchemaDatatypeVariety.List:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlSchemaSimpleType itemType = (st.Content as XmlSchemaSimpleTypeList).BaseItemType;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetSimpleTypeFacets(itemType);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case XmlSchemaDatatypeVariety.Union:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlSchemaSimpleTypeUnion union = st.Content as XmlSchemaSimpleTypeUnion;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach(XmlSchemaSimpleType stu in union.BaseMemberTypes) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetSimpleTypeFacets(stu);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case XmlSchemaDatatypeVariety.Atomic:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlSchemaSimpleTypeRestriction rest = st.Content as XmlSchemaSimpleTypeRestriction;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintFacets(rest.Facets);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; default:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (st.BaseXmlSchemaType != null) { //Chain to the base type&lt;BR&gt;&amp;nbsp;&amp;nbsp; GetSimpleTypeFacets(st.BaseXmlSchemaType as XmlSchemaSimpleType); //BaseType of a simple type is always a simple type&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;private static void PrintFacets(XmlSchemaObjectCollection facets) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;foreach(XmlSchemaFacet facet in facets) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(facet.GetType().ToString() + " " + facet.Value);&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;Let me know if you have any questions.&lt;/P&gt;
&lt;P&gt;-Priya Lakshminarayanan&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3013573" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XSD/default.aspx">XSD</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/Schema+Validation/default.aspx">Schema Validation</category></item><item><title>To Trust, or Not to Trust?</title><link>http://blogs.msdn.com/xmlteam/archive/2007/04/02/to-trust-or-not-to-trust.aspx</link><pubDate>Tue, 03 Apr 2007 02:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2015009</guid><dc:creator>XmlTeam</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/xmlteam/comments/2015009.aspx</comments><wfw:commentRss>http://blogs.msdn.com/xmlteam/commentrss.aspx?PostID=2015009</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Validation of an XML document against an Xml Schema guarantees that the structure and content of the xml conforms to the types defined in the schema. Does this mean that we automatically elevate the trust level of a document that has passed schema validation? &lt;/FONT&gt;&lt;FONT face="Times New Roman" size=3&gt;Can we use schema validation as a security layer to our application?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;The general recommendation is that validation of an xml document should not preclude the need for secure coding practices in the application that consumes the validated data.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Times New Roman" size=3&gt;That being the case, we know of applications where length facets are used to ensure that a input parameter is not longer than the specified length, pattern facets are used to verify that the input does not pose the risk of SQL/Command injection etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;A href="http://www.w3.org/TR/xmlschema-1" mce_href="http://www.w3.org/TR/xmlschema-1"&gt;&lt;FONT face="Times New Roman" size=3&gt;W3C Xml Schema&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Times New Roman" size=3&gt; is a complicated specification open to a lot of interpretation and we have not reached a stage yet where all the schema processors are 100% compatible. Consider the case where the regular expression implementation in a particular schema processor is different from that specified in the XSD specification. Suddenly, the pattern facet that is supposed to protect the application from injection attacks is no longer safe.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;If you are one among the people who answered yes to the questions at the beginning of the article, read on for ways to tighten the security of a validation episode using the XmlSchemaValidationFlags in the System.Xml.Schema namespace in the .NET Framework 2.0&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 18pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 18pt"&gt;&lt;FONT face="Times New Roman"&gt;XmlSchemaValidationFlags Explained&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;XmlSchemaValidationFlags was introduced in .NET Framework 2.0 in order to mitigate security threats and improve interoperability while performing schema validation using the validating XmlReader or XmlSchemaValidator.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;The enumeration has the following values:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;TABLE class=MsoNormalTable style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-table-layout-alt: fixed; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1 class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR style="HEIGHT: 12.3pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 32.88%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.3pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width="32%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Enum Value&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 41.12%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.3pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width="41%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Description&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 26%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 12.3pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width="26%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;XmlReaderSettings&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Default&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 50.65pt; mso-yfti-irow: 1"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 32.88%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 50.65pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="32%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;None&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 41.12%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 50.65pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="41%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Identity constraints, Schema Location hints, Inline schemas and validation warnings will all be ignored&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 26%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 50.65pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="26%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 37.6pt; mso-yfti-irow: 2"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 32.88%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 37.6pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="32%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;ProcessIdentityConstraints&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 41.12%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 37.6pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="41%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Perform validation for xs:ID, xs:IDREF, xs:key, xs:keyref, xs:unique&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 26%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 37.6pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="26%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Yes&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 49.9pt; mso-yfti-irow: 3"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 32.88%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 49.9pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="32%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;ProcessInlineSchema&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 41.12%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 49.9pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="41%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Load any inline schemas in the xml instance being validated and add the schema for validation of subsequent xml nodes&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 26%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 49.9pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="26%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;No&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 63.75pt; mso-yfti-irow: 4"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 32.88%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 63.75pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="32%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;ProcessSchemaLocation&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 41.12%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 63.75pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="41%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Load schemas by following the location hints specified in xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes and use the schemas for validation of subsequent xml nodes&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 26%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 63.75pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="26%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;No&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 37.3pt; mso-yfti-irow: 5"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 32.88%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 37.3pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="32%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;ReportValidationWarnings&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 41.12%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 37.3pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="41%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Report any warnings encountered during the validation of the xml instance&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 26%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 37.3pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="26%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;No&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 63.75pt; mso-yfti-irow: 6; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 32.88%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 63.75pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="32%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;AllowXmlAttributes&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 41.12%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 63.75pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="41%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Allow xml:* attributes even if they are not defined in the schema. The attributes will be validated based on their data type&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 26%; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 63.75pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="26%"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Yes&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 18pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 18pt"&gt;&lt;FONT face="Times New Roman"&gt;Security Implication of XmlSchemaValidationFlags&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 18pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;DO TURN ON the ReportValidationWarnings flag&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;By default this flag is not turned on while creating a validating XmlReader using the XmlReaderSettings. (This was done so that users can perform partial validation of an xml instance without having to deal with a large number of warnings for the portions that don’t have a schema. For eg: Validating a WordML document with user content against the user’s schema. Another reason was to improve performance as every warning entails creation of an exception object)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Consider the following example of an order schema and an instance order.xml&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="&lt;B style="mso-bidi-font-weight: normal"&gt;http://tempuri/Orders.org&lt;/B&gt;" xmlns="http://tempuri/Orders.org" elementFormDefault="qualified"&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;xsd:element name="order"&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;xsd:complexType &amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;xsd:sequence&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;xsd:element name="orderid" type="xsd:int"/&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;xsd:element name="item" type="xsd:string" maxOccurs="unbounded"/&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;xsd:element name="address" type="xsd:string"/&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/xsd:sequence&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/xsd:complexType&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;/xsd:element&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;lt;/xsd:schema&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;lt;order xmlns="&lt;B style="mso-bidi-font-weight: normal"&gt;http://tempuri/Order.org&lt;/B&gt;"&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;orderid&amp;gt;A100&amp;lt;/orderid&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;item&amp;gt;umbrella&amp;lt;/item&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;address&amp;gt;1234 wallaby way&amp;lt;/address&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;lt;/order&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;The &amp;lt;orderid&amp;gt; element is invalid according to the schema (A100 is not a valid xsd:int) but validation using a validating XmlReader with the default settings returns without any errors. This happens because the namespace in the xml and the namespace in the schema do not match (&lt;B style="mso-bidi-font-weight: normal"&gt;http://tempuri/Order.org Vs http://tempuri/Orders.org) &lt;/B&gt;and strict schema validation occurs only after finding the schema definition for an element whose name AND namespace match a definition in the schema (&lt;/FONT&gt;&lt;A class="" title=cvc-assess-elt name=cvc-assess-elt&gt;&lt;/A&gt;&lt;A href="http://www.w3.org/TR/xmlschema-1/#cvc-assess-elt" mce_href="http://www.w3.org/TR/xmlschema-1/#cvc-assess-elt"&gt;&lt;FONT face="Times New Roman"&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-bookmark: cvc-assess-elt"&gt;Schema-Validity Assessment (Element)&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: cvc-assess-elt"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;SPAN style="mso-bookmark: cvc-assess-elt"&gt;&lt;SPAN lang=EN style="COLOR: black; FONT-FAMILY: Arial; mso-ansi-language: EN; mso-bidi-font-weight: bold"&gt;&lt;FONT size=3&gt;)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;In this case, it is only a warning that schema information could not be found due to the namespace mismatch and since warnings are turned OFF by default, the user sees no evidence that the validation did not happen. If the flag is turned ON, the user should see the following warning:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;Could not find schema information for the element 'http://tempuri/Order.org:order'.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;An Error Occurred at: file:///E:/bugrepro/order.xml, (1,2)&lt;/I&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="COLOR: red"&gt;Note:&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;Warnings will be reported when this flag is turned ON AND a validation event handler is hooked up (to XmlReaderSettings, XmlDocument or XmlSchemaValidator)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;DO NOT TURN ON the ProcessSchemaLocation flag&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;If this flag is turned ON, Schema Location hints in the xml document (xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes) are followed by the validation engine using the default XmlUrlResolver (unless the XmlResolver property is specifically set to NULL or a secure resolver in which case it takes precedence) &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;The default resolver does not protect against cross-zone re-direction and adding schemas at validation time by the instance document might change validation outcome by adding new types, redefining existing types etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;DO NOT TURN ON the ProcessInlineSchema flag&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;In addition to allowing new types and redefining existing types by way of the schema allowed inline in the xml document, this will also pose a threat to users who are dependent on strict validation to map their XML into objects since any element can now contain a whole schema as its child node and might cause unexpected errors in the X-O mapping.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;MAY TURN ON the AllowXmlAttributes flag &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;If allowing attributes from the xml namespace (on any or all elements in the instance even though not specifically allowed by the schema) will not pose a risk to your application.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;MAY TURN ON the ProcessIdentityConstraints flag &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;If processing of xsd:key. xsd:keyref, xs:ID, xs:IDREF is important to your application and you have determined that the scope of the key/keyref is not such that it might cause a Denial of Service attack.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;All of the above are merely guidelines for a secure validation episode using the System.Xml.Schema namespace. The flags you choose are greatly dependent on your application needs but keep in mind the security implications of validated data the next time you are tempted to completely trust such data. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;Hope you enjoyed reading this and I greatly appreciate your feedback.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;-Priya Lakshminarayanan&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2015009" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/xmlteam/archive/tags/XSD/default.aspx">XSD</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/Schema+Validation/default.aspx">Schema Validation</category><category domain="http://blogs.msdn.com/xmlteam/archive/tags/Security/default.aspx">Security</category></item></channel></rss>