X-Git-Url: http://drtracing.org/?a=blobdiff_plain;ds=inline;f=xsdconvert%2FSimpleType.hh;h=4e59ea83f321f7870ac6309c5b39f8696afda3d9;hb=51fa56b97ff178aa82497de54a5945698517e55d;hp=c4ea1069f12120d5282db39ceb35d321bf784718;hpb=50c8d3f664cb14bf653c700e98de9af66233c979;p=deliverable%2Ftitan.core.git diff --git a/xsdconvert/SimpleType.hh b/xsdconvert/SimpleType.hh index c4ea106..4e59ea8 100644 --- a/xsdconvert/SimpleType.hh +++ b/xsdconvert/SimpleType.hh @@ -218,12 +218,27 @@ protected: // XSD Type of the type TagName xsdtype; bool isOptional; - Mstring substitionGroup; + Mstring substitutionGroup; + //Pointer to the generated element substitution group ComplexType * subsGroup; + //Pointer to the generated type substitution group + ComplexType * typeSubsGroup; + //To determine if already added to type substitution + bool addedToTypeSubstitution; BlockValue block; + + //Element substitution + void addToSubstitutions(); + //Type substitution + void addToTypeSubstitutions(); + //Returns the type substitution which the builtInType belongs + ComplexType * findBuiltInTypeInStoredTypeSubstitutions(const Mstring& builtInType); - void addToSubstitutions(); + //Only used when type substitution is enabled + //If an element reference is found then it is put to a container + //to know if type substitution is possible + void collectElementTypes(SimpleType * found_ST = NULL, ComplexType * found_CT = NULL); void nameConversion_names(); virtual void nameConversion_types(const List & ns); @@ -338,14 +353,22 @@ public: return subsGroup; } + ComplexType * getTypeSubstitution() const { + return typeSubsGroup; + } + BlockValue getBlock() const { return block; } void addToNameDepList(SimpleType * t) { + //If the type has a substitution, we add the namedep to the substitution if(subsGroup != NULL && this != (SimpleType*)subsGroup){ SimpleType * substitution = (SimpleType*)subsGroup; substitution->addToNameDepList(t); + }else if(typeSubsGroup != NULL && this != (SimpleType*)typeSubsGroup){ + SimpleType * substitution = (SimpleType*)typeSubsGroup; + substitution->addToNameDepList(t); }else { nameDepList.push_back(t); }