OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

wsrp message

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


Subject: Re: [wsrp] xsi:type usage for Extensions



This conformance statement was included for the same reason that the xsi:type attribute was defined. The key is that there is no requirement that there exist a definition of the element in any schema and while the type declaration is redundant in the case such a definition exists, it allows elements with random (undefined) names to be validated because they reference a defined type.

Rich



Subbu Allamaraju <subbu@bea.com>

09/25/2006 01:40 PM

To
OASIS WSRP TC <wsrp@lists.oasis-open.org>
cc
Subject
[wsrp] xsi:type usage for Extensions





WRRP v1/v2 has a conformance statement that requires all extensions to
explicitly declare their type using the xsi:type attribute.

Can someone clarify why this is required? In general, the type
information can be derived by using the element name and namespace
information, as in

<v1:extensions>
  <ext:foo xmlns:ext="foo:ext:namespace">
    <ext:bar/>
  </ext:foo>
</v1:extension>

When added, an xsi:type would essentially carry the same information, e.g.

<v1:extensions>
  <ext:foo xmlns:ext="foo:ext:namespace" xsi:type="ext:FooType">
    <ext:bar/>
  </ext:foo>
</v1:extension>

The only time xsi:type is required when the XML is using polymorphism as in

<v1:extensions>
  <ext:foo xmlns:ext="foo:ext:namespace" xsi:type="ext:FooSubType">
    <ext:bar/>
  </ext:foo>
</v1:extension>

where FooSubType is extending FooType. In other cases, xsi:type is not
required for processing the XML.

Moreover, the xsi:type attribute cannot be set when the type is
anonymous (i.e. when the element declares the type inline).

IMO, this conformance statement is not required. Any comments?

Regards,
Subbu




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