[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: What is the diff between "import" vs "include" ?

  • From: Amelia A Lewis <amyzing@t...>
  • To: xml-dev@l...
  • Date: Tue, 15 Apr 2008 18:32:09 -0400

Re:  What is the diff between "import" vs "include" ?
Uh.

On Tue, 15 Apr 2008 17:27:43 -0400
Jonathan Robie <jonathan.robie@r...> wrote:
>Ben Stover wrote:
>> In a WSDL definition I saw an "import" af and *.xsd file and an
>> "include" of an *.xsd schema.

This is, presumably, WSDL 2.0.  WSDL 1.1 does not have an inclusion
mechanism (W3C XML Schema does, but within a <schema> element in the
<types> section, W3C XML Schema rules control (except when they don't;
welcome to the wonderful world of WSDL)).

>> what is the difference?

In WSDL 2.0, only WSDL documents may be included or imported using
wsdl:import and wsdl:include.

In WSDL 1.1, only wsdl:import is defined, but it may import both W3C XML
Schema and WSDL (1.1).  Note, however, that it can't if you're using WS-I
rules, which say that you shouldn't use wsdl:import to import a schema,
but should use <xs:import> inside a <schema> inside <types>,
notwithstanding that an import is conceptually *not* a re-export so that
the so-imported elements ought *not* be visible to the WSDL (by purist
standards, which WS-I is not, and which most implementations aren't,
either).  An xs:include inside an xs:schema inside wsdl:types should have
the effect of inclusion, with the restriction that chameleon includes are
not permitted (yes, WSDL 1.1 redefines the semantics of schema when that
schema is inlined into a WSDL).

Umm.  TMI?  Also, check your implementation.  They differ, sometimes
significantly.  Within an implementation, if WS-I compliance is optional,
the implementation may differ from itself in different modes.  All of
this is getting better (and WSDL 2.0 addresses most of this, but nobody
has an implementation, to speak of), in the sense that there's
increasingly less variance.  Check your implementation is the best rule,
still.

>With include, everything that is included must be in the including 
>schema's target namespace.  Import lets you pull in definitions and 
>declarations from other namespaces.
>
>See:
>http://www.w3.org/TR/xmlschema-0/#SchemaInMultDocs
>http://www.w3.org/TR/xmlschema-0/#import

Jonathan, this is at least misleading, since the OP specified schema
import and include inside WSDL, with no mention of where, or which
version.  This is ... difficult, since there is no wsdl:include in 1.1,
and wsdl:include can't include schema in 2.0.  It's true for schema
alone, but schema inside WSDL may not behave as expected.

Amy!
-- 
Amelia A. Lewis                    amyzing {at} talsever.com
  Light is the left hand of darkness
  and darkness the right hand of light.
    Two are one, life and death, lying
    together like lovers in kemmer,
      like hands joined together,
      like the end and the way.
        -- Tormer's Lay [Ursula K. Le Guin, "The Left Hand of Darkness"]


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.