33 typesArray =
new XSDType *[nSize = 10];
77 std::map<std::string,int>::const_iterator it =
79 it != basicTypes.end();
91 for (map < string, int >::iterator it = Id.begin(); it != Id.end();
110 if (type_name.empty())
114 ostringstream tmp_name_str;
115 tmp_name_str <<
"type" << numTypes;
116 type_name = tmp_name_str.str();
125 if ((i = Id[type_name]) != 0)
137 Id[type_name] = currentId;
139 typesArray[numTypes] = type;
143 return currentId - 1;
175 if (typeId == 0 && create)
182 typesArray[numTypes] = 0;
185 typeId = currentId - 1;
198 for (
unsigned int i = 0; i < extRefs_.size(); i++)
199 if (extRefs_[i].qname == type)
200 return extRefs_[i].localTypeId;
203 er.qname = (pType)?pType->
getQname():type;
204 er.localTypeId = currentId;
205 extRefs_.push_back(er);
207 typesArray[numTypes] =
const_cast<XSDType*
>(pType);
218 if (index >= numTypes)
220 typesArray[index] = type;
225void TypesTable::ensureCapacity()
227 if (numTypes >= nSize)
230 for (
int ind = 0; ind < nSize; ind++)
231 tempArray[ind] = typesArray[ind];
233 typesArray = tempArray;
234 nSize = numTypes + 5;
251 int *xPath,
int limits,
int &offset)
253 int childId = 0, type = 0, i = 0, childIndex;
255 if (xPath == 0 || limits == 0)
260 if (pType->isSimple())
262 ComplexType *ct = (ComplexType *) pType;
263 for (i = 0; i < ct->getNumChildren(); i++)
264 if (ct->getChildName(i) == childName)
266 childId = ct->getChildType(i);
276 for (
int i = 0; i < ct->getNumChildren() && !childId; i++)
280 limits - 1, ++offset))
290 xPath[0] = childIndex;
301 for (
int i = 0; i < numTypes; i++)
302 if (typesArray[i] == 0)
311 for (
int i = 0; i < numTypes; i++)
312 if (typesArray[i] != 0)
314 if (!typesArray[i]->isSimple())
326 for (
int i = 0; i < numTypes; i++)
327 if (typesArray[i] != 0)
329 if (!typesArray[i]->isSimple())
341 for (map < string, int >::iterator it = Id.begin(); it != Id.end();
345 out <<
"Could not find {"<<m_tnsUri <<
"}:" << it->first << std::endl;
std::string getLocalName(void) const
std::string getNamespace(void) const
void matchAttributeRef(const std::string &name, Attribute &a)
void matchElementRef(const std::string &name, Element &e)
int getCompleteXpath(int elemId, std::string &childName, int *xPath, int limits, int &offset)
std::string getAtomicTypeName(Schema::Type t) const
bool detectUndefinedTypes(void)
void resolveForwardElementRefs(const std::string &name, Element &e)
int addExtType(XSDType *type, int id)
XSDType * getTypePtr(int id) const
int addExternalTypeId(const Qname &type, const XSDType *pType)
int addType(XSDType *type)
int getTypeId(const Qname &name, bool create=false)
void printUndefinedTypes(std::ostream &out)
void resolveForwardAttributeRefs(const std::string &name, Attribute &a)
virtual void setAnonymous(bool)
virtual void setTypeId(int)
virtual void setName(std::string)
const std::string SchemaUri