<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/workflow/"
xmlns:ns2="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ns3="http://schemas.microsoft.com/office/2004/12/omml"
xmlns:ns4="http://schemas.openxmlformats.org/package/2006/relationships"
xmlns:ns5="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:ns6="http://schemas.microsoft.com/exchange/services/2006/messages">

<head>

<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--a:link
        {mso-style-priority:99;}
span.MSOHYPERLINK
        {mso-style-priority:99;}
a:visited
        {mso-style-priority:99;}
span.MSOHYPERLINKFOLLOWED
        {mso-style-priority:99;}

 /* Font Definitions */
 @font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Verdana;
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Calibri;
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Verdana;
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        layout-grid:15.6pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:556012358;
        mso-list-type:hybrid;
        mso-list-template-ids:-319259470 427717608 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:18.0pt;
        mso-level-number-position:left;
        margin-left:18.0pt;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1
        {mso-list-id:1085494169;
        mso-list-type:hybrid;
        mso-list-template-ids:-347167616 -1429330540 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-number-format:alpha-upper;
        mso-level-tab-stop:18.0pt;
        mso-level-number-position:left;
        margin-left:18.0pt;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>

<div class=Section1 style='layout-grid:15.6pt'>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'>Thanks Michael!<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'>Since same
schema different schema file case is not defined in XQuery, to some
extent the implementer has some choice of how far the investigation goes on. But
for a general user who using a general XQuery processor, the result of below
XQuery expression should be at least reasonable and understandable at the
schemas perspective. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'>So my question is,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'>Which is more
reasonable for a general XQuery processor to identify the schema, target
namespace or schema location?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'>The answer to this question
will decide a more reasonable result that a user can accept for the XQuery
expression below, true or error.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'>Thanks again,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'>Haifeng Chen<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal align=left style='text-align:left'><b><font size=2
face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma;
font-weight:bold'>From:</span></font></b><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma'> Michael Rys
[mailto:mrys@microsoft.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> 2008</span></font><font
size=2 face=&#23435;&#20307;><span style='font-size:10.0pt;font-family:SimSun'></span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>1</span></font><font
size=2 face=&#23435;&#20307;><span style='font-size:10.0pt;font-family:SimSun'></span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>10</span></font><font
size=2 face=&#23435;&#20307;><span style='font-size:10.0pt;font-family:SimSun'></span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
13:50<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">Chen,
 Haifeng</st1:PersonName>; <st1:PersonName w:st="on">talk@x-query.com</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: What identifies an
XML schema in XQuery, target namespace or schema location?</span></font><font
size=3><span lang=EN-US style='font-size:12.0pt'><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal align=left style='text-align:left'><font size=2
face="Times New Roman"><span lang=EN-US style='font-size:10.5pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>The XQuery spec
makes it clear that it is the namespace URI of the schema and the local name of
the component that uniquely identifies a schema component. Since equivalence of
schema components from different schema files is not defined in XQuery, the
result is system-dependent on how far the type equivalence investigation goes
during the compilation/linking of the two modules.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>Best regards<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>Michael<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal align=left style='text-align:left'><b><font size=2
face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma;
font-weight:bold'>From:</span></font></b><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
talk-bounces@x-query.com [mailto:talk-bounces@x-query.com] <b><span
style='font-weight:bold'>On Behalf Of </span></b><st1:PersonName w:st="on">Chen,
 Haifeng</st1:PersonName><br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, January 09, 2008
6:34 PM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">talk@x-query.com</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> [xquery-talk] What
identifies an XML schema in XQuery, target namespace or schema location?<o:p></o:p></span></font></p>

</div>

</div>

<p class=MsoNormal align=left style='text-align:left'><font size=2
face="Times New Roman"><span lang=EN-US style='font-size:10.5pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-US style='font-size:
11.0pt;font-family:Verdana'>Dear XQuery experts,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-US style='font-size:
11.0pt;font-family:Verdana'>I come to a question related to the schema import
in XQuery. The following is the context,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-US style='font-size:
11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='layout-grid-mode:char'><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'>Given
two XSD files named hats1.xsd and hats2.xsd (note: contents of these two files
are the same) stored at the current directory as following,<o:p></o:p></span></font></b></p>

<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2;
layout-grid-mode:char'><![if !supportLists]><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><span
style='mso-list:Ignore'>1.<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></font></span></span></font></b><![endif]><b><font
size=2 face=Verdana><span lang=EN-US style='font-size:11.0pt;font-family:Verdana;
font-weight:bold'>hats1.xsd (A schema defines a simple type HatSize)<o:p></o:p></span></font></b></p>

<p class=MsoNormal style='layout-grid-mode:char'><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&lt;?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&lt;xs:schema
xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>xmlns=&quot;http://www.hats.com/hats&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>targetNamespace=&quot;http://www.hats.com/hats&quot;&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&lt;xs:simpleType name=&quot;HatSize&quot;&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:restriction
base=&quot;xs:integer&quot;&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:minInclusive
value=&quot;1&quot;/&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:maxInclusive
value=&quot;10&quot;/&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xs:restriction&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&lt;/xs:simpleType&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&lt;/xs:schema&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='layout-grid-mode:char'><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2;
layout-grid-mode:char'><![if !supportLists]><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><span
style='mso-list:Ignore'>2.<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></font></span></span></font></b><![endif]><b><font
size=2 face=Verdana><span lang=EN-US style='font-size:11.0pt;font-family:Verdana;
font-weight:bold'>hats2.xsd (A schema defines a simple type HatSize)<o:p></o:p></span></font></b></p>

<p class=MsoNormal style='layout-grid-mode:char'><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&lt;?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&lt;xs:schema
xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>xmlns=&quot;http://www.hats.com/hats&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>targetNamespace=&quot;http://www.hats.com/hats&quot;&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&lt;xs:simpleType
name=&quot;HatSize&quot;&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:restriction
base=&quot;xs:integer&quot;&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:minInclusive
value=&quot;1&quot;/&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:maxInclusive
value=&quot;10&quot;/&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xs:restriction&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&lt;/xs:simpleType&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>&lt;/xs:schema&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal style='layout-grid-mode:char'><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='layout-grid-mode:char'><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'>Given
two XQuery files named module1.xq and module2.xq stored at the current
directory as following,<o:p></o:p></span></font></b></p>

<p class=MsoNormal style='layout-grid-mode:char'><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2;
layout-grid-mode:char'><![if !supportLists]><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><span
style='mso-list:Ignore'>3.<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></font></span></span></font></b><![endif]><b><font
size=2 face=Verdana><span lang=EN-US style='font-size:11.0pt;font-family:Verdana;
font-weight:bold'>module1.xq (A module contains a function simply return a
HatSize instance, importing schema hats1.xsd)<o:p></o:p></span></font></b></p>

<p class=MsoNormal style='layout-grid-mode:char'><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>module namespace
module1=&quot;http://www.hats.com/module1&quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>import schema namespace
hats=&quot;http://www.hats.com/hats&quot; at &quot;hats1.xsd&quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>declare function
module1:function1() as hats:HatSize<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>{<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
text-indent:21.0pt;layout-grid-mode:char'><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana'>5 cast as hats:HatSize<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>};<o:p></o:p></span></font></p>

<p class=MsoNormal style='layout-grid-mode:char'><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2;
layout-grid-mode:char'><![if !supportLists]><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><span
style='mso-list:Ignore'>4.<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></font></span></span></font></b><![endif]><b><font
size=2 face=Verdana><span lang=EN-US style='font-size:11.0pt;font-family:Verdana;
font-weight:bold'>module2.xq (Main module call the function and test instance
of HatSize over the instance, importing schema hats2.xsd)<o:p></o:p></span></font></b></p>

<p class=MsoNormal style='layout-grid-mode:char'><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>import module namespace
module1=&quot;http://www.hats.com/module1&quot; at &quot;module1.xq&quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>import schema namespace
hats=&quot;http://www.hats.com/hats&quot; at &quot;hats2.xsd&quot;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd;
layout-grid-mode:char'><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana'>module1:function1() instance of
hats:HatSize<o:p></o:p></span></font></p>

<p class=MsoNormal style='layout-grid-mode:char'><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='layout-grid-mode:char'><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'>Question:
<o:p></o:p></span></font></b></p>

<p class=MsoNormal style='layout-grid-mode:char'><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><o:p>&nbsp;</o:p></span></font></b></p>

<p class=MsoNormal style='layout-grid-mode:char'><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'>Whats
the right result when evaluating on module2.xq? <o:p></o:p></span></font></b></p>

<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo4;
layout-grid-mode:char'><![if !supportLists]><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><span
style='mso-list:Ignore'>A.<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></font></span></span></font></b><![endif]><b><font
size=2 face=Verdana><span lang=EN-US style='font-size:11.0pt;font-family:Verdana;
font-weight:bold'>true<o:p></o:p></span></font></b></p>

<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo4;
layout-grid-mode:char'><![if !supportLists]><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><span
style='mso-list:Ignore'>B.<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></font></span></span></font></b><![endif]><b><font
size=2 face=Verdana><span lang=EN-US style='font-size:11.0pt;font-family:Verdana;
font-weight:bold'>false<o:p></o:p></span></font></b></p>

<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo4;
layout-grid-mode:char'><![if !supportLists]><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><span
style='mso-list:Ignore'>C.<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></font></span></span></font></b><![endif]><b><font
size=2 face=Verdana><span lang=EN-US style='font-size:11.0pt;font-family:Verdana;
font-weight:bold'>static error should be raised<o:p></o:p></span></font></b></p>

<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo4;
layout-grid-mode:char'><![if !supportLists]><b><font size=2 face=Verdana><span
lang=EN-US style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><span
style='mso-list:Ignore'>D.<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></font></span></span></font></b><![endif]><b><font
size=2 face=Verdana><span lang=EN-US style='font-size:11.0pt;font-family:Verdana;
font-weight:bold'>dynamic error should be raised<o:p></o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><o:p>&nbsp;</o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;font-weight:bold'>It is actually
asking what identifies an XML schema, target namespace or schema
location?<o:p></o:p></span></font></b></p>

<p class=MsoNormal><b><font size=2 face=Verdana><span lang=EN-US
style='font-size:11.0pt;font-family:Verdana;font-weight:bold'><o:p>&nbsp;</o:p></span></font></b></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-US style='font-size:
11.0pt;font-family:Verdana'>Thanks,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-US style='font-size:
11.0pt;font-family:Verdana'>Haifeng Chen<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-US style='font-size:
11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-US style='font-size:
11.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>