On Fri, Jul 29, 2011 at 2:41 PM, Guilherme Armigliatto
<guilhermearmiglia...@gmail.com> wrote:
> Hi,
>
> I have created a simple test case to test the implementation.scala. However,
> when a I try to execute it I get the following error:
> SEVERE: XMLSchema validation error occured in: helloworld.composite ,line =
> 30, column = 9, Message = cvc-complex-type.2.4.a: Invalid content was found
> starting with element 'tuscany:implementation.scala'. One of
> '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation,
> "http://docs.oasis-open.org/ns/opencsa/sca/200912":implementation}' is
> expected.
>
> I created the
> "org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor" at
> src/main/resources of implementation.scala module with the content:
> "org.apache.tuscany.sca.implementation.scala.xml.ScalaImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#implementation.scala,model=org.apache.tuscany.sca.implementation.scala.ScalaImplementation";
>
> Is not it enough to get a correct XML schema validation?
>

That StAXArtifactProcessor is the bit that gives Tuscany  the code to
process the xml but it doesn't provide the new xsd to define its
schema. To do that you need a couple more files, the .xsd for the new
element and another meta-inf/services file so Tuscany can discover the
.xsd. You can see examples of that in some of the other Tuscany
extensions, for example, <implementation.jaxrs> is defined with the
two files:

https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs/src/main/resources/org/apache/tuscany/sca/implementation/jaxrs/tuscany-sca-1.1-implementation-jaxrs.xsd

and

https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema

   ...ant

Reply via email to