Browse Source

- TAML schema WIP.

MelvMay-GG 12 years ago
parent
commit
2a0b871
1 changed files with 2 additions and 30 deletions
  1. 2 30
      engine/source/persistence/taml/taml.cc

+ 2 - 30
engine/source/persistence/taml/taml.cc

@@ -887,26 +887,6 @@ bool Taml::generateTamlSchema( const char* pFilename )
         pComplexTypeElement->SetAttribute( "mixed", "true" );
         pComplexTypeElement->SetAttribute( "mixed", "true" );
         pSchemaElement->LinkEndChild( pComplexTypeElement );
         pSchemaElement->LinkEndChild( pComplexTypeElement );
 
 
-        // Set content parent element.
-        TiXmlElement* pContentParentElement = pComplexTypeElement;
-
-        // Do we have a base type?
-        if ( pType->getParentClass() != NULL )
-        {
-            // Yes, so add complex content.
-            TiXmlElement* pComplexContentElement = new TiXmlElement( "xs:complexContent" );
-            pComplexTypeElement->LinkEndChild( pComplexContentElement );
-
-            // Add extension.
-            TiXmlElement* pExtensionElement = new TiXmlElement( "xs:extension" );
-            dSprintf( buffer, sizeof(buffer), "%s_Type", pType->getParentClass()->getClassName() );
-            pExtensionElement->SetAttribute( "base", buffer );
-            pComplexContentElement->LinkEndChild( pExtensionElement );
-
-            // Set as content parent element.
-            pContentParentElement = pExtensionElement;
-        }
-
         // Fetch container child class.
         // Fetch container child class.
         AbstractClassRep* pContainerChildClass = pType->getContainerChildClass( false );
         AbstractClassRep* pContainerChildClass = pType->getContainerChildClass( false );
 
 
@@ -933,7 +913,7 @@ bool Taml::generateTamlSchema( const char* pFilename )
             pGroupReferenceElement->SetAttribute( "ref", buffer );
             pGroupReferenceElement->SetAttribute( "ref", buffer );
             pGroupReferenceElement->SetAttribute( "minOccurs", "0" );
             pGroupReferenceElement->SetAttribute( "minOccurs", "0" );
             pGroupReferenceElement->SetAttribute( "maxOccurs", "unbounded" );
             pGroupReferenceElement->SetAttribute( "maxOccurs", "unbounded" );
-            pContentParentElement->LinkEndChild( pGroupReferenceElement );
+            pComplexTypeElement->LinkEndChild( pGroupReferenceElement );
 
 
             // Add group members.
             // Add group members.
             for ( AbstractClassRep* pGroupType = pRootType; pGroupType != NULL; pGroupType = pGroupType->getNextClass() )
             for ( AbstractClassRep* pGroupType = pRootType; pGroupType != NULL; pGroupType = pGroupType->getNextClass() )
@@ -942,10 +922,6 @@ bool Taml::generateTamlSchema( const char* pFilename )
                 if ( !pGroupType->isClass( pContainerChildClass ) )
                 if ( !pGroupType->isClass( pContainerChildClass ) )
                     continue;
                     continue;
 
 
-                // Skip if a parent contains the child class already.
-                if ( pType->findContainerChildRoot( pGroupType ) != pType )
-                    continue;
-
                 // Add group member.
                 // Add group member.
                 TiXmlElement* pGroupMemberElement = new TiXmlElement( "xs:element" );
                 TiXmlElement* pGroupMemberElement = new TiXmlElement( "xs:element" );
                 pGroupMemberElement->SetAttribute( "name", pGroupType->getClassName() );
                 pGroupMemberElement->SetAttribute( "name", pGroupType->getClassName() );
@@ -968,16 +944,12 @@ bool Taml::generateTamlSchema( const char* pFilename )
                 field.type == AbstractClassRep::EndGroupFieldType )
                 field.type == AbstractClassRep::EndGroupFieldType )
             continue;
             continue;
 
 
-            // Skip if we're not the field root i.e. it's not defined on this type but a parent type.
-            if ( pType->findFieldRoot( StringTable->insert( field.pFieldname ) ) != pType )
-                continue;
-
             // Add attribute element.
             // Add attribute element.
             TiXmlElement* pAttributeElement = new TiXmlElement( "xs:attribute" );
             TiXmlElement* pAttributeElement = new TiXmlElement( "xs:attribute" );
             pAttributeElement->SetAttribute( "name", field.pFieldname );
             pAttributeElement->SetAttribute( "name", field.pFieldname );
             pAttributeElement->SetAttribute( "type", "xs:string" );
             pAttributeElement->SetAttribute( "type", "xs:string" );
             pAttributeElement->SetAttribute( "use", "optional" );
             pAttributeElement->SetAttribute( "use", "optional" );
-            pContentParentElement->LinkEndChild( pAttributeElement );
+            pComplexTypeElement->LinkEndChild( pAttributeElement );
         }
         }
     }
     }