neilg 2003/11/10 13:56:54
Modified: c/src/xercesc/parsers AbstractDOMParser.cpp
c/src/xercesc/dom/deprecated DOMParser.cpp
c/src/xercesc/internal DGXMLScanner.cpp IGXMLScanner.cpp
IGXMLScanner2.cpp SGXMLScanner.cpp
c/src/xercesc/validators/DTD DTDValidator.cpp
c/src/xercesc/validators/schema SchemaValidator.cpp
c/src/xercesc/framework/psvi XSComplexTypeDefinition.cpp
Log:
make internal code use the new, stateless, method of traversing attribute lists
Revision Changes Path
1.54 +5 -5 xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.cpp
Index: AbstractDOMParser.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- AbstractDOMParser.cpp 6 Nov 2003 15:30:07 -0000 1.53
+++ AbstractDOMParser.cpp 10 Nov 2003 21:56:52 -0000 1.54
@@ -975,9 +975,9 @@
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)
@@ -1352,9 +1352,9 @@
DOMElement *elem = fDocument->createElement(elemDecl.getFullName());
DOMElementImpl *elemImpl = (DOMElementImpl *) elem;
- while (defAttrs->hasMoreElements())
+ for(unsigned int i=0; i<defAttrs->getAttDefCount(); i++)
{
- attr = &defAttrs->nextElement();
+ attr = &defAttrs->getAttDef(i);
if (attr->getValue() != 0)
{
if (fScanner->getDoNamespaces())
1.29 +3 -3 xml-xerces/c/src/xercesc/dom/deprecated/DOMParser.cpp
Index: DOMParser.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/deprecated/DOMParser.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- DOMParser.cpp 6 Nov 2003 15:30:04 -0000 1.28
+++ DOMParser.cpp 10 Nov 2003 21:56:52 -0000 1.29
@@ -1194,9 +1194,9 @@
DOM_Element dom_elem = fDocument.createElement(elemDecl.getFullName());
ElementImpl* elem = (ElementImpl*)(dom_elem.fImpl);
- while (defAttrs->hasMoreElements())
+ for(unsigned int i=0; i<defAttrs->getAttDefCount(); i++)
{
- attr = &defAttrs->nextElement();
+ attr = &defAttrs->getAttDef(i);
if (attr->getValue() != null)
{
if (fScanner->getDoNamespaces())
1.28 +3 -3 xml-xerces/c/src/xercesc/internal/DGXMLScanner.cpp
Index: DGXMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/DGXMLScanner.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- DGXMLScanner.cpp 1 Nov 2003 20:24:22 -0000 1.27
+++ DGXMLScanner.cpp 10 Nov 2003 21:56:53 -0000 1.28
@@ -1912,10 +1912,10 @@
if (hasDefs)
{
XMLAttDefList& attDefList = elemDecl->getAttDefList();
- while (attDefList.hasMoreElements())
+ for(unsigned int i=0; i<attDefList.getAttDefCount(); i++)
{
// Get the current att def, for convenience and its def type
- XMLAttDef& curDef = attDefList.nextElement();
+ XMLAttDef& curDef = attDefList.getAttDef(i);
if (!curDef.getProvided() && curDef.getCreateReason() !=
XMLAttDef::JustFaultIn)
{
1.29 +5 -5 xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp
Index: IGXMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- IGXMLScanner.cpp 4 Nov 2003 14:10:05 -0000 1.28
+++ IGXMLScanner.cpp 10 Nov 2003 21:56:53 -0000 1.29
@@ -1883,10 +1883,10 @@
{
// N.B.: this assumes DTD validation.
XMLAttDefList& attDefList = elemDecl->getAttDefList();
- while (attDefList.hasMoreElements())
+ for(unsigned int i=0; i<attDefList.getAttDefCount(); i++)
{
// Get the current att def, for convenience and its def type
- const XMLAttDef& curDef = attDefList.nextElement();
+ const XMLAttDef& curDef = attDefList.getAttDef(i);
const XMLAttDef::DefAttTypes defType = curDef.getDefaultType();
if (!curDef.getProvided())
@@ -2129,10 +2129,10 @@
if (elemDecl) {
if (elemDecl->hasAttDefs()) {
XMLAttDefList& attDefList = elemDecl->getAttDefList();
- while (attDefList.hasMoreElements())
+ for(unsigned int i=0; i<attDefList.getAttDefCount(); i++)
{
// Get the current att def, for convenience and its def type
- const XMLAttDef& curDef = attDefList.nextElement();
+ const XMLAttDef& curDef = attDefList.getAttDef(i);
const XMLAttDef::DefAttTypes defType = curDef.getDefaultType();
// update the NSMap if there are any default/fixed xmlns
attributes
1.39 +3 -3 xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp
Index: IGXMLScanner2.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- IGXMLScanner2.cpp 4 Nov 2003 14:08:30 -0000 1.38
+++ IGXMLScanner2.cpp 10 Nov 2003 21:56:53 -0000 1.39
@@ -543,10 +543,10 @@
XMLAttDefList &attDefList = getAttDefList(fGrammarType ==
Grammar::SchemaGrammarType, currType, elemDecl);
- while (attDefList.hasMoreElements())
+ for(unsigned int i=0; i<attDefList.getAttDefCount(); i++)
{
// Get the current att def, for convenience and its def type
- const XMLAttDef *curDef = &attDefList.nextElement();
+ const XMLAttDef *curDef = &attDefList.getAttDef(i);
const XMLAttDef::DefAttTypes defType = curDef->getDefaultType();
if (!curDef->getProvided())
1.47 +3 -3 xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp
Index: SGXMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- SGXMLScanner.cpp 4 Nov 2003 14:10:05 -0000 1.46
+++ SGXMLScanner.cpp 10 Nov 2003 21:56:53 -0000 1.47
@@ -2411,10 +2411,10 @@
XMLAttDefList& attDefList = getAttDefList(currType, elemDecl);
- while (attDefList.hasMoreElements())
+ for(unsigned int i=0; i<attDefList.getAttDefCount(); i++)
{
// Get the current att def, for convenience and its def type
- XMLAttDef *curDef = &attDefList.nextElement();
+ XMLAttDef *curDef = &attDefList.getAttDef(i);
const XMLAttDef::DefAttTypes defType = curDef->getDefaultType();
if (!curDef->getProvided())
1.15 +3 -3 xml-xerces/c/src/xercesc/validators/DTD/DTDValidator.cpp
Index: DTDValidator.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/DTD/DTDValidator.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- DTDValidator.cpp 16 May 2003 21:43:19 -0000 1.14
+++ DTDValidator.cpp 10 Nov 2003 21:56:54 -0000 1.15
@@ -529,9 +529,9 @@
//
XMLAttDefList& attDefList = curElem.getAttDefList();
bool seenId = false;
- while (attDefList.hasMoreElements())
+ for(unsigned int i=0; i<attDefList.getAttDefCount(); i++)
{
- const XMLAttDef& curAttDef = attDefList.nextElement();
+ const XMLAttDef& curAttDef = attDefList.getAttDef(i);
if (curAttDef.getType() == XMLAttDef::ID)
{
1.41 +6 -3 xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp
Index: SchemaValidator.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- SchemaValidator.cpp 7 Nov 2003 17:08:12 -0000 1.40
+++ SchemaValidator.cpp 10 Nov 2003 21:56:54 -0000 1.41
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.41 2003/11/10 21:56:54 neilg
+ * make internal code use the new, stateless, method of traversing attribute lists
+ *
* Revision 1.40 2003/11/07 17:08:12 knoaman
* For PSVI support, distinguish wildcard elements with namespace lists.
*
@@ -1085,9 +1088,9 @@
if (curElem.hasAttDefs()) {
XMLAttDefList& attDefList = curElem.getAttDefList();
bool seenId = false;
- while (attDefList.hasMoreElements())
+ for(unsigned int i=0; i<attDefList.getAttDefCount(); i++)
{
- const XMLAttDef& curAttDef = attDefList.nextElement();
+ const XMLAttDef& curAttDef = attDefList.getAttDef(i);
if (curAttDef.getType() == XMLAttDef::ID)
{
1.3 +7 -3
xml-xerces/c/src/xercesc/framework/psvi/XSComplexTypeDefinition.cpp
Index: XSComplexTypeDefinition.cpp
===================================================================
RCS file:
/home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSComplexTypeDefinition.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XSComplexTypeDefinition.cpp 6 Nov 2003 15:30:04 -0000 1.2
+++ XSComplexTypeDefinition.cpp 10 Nov 2003 21:56:54 -0000 1.3
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.3 2003/11/10 21:56:54 neilg
+ * make internal code use the new, stateless, method of traversing attribute lists
+ *
* Revision 1.2 2003/11/06 15:30:04 neilg
* first part of PSVI/schema component model implementation, thanks to David
Cargill. This covers setting the PSVIHandler on parser objects, as well as
implementing XSNotation, XSSimpleTypeDefinition, XSIDCDefinition, and most of
XSWildcard, XSComplexTypeDefinition, XSElementDeclaration, XSAttributeDeclaration and
XSAttributeUse.
*
@@ -114,8 +117,9 @@
// REVISIT: size of vector...
fXSAttributeUseList = new (manager) RefVectorOf <XSAttributeUse> (10, true,
manager);
- while (schemaAttDefList.hasMoreElements()) {
- SchemaAttDef& attDef = (SchemaAttDef&) schemaAttDefList.nextElement();
+ for(unsigned int i=0; i<schemaAttDefList.getAttDefCount(); i++)
+ {
+ SchemaAttDef& attDef = (SchemaAttDef&) schemaAttDefList.getAttDef(i);
fXSAttributeUseList->addElement(new (manager) XSAttributeUse(&attDef,
uriStringPool, manager));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]