Skip to content
Snippets Groups Projects
Commit 8eaa0777 authored by Tinny Ng's avatar Tinny Ng
Browse files

Schema Fix: should not store a temp value as the key in the element pool and the attribute pool.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@173402 13f79535-47bb-0310-9956-ffa450edef68
parent c8bd0c2e
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
/* /*
* $Log$ * $Log$
* Revision 1.26 2002/01/02 15:20:22 tng
* Schema Fix: should not store a temp value as the key in the element pool and the attribute pool.
*
* Revision 1.25 2001/12/17 21:38:59 tng * Revision 1.25 2001/12/17 21:38:59 tng
* Fix dangling pointer. * Fix dangling pointer.
* *
...@@ -285,7 +288,7 @@ XMLAttDef* ComplexTypeInfo::findAttr(const XMLCh* const qName ...@@ -285,7 +288,7 @@ XMLAttDef* ComplexTypeInfo::findAttr(const XMLCh* const qName
// And add a default attribute for this name // And add a default attribute for this name
retVal = new SchemaAttDef(prefix, baseName, uriId); retVal = new SchemaAttDef(prefix, baseName, uriId);
retVal->setElemId(getElementId()); retVal->setElemId(getElementId());
fAttDefs->put((void*)baseName, uriId, retVal); fAttDefs->put((void*)retVal->getAttName()->getLocalPart(), uriId, retVal);
wasAdded = true; wasAdded = true;
} }
......
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
/* /*
* $Log$ * $Log$
* Revision 1.18 2002/01/02 15:20:22 tng
* Schema Fix: should not store a temp value as the key in the element pool and the attribute pool.
*
* Revision 1.17 2001/11/02 14:13:45 knoaman * Revision 1.17 2001/11/02 14:13:45 knoaman
* Add support for identity constraints. * Add support for identity constraints.
* *
...@@ -229,7 +232,7 @@ XMLAttDef* SchemaElementDecl::findAttr(const XMLCh* const qName ...@@ -229,7 +232,7 @@ XMLAttDef* SchemaElementDecl::findAttr(const XMLCh* const qName
// And add a default attribute for this name // And add a default attribute for this name
retVal = new SchemaAttDef(prefix, baseName, uriId); retVal = new SchemaAttDef(prefix, baseName, uriId);
retVal->setElemId(getId()); retVal->setElemId(getId());
fAttDefs->put((void*)baseName, uriId, retVal); fAttDefs->put((void*)retVal->getAttName()->getLocalPart(), uriId, retVal);
wasAdded = true; wasAdded = true;
} }
......
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
/* /*
* $Log$ * $Log$
* Revision 1.11 2002/01/02 15:20:22 tng
* Schema Fix: should not store a temp value as the key in the element pool and the attribute pool.
*
* Revision 1.10 2001/11/19 18:26:31 knoaman * Revision 1.10 2001/11/19 18:26:31 knoaman
* no message * no message
* *
...@@ -175,7 +178,7 @@ XMLElementDecl* SchemaGrammar::findOrAddElemDecl (const unsigned int uriId ...@@ -175,7 +178,7 @@ XMLElementDecl* SchemaGrammar::findOrAddElemDecl (const unsigned int uriId
if (!retVal) if (!retVal)
{ {
retVal = new SchemaElementDecl(prefixName, baseName, uriId, SchemaElementDecl::Any); retVal = new SchemaElementDecl(prefixName, baseName, uriId, SchemaElementDecl::Any);
const unsigned int elemId = fElemDeclPool->put((void*)baseName, uriId, scope, retVal); const unsigned int elemId = fElemDeclPool->put((void*)retVal->getBaseName(), uriId, scope, retVal);
retVal->setId(elemId); retVal->setId(elemId);
wasAdded = true; wasAdded = true;
} }
...@@ -193,7 +196,7 @@ XMLElementDecl* SchemaGrammar::putElemDecl (const unsigned int uriId ...@@ -193,7 +196,7 @@ XMLElementDecl* SchemaGrammar::putElemDecl (const unsigned int uriId
, unsigned int scope) , unsigned int scope)
{ {
SchemaElementDecl* retVal = new SchemaElementDecl(prefixName, baseName, uriId, SchemaElementDecl::Any); SchemaElementDecl* retVal = new SchemaElementDecl(prefixName, baseName, uriId, SchemaElementDecl::Any);
const unsigned int elemId = fElemDeclPool->put((void*)baseName, uriId, scope, retVal); const unsigned int elemId = fElemDeclPool->put((void*)retVal->getBaseName(), uriId, scope, retVal);
retVal->setId(elemId); retVal->setId(elemId);
return retVal; return retVal;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment