Tuscany
  1. Tuscany
  2. TUSCANY-899

DAS Config model should declare a global element named "Config"

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Java-SCA-M2
    • Component/s: Java DAS RDB
    • Labels:
      None

      Description

      You should add a "Config" global element declaration to config.xsd:

      <xsd:element name="Config" type="config:Config"/>

      Doing this, however, will cause all your instance documents to fail when loading. The reason is because the instance documents currently use xsiNoNamespaceSchemaLocation as a hack to make it work without the "proper" global element defined:

      <Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      ...
      </Config>

      The xsi:noNamespaceSchemaLocation needs to be removed and replace with xmlns="http:///org.apache.tuscany.das.rdb/config.xsd" instead.

      One more change, to make it all work properly, is that you need to add elementFormDefault="qualified" in config.xsd, otherwise the nested elements won't be found when loading.

      To summarize, you need to add elementFormDefault and global element to config.xsd. With these changes config.xsd should look something like this:

      <xsd:schema
      xmlns:config="http:///org.apache.tuscany.das.rdb/config.xsd"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http:///org.apache.tuscany.das.rdb/config.xsd"
      elementFormDefault="qualified">

      <xsd:element name="Config" type="config:Config"/>

      <xsd:complexType name="Config">
      ...

      All the instance files, e.g., CompanyConfig.xml, need to be changed so that the root element uses xmlns instead of xsi:noNamespaceSchemaLocation. The instance documents should all look something like this:

      <Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">
      ...
      </Config>

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Kevin Williams
            Reporter:
            Frank Budinsky
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development