<?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>Stan Kitsis : MSXML</title><link>http://blogs.msdn.com/stan_kitsis/archive/tags/MSXML/default.aspx</link><description>Tags: MSXML</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>What's new in MSXML 6.0: Schema-related changes</title><link>http://blogs.msdn.com/stan_kitsis/archive/2005/12/21/506582.aspx</link><pubDate>Thu, 22 Dec 2005 04:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:506582</guid><dc:creator>skits</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/stan_kitsis/comments/506582.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stan_kitsis/commentrss.aspx?PostID=506582</wfw:commentRss><description>&lt;P&gt;In this post I will outline the major schema-related changes in MSXML 6.0 and what you might need to do if you rely on the old behavior.&amp;nbsp; Questions? Comments? Let me know.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN class=Heading2Char&gt;&lt;SPAN style="FONT-SIZE: 14pt"&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face=Arial&gt;XDR Support&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;MSXML6 has removed support for XDR schemas.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;XML schema (XSD) 1.0 has now been a W3C recommendation for almost 4 years so we made the decision to discontinue support for proprietary XDR schemas in MSXML6.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;XDR schemas will continue to be supported in earlier versions of MSXML.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=circle&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l3 level1 lfo1; tab-stops: list .5in"&gt;If you are using MSXML6, you will need to convert your XDR to XSD.&lt;/LI&gt;&lt;/UL&gt;
&lt;H2 style="MARGIN: 12pt 0in 3pt"&gt;&lt;EM&gt;&lt;FONT face=Arial&gt;Schema Compilation Changes&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/H2&gt;
&lt;H3 style="MARGIN: 12pt 0in 3pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;&lt;SPAN style="mso-fareast-font-family: Arial"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Arial&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Arial&gt;Support for Partial Schemas &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Summary:&lt;/B&gt; If two XSD files are loaded from different locations for the same namespace the Add method will union the declarations found in both locations.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In the past, adding a namespace from a secondary location would replace the definitions. &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Scenarios:&lt;/B&gt; Any scenario where the user is calling Add more than once on the same namespace may be affected.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Also, see SchemaCache::getSchema changes below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;If you rely on old behavior:&lt;/B&gt; Create a new SchemaCache and add only the appropriate schema&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H3 style="MARGIN: 12pt 0in 3pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;&lt;SPAN style="mso-fareast-font-family: Arial"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Arial&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Arial&gt;Schema flattening &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Summary:&lt;/B&gt; We now “flatten” schema imports (xs:import) so every namespace referenced is a first class citizen in the schema cache.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This ensures there is only one unique definition for every schema type in the schema cache. &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Scenarios:&lt;/B&gt; Any scenario where a common namespace was imported from more than one location by two or more namespaces – in other words, any situation where there could be ambiguous definitions for a type in the SchemaCache depending on the namespace it is used from.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Also, SchemaCache.Length might have a different value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;This is a breaking change&lt;/B&gt; and does not lend itself to the old behavior&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H3 style="MARGIN: 12pt 0in 3pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;&lt;SPAN style="mso-fareast-font-family: Arial"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Arial&gt;3.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Arial&gt;Improved Support for Runtime Schemas &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Summary:&lt;/B&gt; Inline schemas and schemas referenced from an instance using xsi:SchemaLocation are now added to an XML instance-specific cache which wraps the user-supplied SchemaCache.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Scenarios:&lt;/B&gt; This enables some more complex scenarios where cross-references between runtime schemas are handled appropriately.&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;This is a non-breaking change&lt;/B&gt; – it is enabling new scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H3 style="MARGIN: 12pt 0in 3pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;&lt;SPAN style="mso-fareast-font-family: Arial"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Arial&gt;4.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Arial&gt;Lax Imports &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Summary:&lt;/B&gt; The schema cache will compile a schema that has a reference to any other type already in the schema cache regardless of whether there is an explicit import or not (this is like an import with no location).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In order to make the add order insignificant the validateOnParse flag must be set to false when schema is loaded.&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;This is a non-breaking change&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 12pt 0in 3pt"&gt;&lt;EM&gt;&lt;FONT face=Arial&gt;SchemaCache API Changes &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/H2&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l5 level1 lfo3; tab-stops: list .5in"&gt;SchemaCache::get – notImpl – this scenario was targeted primarily at XDR so it has been removed. 
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l5 level1 lfo3; tab-stops: list .5in"&gt;SchemaCache::remove – notImpl – Previously the remove method removed a namespace and all of its imported namespaces, however now that imported schemas are promoted they may have multiple dependencies.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So this method is not implemented&lt;o:p&gt;&lt;/o:p&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo5; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;o&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;The simple workaround is just to create a new schema cache and add the desired schemas.&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1 start=3&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l5 level1 lfo3; tab-stops: list .5in"&gt;SchemaCache::getSchema – If the namespace is loaded from one location there is no change to this API.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If the namespace is loaded from multiple locations an “encapsulating” schema is created that union all the declarations under a single generated schema tag.&lt;o:p&gt;&lt;/o:p&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo4; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;o&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;There is no workaround to get to the old behavior&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1 start=4&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l5 level1 lfo3; tab-stops: list .5in"&gt;SchemaCache::addColllection – When one schema cache is added to another it supports partial schemas just like a call to Add( ).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;addCollection is atomic, either all schemas in the cache can be added or else none are added.&lt;o:p&gt;&lt;/o:p&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;o&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;If you rely on old behavior, create a new SchemaCache and add appropriate schemas&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1 start=5&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l5 level1 lfo3; tab-stops: list .5in"&gt;get_schemaLocations: used to return all the schema locations included/imported/redefined, now only reports the schema locations for the schema's namespace only, because of the same reason that schema has only elements/types etc in its own namespace.&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo7; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;o&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;To get old behavior, you need to step through included/imported/redefined schemas manually and call get_schemaLocations for each one of them.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Note that if you hit schemas loaded from multiple files, you will get multiple schema locations, which is different from the old behavior.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=506582" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stan_kitsis/archive/tags/MSXML/default.aspx">MSXML</category></item></channel></rss>