Hi,
As reported by JIRA issue Tuscany-437
(http://issues.apache.org/jira/browse/TUSCANY-437), we should be able to handle
SCDL using different XML styles illustrated as follows.
<component name="HelloWorldServiceComponent">
<!-- Style 1: using substitution group -->
<!--
<implementation.java class="helloworld.HelloWorldImpl"/>
-->
<!-- Style 2: using xsi:type -->
<implementation xsi:type="JavaImplementation"
class="helloworld.HelloWorldImpl"/>
</component>
To address this issue, I would like to propose that we provide SPI in
LoaderRegistry to register a StAX loader by either the QName of the XSD element
or the type. Upon this, the runtime behavior can be:
1) First check if there is a loader in the registry under the QName of the
element, if yes, then use it
2) If no, then try to check if there is an "xsi:type" attribute on the element,
if yes, use the value of the xsi:type (QName) to look up the registry
3) If neither step 1 or 2 can find a corresponding loader, the loading process
will fail.
Any other ideas?
Thanks,
Raymond