diff --git a/samples/EnumVal/EnumVal.cpp b/samples/EnumVal/EnumVal.cpp index 3d75c674c4e6e17bb81d22267c6c08d0e890287c..db7366baaea020044a6f4df513876c90a6e73be2 100644 --- a/samples/EnumVal/EnumVal.cpp +++ b/samples/EnumVal/EnumVal.cpp @@ -16,6 +16,9 @@ /* * $Log$ + * Revision 1.25 2005/03/07 20:11:21 knoaman + * Use index to access attributes instead of enumerator. + * * Revision 1.24 2005/01/12 20:43:22 cargilld * Remove warning messages. * @@ -283,9 +286,9 @@ int main(int argC, char* argV[]) { XERCES_STD_QUALIFIER cout << " Attributes:\n"; XMLAttDefList& attList = curElem.getAttDefList(); - while (attList.hasMoreElements()) + for (unsigned int i=0; i<attList.getAttDefCount(); i++) { - const XMLAttDef& curAttDef = attList.nextElement(); + const XMLAttDef& curAttDef = attList.getAttDef(i); XERCES_STD_QUALIFIER cout << " Name:" << StrX(curAttDef.getFullName()) << ", Type: "; diff --git a/samples/SEnumVal/SEnumVal.cpp b/samples/SEnumVal/SEnumVal.cpp index 3e36d0c70b79d6e485792c1727a5c6cab8ce1378..c3573ce2afdd7924be5556de468a22a93f2f748c 100644 --- a/samples/SEnumVal/SEnumVal.cpp +++ b/samples/SEnumVal/SEnumVal.cpp @@ -17,6 +17,9 @@ /* * $Id$ * $Log$ + * Revision 1.20 2005/03/07 20:11:21 knoaman + * Use index to access attributes instead of enumerator. + * * Revision 1.19 2004/09/08 13:55:34 peiyongz * Apache License Version 2.0 * @@ -395,10 +398,10 @@ void processAttributes( XMLAttDefList& attList, bool margin ) } XERCES_STD_QUALIFIER cout << "Attributes:\n"; - while( attList.hasMoreElements() ) + for (unsigned int i=0; i<attList.getAttDefCount(); i++) { // Name - SchemaAttDef& curAttDef = (SchemaAttDef&)attList.nextElement(); + SchemaAttDef& curAttDef = (SchemaAttDef&)attList.getAttDef(i); XERCES_STD_QUALIFIER cout << "\tName:\t\t\t" << StrX(curAttDef.getFullName()) << "\n"; // Type diff --git a/src/xercesc/validators/schema/TraverseSchema.cpp b/src/xercesc/validators/schema/TraverseSchema.cpp index 9104b4e22f62edc81d7945e33f750eddd3d54153..5a1c673031855e18a1213dc4eb0c302e7892c804 100644 --- a/src/xercesc/validators/schema/TraverseSchema.cpp +++ b/src/xercesc/validators/schema/TraverseSchema.cpp @@ -6549,9 +6549,9 @@ void TraverseSchema::processAttributes(const DOMElement* const elem, SchemaAttDefList& baseAttList = (SchemaAttDefList&) baseTypeInfo->getAttDefList(); - while (baseAttList.hasMoreElements()) { + for (unsigned int i=0; i<baseAttList.getAttDefCount(); i++) { - SchemaAttDef& attDef = (SchemaAttDef&) baseAttList.nextElement(); + SchemaAttDef& attDef = (SchemaAttDef&) baseAttList.getAttDef(i); QName* attName = attDef.getAttName(); const XMLCh* localPart = attName->getLocalPart(); @@ -7602,9 +7602,9 @@ void TraverseSchema::checkAttDerivationOK(const DOMElement* const elem, SchemaAttDefList& childAttList = (SchemaAttDefList&) childTypeInfo->getAttDefList(); const SchemaAttDef* baseAttWildCard = baseTypeInfo->getAttWildCard(); - while (childAttList.hasMoreElements()) { + for (unsigned int i=0; i<childAttList.getAttDefCount(); i++) { - SchemaAttDef& childAttDef = (SchemaAttDef&) childAttList.nextElement(); + SchemaAttDef& childAttDef = (SchemaAttDef&) childAttList.getAttDef(i); QName* childAttName = childAttDef.getAttName(); const XMLCh* childLocalPart = childAttName->getLocalPart(); const SchemaAttDef* baseAttDef = baseTypeInfo->getAttDef(childLocalPart, childAttName->getURI()); diff --git a/src/xercesc/validators/schema/XSDDOMParser.cpp b/src/xercesc/validators/schema/XSDDOMParser.cpp index 729f44ff2a642c82c307b3c35c434f5eaec7f418..748fa491fa1ab0c04824f247adfa1637e6195b78 100644 --- a/src/xercesc/validators/schema/XSDDOMParser.cpp +++ b/src/xercesc/validators/schema/XSDDOMParser.cpp @@ -314,9 +314,9 @@ void XSDDOMParser::startElement( const XMLElementDecl& elemDecl XMLAttDef* attr = 0; DOMAttrImpl * insertAttr = 0; - while (defAttrs->hasMoreElements()) + for (unsigned int i=0; i<defAttrs->getAttDefCount(); i++) { - attr = &defAttrs->nextElement(); + attr = &defAttrs->getAttDef(i); const XMLAttDef::DefAttTypes defType = attr->getDefaultType(); if ((defType == XMLAttDef::Default)