<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR>
<STYLE>@font-face {
        font-family: SimSun;
}
@font-face {
        font-family: SimSun;
}
@font-face {
        font-family: Verdana;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; layout-grid: 15.6pt; }
P.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
LI.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
DIV.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
CODE {
        FONT-FAMILY: SimSun
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
OL {
        MARGIN-BOTTOM: 0cm
}
UL {
        MARGIN-BOTTOM: 0cm
}
</STYLE>
</HEAD>
<BODY lang=ZH-CN style="TEXT-JUSTIFY-TRIM: punctuation" vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=896252309-02012008><FONT face=Arial
color=#0000ff size=2>The consistency constraints in section 2.2.5 say that this
is not allowed:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=896252309-02012008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=896252309-02012008>
<DIV dir=ltr align=left><SPAN class=877380909-02012008><FONT face=Arial
color=#0000ff size=2>"<FONT face="Times New Roman" color=#000000 size=3>For a
given query, define a <B>participating ISSD</B> as the </FONT><A
title="in-scope schema definitions"
href="blocked::http://www.w3.org/TR/xquery/#dt-issd"><FONT
face="Times New Roman" size=3>in-scope schema definitions</FONT></A><FONT
face="Times New Roman" color=#000000 size=3> of a module that is used in
evaluating the query. If two participating ISSDs contain a definition for the
same schema type, element name, or attribute name, the definitions must be
equivalent in both ISSDs."</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=877380909-02012008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=877380909-02012008><FONT face=Arial
color=#0000ff size=2>The introductory paragraph of 2.2.5 says "<FONT
face="Times New Roman" color=#000000 size=3>This specification does not define
the result of <SPAN class=xquery><SPAN class=xquery>a query</SPAN></SPAN> under
any condition in which one or more of these constraints is not satisfied." <FONT
face=Arial><FONT color=#0000ff><FONT size=2>- in other words, it's an error to
have two different types with the same name, but it's not an error that an
implementation is required to detect and report. <SPAN
class=896252309-02012008>You can report XQST0035 if you want, or you can simply
crash and burn, or you can run the query and report any results you like - it's
your decision as an implementor how much checking you want to
do.</SPAN></FONT></FONT></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=877380909-02012008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN><SPAN class=877380909-02012008><FONT
face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=877380909-02012008><FONT face=Arial
color=#0000ff size=2>Section 2.2.5 also imposes constraints that require the
types derived from validating input documents to be consistent with those that
are imported into the static context.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=877380909-02012008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=877380909-02012008><SPAN
class=896252309-02012008><FONT face=Arial color=#0000ff size=2>Michael
Kay</FONT></SPAN></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=877380909-02012008><SPAN
class=896252309-02012008><FONT face=Arial color=#0000ff size=2><A
href="http://www.saxonica.com/">http://www.saxonica.com/</A></FONT></SPAN></SPAN></DIV></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> talk-bounces@x-query.com
[mailto:talk-bounces@x-query.com] <B>On Behalf Of </B>Jiang,
Weihua<BR><B>Sent:</B> 02 January 2008 02:28<BR><B>To:</B>
talk@x-query.com<BR><B>Subject:</B> [xquery-talk] How to understand
err:XQST0035?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1 style="LAYOUT-GRID: 15.6pt none">
<P class=MsoNormal><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">Hi
all,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">We are now trying to implement an
XQuery processor. However, now, we have a problem about the type system.
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">The case is:
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal
style="MARGIN-LEFT: 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"><![if !supportLists]><FONT
face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><SPAN
style="mso-list: Ignore">1.<FONT face="Times New Roman" size=1><SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face=Arial size=1><SPAN
lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">Module A import schema
file schemaA.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal
style="MARGIN-LEFT: 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"><![if !supportLists]><FONT
face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><SPAN
style="mso-list: Ignore">2.<FONT face="Times New Roman" size=1><SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face=Arial size=1><SPAN
lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">Module B import schema
file schemaB.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal
style="MARGIN-LEFT: 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"><![if !supportLists]><FONT
face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><SPAN
style="mso-list: Ignore">3.<FONT face="Times New Roman" size=1><SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face=Arial size=1><SPAN
lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">schemaA and schemaB
define a same-name (same namespace and same local name) schema
type.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal
style="MARGIN-LEFT: 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"><![if !supportLists]><FONT
face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><SPAN
style="mso-list: Ignore">4.<FONT face="Times New Roman" size=1><SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face=Arial size=1><SPAN
lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">Module A import module
B. <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">Will this schema type name conflict
cause err:XQST0035 or not? Though, in module A, it doesn’t import schemaB,
err:XQST0035 is so strong that it says:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=2><SPAN lang=EN-US
style="FONT-SIZE: 10.5pt">It is a <A title="static error"
href="http://www.w3.org/TR/xquery/#dt-static-error">static error</A> [<A
title=err:XQST0035
href="http://www.w3.org/TR/xquery/#ERRXQST0035">err:XQST0035</A>] if multiple
imported schemas, or multiple physical resources within one schema, contain
definitions for the same name in the same symbol space (for example, two
definitions for the same element name, even if the definitions are
consistent). However, it is not an error to import the schema with target
namespace </SPAN></FONT><CODE><FONT face=宋体 size=3><SPAN lang=EN-US
style="FONT-SIZE: 12pt">http://www.w3.org/2001/XMLSchema</SPAN></FONT></CODE><SPAN
lang=EN-US> (predeclared prefix </SPAN><CODE><FONT face=宋体 size=3><SPAN
lang=EN-US style="FONT-SIZE: 12pt">xs</SPAN></FONT></CODE><SPAN lang=EN-US>),
even though the built-in types defined in this schema are implicitly included
in the <A title="in-scope schema type"
href="http://www.w3.org/TR/xquery/#dt-is-types">in-scope schema
types.</A><o:p></o:p></SPAN></P>
<P class=MsoNormal><FONT face="Times New Roman" size=2><SPAN
lang=EN-US><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">It doesn’t say the multiple
imported schemas shall be in the same prolog. So, it seems the above case
shall report err:XQST0035. If so, then no type name conflict can appear at
global level (i.e. all the imported types, except built-in types, in all
modules shall be unique). <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">Or more precise question is: does
err:XQST0035 ensure the type systems used in </SPAN></FONT><SPAN
lang=EN-US>dynamic evaluation phase has no name conflict?
<o:p></o:p></SPAN></P>
<P class=MsoNormal><FONT face="Times New Roman" size=2><SPAN
lang=EN-US><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=2><SPAN lang=EN-US
style="FONT-SIZE: 10.5pt">Thanks<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=2><SPAN lang=EN-US
style="FONT-SIZE: 10.5pt">Weihua<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=2><SPAN
lang=EN-US><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=2><SPAN lang=EN-US
style="FONT-SIZE: 10.5pt">The case code is:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">//schemaA.xsd<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><?xml version="1.0"
encoding="UTF-8"?><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">targetNamespace="http://www.hats.com/hats"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><xs:simpleType
name="HatSize"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
<xs:restriction base="xs:integer"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
<xs:minInclusive value="1"/><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
<xs:maxInclusive value="10"/><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
</xs:restriction><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"></xs:simpleType><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"></xs:schema><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">//schemaB.xsd<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><?xml version="1.0"
encoding="UTF-8"?><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">targetNamespace="http://www.hats.com/hats"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><xs:simpleType
name="HatSize"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
<xs:restriction base="xs:integer"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
<xs:minInclusive value="1"/><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
<xs:maxInclusive value="20"/><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
</xs:restriction><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"></xs:simpleType><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"></xs:schema><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char"><FONT face=Verdana
size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char"><FONT face=Verdana
size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char"><FONT face=Verdana
size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
//B.xq<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char"><FONT face=Verdana
size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
module namespace
module1="http://www.hats.com/module1";<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">import schema namespace
hats="http://www.hats.com/hats" at "schemaB.xsd";<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char"><FONT face=Verdana
size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">declare function
module1:function1() as xs:integer<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">{<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char"><FONT face=Verdana
size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">
("4" cast as hats:HatSize) treat as
xs:integer<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">};<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">//A.xq<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">import module namespace
module1="http://www.hats.com/module1" at "B.xq";<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">import schema namespace
hats="http://www.hats.com/hats" at "schemaA.xsd";<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="LAYOUT-GRID-MODE: char; TEXT-INDENT: 21pt"><FONT
face=Verdana size=2><SPAN lang=EN-US
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">module1:function1() instance of
hats:HatSize<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>