On Thu, Jun 4, 2009 at 4:55 PM, Raymond Feng <[email protected]> wrote: > Here is my understanding of the following statement: > > 3461 1. from the locations identified by the import statement(s) for the > namespace. Locations MUST NOT > 3462 be searched recursively in order to locate artifacts (i.e. only a > one-level search is performed). > > Let's say we have 3 contributions: C1, C2 and C3. > > Case 1: > > C1: import namespace="http://ns1" location="C2" > C2: export namespace="http://ns1" > C3: export namespace="http://ns1" > > To resolve an XML artifact (for example, an XSD type {http://ns1}Type1) for > C1, we first try C2 (as indicated by the @location). If C2 contains the XSD > Type {http://ns1}Type1, use it. Otherwise try C1. When C2 is searched, only > the top-level artifacts within C2 are checked. I think that's the behavior > we have in ModelResolvers. > > Case 2: > > C1: import namespace="http://ns1" > C2: export namespace="http://ns1" > C3: export namespace="http://ns1" > > The @location is not present, then C2 and C3 are searched as both of them > export http://ns1. > > Thanks, > Raymond >
Right, I think I basically agree with that. The "one level" rule only applies when the location is specified explicitly. Otherwise there is no concept of levels and the collection of contributions is considered to be a flat structure where all exports can be considered (in some implementation specific order) when resolving imports. A note on > The @location is not present, then C2 and C3 are searched as both of them > export http://ns1 More accurately C2 and C3 will be searched in some order until the required artifact is found (or not as the case may be). I don't know what order we will search C2 and C3 in. Simon
