svnno****@sourc*****
svnno****@sourc*****
2008年 11月 3日 (月) 23:22:42 JST
Revision: 2070 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jiemamy&view=rev&rev=2070 Author: daisuke_m Date: 2008-11-03 23:22:42 +0900 (Mon, 03 Nov 2008) Log Message: ----------- xml schema書きかけ。まだボロボロ。 Modified Paths: -------------- zeus/trunk/org.jiemamy.spec.core/src/main/resources/jiemamy-core.xsd zeus/trunk/org.jiemamy.spec.core/src/main/resources/sample-validation-target.xml -------------- next part -------------- Modified: zeus/trunk/org.jiemamy.spec.core/src/main/resources/jiemamy-core.xsd =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/resources/jiemamy-core.xsd 2008-11-03 13:54:09 UTC (rev 2069) +++ zeus/trunk/org.jiemamy.spec.core/src/main/resources/jiemamy-core.xsd 2008-11-03 14:22:42 UTC (rev 2070) @@ -11,132 +11,140 @@ <xsd:documentation>Jiemamy model schema.</xsd:documentation> </xsd:annotation> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/> + <xsd:element name="rootModel" type="j:rootModelType"/> - <xsd:element name="rootModel" type="j:rootModel"/> - <xsd:attribute name="id" type="j:uuid"/> - - <xsd:complexType name="rootModel"> + <xsd:attributeGroup name="model.attributes" > + <xsd:attribute name="id" type="j:uuidType" use="required"/> + </xsd:attributeGroup> + + <xsd:attributeGroup name="ref.attributes" > + <xsd:attribute name="ref" type="j:uuidType" use="required"/> + </xsd:attributeGroup> + + <xsd:complexType name="rootModelType"> <xsd:sequence maxOccurs="1" minOccurs="1"> - <xsd:element name="dialect" type="j:fqcn"/> + <xsd:element name="dialect" type="j:fqcnType"/> <xsd:element name="schemaName" type="xsd:string" minOccurs="0"/> <xsd:element name="beginScript" type="xsd:string" minOccurs="0"/> <xsd:element name="endScript" type="xsd:string" minOccurs="0"/> <xsd:element name="description" type="xsd:string" minOccurs="0"/> - <xsd:element name="domains" type="j:domains"/> - <xsd:element name="nodes" type="j:nodes"/> - <xsd:element name="connections" type="j:connections"/> - <xsd:element name="insertDataSetModels" type="j:insertDataSetModels"/> + <xsd:element name="domains" type="j:domainsType"/> + <xsd:element name="nodes" type="j:nodesType"/> + <xsd:element name="connections" type="j:connectionsType"/> + <xsd:element name="insertDataSetModels" type="j:insertDataSetModelsType"/> </xsd:sequence> - <xsd:attribute ref="j:id" use="required"/> + <xsd:attributeGroup ref="j:model.attributes"/> </xsd:complexType> - <xsd:complexType name="domains"> + + <xsd:complexType name="domainsType"> <xsd:sequence> - <xsd:element name="domain" type="j:domain" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="domain" type="j:domainType" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> - <xsd:complexType name="nodes"> + + <xsd:complexType name="nodesType"> <xsd:choice minOccurs="0" maxOccurs="unbounded"> - <xsd:element name="table" type="j:table"/> - <xsd:element name="view" type="j:view"/> - <xsd:element name="sticky" type="j:sticky"/> + <xsd:element name="table" type="j:tableType"/> + <xsd:element name="view" type="j:viewType"/> + <xsd:element name="sticky" type="j:stickyType"/> </xsd:choice> </xsd:complexType> - <xsd:complexType name="connections"> + + <xsd:complexType name="connectionsType"> <xsd:sequence> - <xsd:element name="foreignKey" type="j:foreignKey" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="foreignKey" type="j:foreignKeyType" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> - <xsd:complexType name="insertDataSetModels"> + + <xsd:complexType name="insertDataSetModelsType"> </xsd:complexType> - <xsd:complexType name="domain"> + <xsd:complexType name="domainType"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="logicalName" type="xsd:string"/> - <xsd:element name="dataType" type="j:dataType"/> + <xsd:element name="dataType" type="j:dataTypeType"/> <xsd:element name="defaultValue" type="xsd:string"/> - <xsd:element name="constraints" type="j:constraints"/> + <xsd:element name="constraints" type="j:constraintsType"/> <xsd:element name="simpleIndex" type="xsd:boolean"/> <xsd:element name="freeString" type="xsd:string" minOccurs="0"/> <xsd:element name="description" type="xsd:string" minOccurs="0"/> - <xsd:element name="options" type="j:options" minOccurs="0"/> + <xsd:element name="options" type="j:optionsType" minOccurs="0"/> </xsd:sequence> - <xsd:attribute ref="j:id" use="required"/> + <xsd:attributeGroup ref="j:model.attributes"/> </xsd:complexType> - <xsd:complexType name="table"> + <xsd:complexType name="tableType"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="logicalName" type="xsd:string"/> - <xsd:element name="dataType" type="j:dataType"/> + <xsd:element name="dataType" type="j:dataTypeType"/> <xsd:element name="defaultValue" type="xsd:string"/> - <xsd:element name="constraints" type="j:constraints"/> + <xsd:element name="constraints" type="j:constraintsType"/> <xsd:element name="simpleIndex" type="xsd:boolean"/> <xsd:element name="freeString" type="xsd:string" minOccurs="0"/> <xsd:element name="description" type="xsd:string" minOccurs="0"/> - <xsd:element name="options" type="j:options" minOccurs="0"/> + <xsd:element name="options" type="j:optionsType" minOccurs="0"/> </xsd:sequence> - <xsd:attribute ref="j:id" use="required"/> + <xsd:attributeGroup ref="j:model.attributes"/> </xsd:complexType> - <xsd:complexType name="view"> + <xsd:complexType name="viewType"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="logicalName" type="xsd:string"/> <xsd:element name="definition" type="xsd:string"/> </xsd:sequence> - <xsd:attribute ref="j:id" use="required"/> + <xsd:attributeGroup ref="j:model.attributes"/> </xsd:complexType> - <xsd:complexType name="sticky"> + <xsd:complexType name="stickyType"> <xsd:sequence> <xsd:element name="contents" type="xsd:string"/> </xsd:sequence> - <xsd:attribute ref="j:id" use="required"/> + <xsd:attributeGroup ref="j:model.attributes"/> </xsd:complexType> - <xsd:complexType name="foreignKey"> + <xsd:complexType name="foreignKeyType"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="logicalName" type="xsd:string"/> </xsd:sequence> - <xsd:attribute ref="j:id" use="required"/> - <xsd:attribute name="ref"/> + <xsd:attributeGroup ref="j:model.attributes"/> </xsd:complexType> - <xsd:complexType name="dataType"> + <xsd:complexType name="dataTypeType"> <xsd:sequence> <xsd:any minOccurs="0"/><!-- FIXME --> </xsd:sequence> - <xsd:attribute ref="j:id" use="required"/> + <xsd:attributeGroup ref="j:model.attributes"/> </xsd:complexType> - <xsd:complexType name="constraints"> + <xsd:complexType name="constraintsType"> <xsd:sequence> - <xsd:element name="constraint" type="j:constraint" minOccurs="0" maxOccurs="unbounded"/><!-- FIXME --> + <xsd:element name="constraint" type="j:constraintType" minOccurs="0" maxOccurs="unbounded"/><!-- FIXME --> </xsd:sequence> </xsd:complexType> - <xsd:complexType name="constraint"> + <xsd:complexType name="constraintType"> <xsd:sequence> <xsd:any minOccurs="0"/><!-- FIXME --> </xsd:sequence> - <xsd:attribute ref="j:id" use="required"/> + <xsd:attributeGroup ref="j:model.attributes"/> </xsd:complexType> - <xsd:complexType name="options"> + <xsd:complexType name="optionsType"> <xsd:sequence> <xsd:any minOccurs="0"/><!-- FIXME --> </xsd:sequence> </xsd:complexType> - <xsd:simpleType name="uuid"> - <xsd:restriction base="xsd:string"> + <xsd:simpleType name="uuidType"> + <xsd:restriction base="xsd:ID"> <xsd:pattern value="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"/> </xsd:restriction> </xsd:simpleType> - <xsd:simpleType name="fqcn"> + <xsd:simpleType name="fqcnType"> <xsd:restriction base="xsd:string"> <xsd:pattern value="([A-Za-z]+\.)*[A-Za-z][A-Za-z0-9]*"/> </xsd:restriction> Modified: zeus/trunk/org.jiemamy.spec.core/src/main/resources/sample-validation-target.xml =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/resources/sample-validation-target.xml 2008-11-03 13:54:09 UTC (rev 2069) +++ zeus/trunk/org.jiemamy.spec.core/src/main/resources/sample-validation-target.xml 2008-11-03 14:22:42 UTC (rev 2070) @@ -1,5 +1,5 @@ <?xml version="1.0" standalone="yes"?> -<rootModel j:id="d5a96af3-b1e9-4285-a8ef-c491ce5ae308" +<rootModel id="d5a96af3-b1e9-4285-a8ef-c491ce5ae308" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jiemamy.org/xml/ns/core jiemamy-core.xsd" xmlns="http://jiemamy.org/xml/ns/core" @@ -13,10 +13,10 @@ <domain id="fb585cd1-9dd3-4f85-824d-2bdeee05dba8"> <name>ID</name> <logicalName/> - <dataType>org.jiemamy.core.model.typedef.datatype.impl.IntegerDataTypeMock</dataType> + <dataType id="fb585cd1-9dd3-4f85-824d-2bdeee05dba7">org.jiemamy.core.model.typedef.datatype.impl.IntegerDataTypeMock</dataType> <defaultValue/> <constraints> - <UniqueConstraintModelImpl id="259a9430-27ee-4c7f-9a0d-ded2b8a64044"> + <UniqueConstraintModelImpl id="259a9430-27ee-4c7f-9a0d-ded2b8a64044"> <name/> </UniqueConstraintModelImpl> <NotNullConstraintModelImpl id="8e0fa3a0-313d-4ae7-8977-704a45932218">