knoaman 2003/12/29 08:15:42
Modified: c/src/xercesc/internal XSObjectFactory.hpp
XSObjectFactory.cpp
c/src/xercesc/framework/psvi XSModel.cpp
XSAttributeDeclaration.cpp
c/src/xercesc/validators/schema TraverseSchema.cpp
Log:
More PSVI updates
Revision Changes Path
1.7 +9 -2 xml-xerces/c/src/xercesc/internal/XSObjectFactory.hpp
Index: XSObjectFactory.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XSObjectFactory.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XSObjectFactory.hpp 24 Dec 2003 17:42:02 -0000 1.6
+++ XSObjectFactory.hpp 29 Dec 2003 16:15:41 -0000 1.7
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.7 2003/12/29 16:15:41 knoaman
+ * More PSVI updates
+ *
* Revision 1.6 2003/12/24 17:42:02 knoaman
* Misc. PSVI updates
*
@@ -247,13 +250,11 @@
(
void* key
, XSObject* const object
- , XSModel* const xsModel
);
XSObject* getObjectFromMap
(
void* key
- , XSModel* const xsModel
);
void processFacets
@@ -282,6 +283,12 @@
RefHashTableOf<XSObject>* fXercesToXSMap;
RefVectorOf<XSObject>* fDeleteVector;
};
+
+inline XSObject* XSObjectFactory::getObjectFromMap(void* key)
+{
+ return fXercesToXSMap->get(key);
+}
+
XERCES_CPP_NAMESPACE_END
1.14 +18 -26 xml-xerces/c/src/xercesc/internal/XSObjectFactory.cpp
Index: XSObjectFactory.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XSObjectFactory.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- XSObjectFactory.cpp 24 Dec 2003 17:42:02 -0000 1.13
+++ XSObjectFactory.cpp 29 Dec 2003 16:15:41 -0000 1.14
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.14 2003/12/29 16:15:41 knoaman
+ * More PSVI updates
+ *
* Revision 1.13 2003/12/24 17:42:02 knoaman
* Misc. PSVI updates
*
@@ -326,8 +329,7 @@
XSModel* const xsModel,
XSComplexTypeDefinition* const enclosingTypeDef)
{
- XSAttributeDeclaration* xsObj = (XSAttributeDeclaration*)
getObjectFromMap(attDef, xsModel);
-
+ XSAttributeDeclaration* xsObj = (XSAttributeDeclaration*)
xsModel->getXSObject(attDef);
if (xsObj)
{
if (xsObj->getScope() == XSConstants::SCOPE_LOCAL
@@ -362,7 +364,7 @@
, enclosingCTDefinition
, fMemoryManager
);
- putObjectInMap(attDef, xsObj, xsModel);
+ putObjectInMap(attDef, xsObj);
}
return xsObj;
@@ -373,7 +375,7 @@
XSModel* const xsModel,
bool isAnySimpleType)
{
- XSSimpleTypeDefinition* xsObj = (XSSimpleTypeDefinition*)
getObjectFromMap(validator, xsModel);
+ XSSimpleTypeDefinition* xsObj = (XSSimpleTypeDefinition*)
xsModel->getXSObject(validator);
if (!xsObj)
{
XSSimpleTypeDefinition* baseType = 0;
@@ -459,7 +461,7 @@
, xsModel
, fMemoryManager
);
- putObjectInMap(validator, xsObj, xsModel);
+ putObjectInMap(validator, xsObj);
if (primitiveTypeSelf)
xsObj->setPrimitiveType(xsObj);
@@ -477,7 +479,7 @@
XSModel* const xsModel,
XSComplexTypeDefinition* const enclosingTypeDef)
{
- XSElementDeclaration* xsObj = (XSElementDeclaration*)
getObjectFromMap(elemDecl, xsModel);
+ XSElementDeclaration* xsObj = (XSElementDeclaration*)
xsModel->getXSObject(elemDecl);
if (xsObj)
{
if (!xsObj->getEnclosingCTDefinition() && enclosingTypeDef)
@@ -548,7 +550,7 @@
, enclosingTypeDef
, fMemoryManager
);
- putObjectInMap(elemDecl, xsObj, xsModel);
+ putObjectInMap(elemDecl, xsObj);
if (elemDecl->getComplexTypeInfo())
{
@@ -573,7 +575,7 @@
XSObjectFactory::addOrFind(ComplexTypeInfo* const typeInfo,
XSModel* const xsModel)
{
- XSComplexTypeDefinition* xsObj = (XSComplexTypeDefinition*)
getObjectFromMap(typeInfo, xsModel);
+ XSComplexTypeDefinition* xsObj = (XSComplexTypeDefinition*)
xsModel->getXSObject(typeInfo);
if (!xsObj)
{
XSWildcard* xsWildcard = 0;
@@ -628,7 +630,7 @@
, xsModel
, fMemoryManager
);
- putObjectInMap(typeInfo, xsObj, xsModel);
+ putObjectInMap(typeInfo, xsObj);
if (isAnyType)
xsObj->setBaseType(xsObj);
@@ -671,7 +673,7 @@
XSIDCDefinition* XSObjectFactory::addOrFind(IdentityConstraint* const ic,
XSModel* const xsModel)
{
- XSIDCDefinition* xsObj = (XSIDCDefinition*) getObjectFromMap(ic, xsModel);
+ XSIDCDefinition* xsObj = (XSIDCDefinition*) xsModel->getXSObject(ic);
if (!xsObj)
{
XSIDCDefinition* keyIC = 0;
@@ -706,7 +708,7 @@
, xsModel
, fMemoryManager
);
- putObjectInMap(ic, xsObj, xsModel);
+ putObjectInMap(ic, xsObj);
}
return xsObj;
@@ -715,7 +717,7 @@
XSNotationDeclaration* XSObjectFactory::addOrFind(XMLNotationDecl* const notDecl,
XSModel* const xsModel)
{
- XSNotationDeclaration* xsObj = (XSNotationDeclaration*)
getObjectFromMap(notDecl, xsModel);
+ XSNotationDeclaration* xsObj = (XSNotationDeclaration*)
xsModel->getXSObject(notDecl);
if (!xsObj)
{
xsObj = new (fMemoryManager) XSNotationDeclaration
@@ -725,7 +727,7 @@
, xsModel
, fMemoryManager
);
- putObjectInMap(notDecl, xsObj, xsModel);
+ putObjectInMap(notDecl, xsObj);
}
return xsObj;
@@ -878,17 +880,7 @@
}
-XSObject* XSObjectFactory::getObjectFromMap(void* key, XSModel* const xsModel)
-{
- XSObject* xsObj = fXercesToXSMap->get(key);
- if (xsObj)
- return xsObj;
- if (xsModel->fParent)
- return getObjectFromMap(key, xsModel->fParent);
- return 0;
-}
-
-void XSObjectFactory::putObjectInMap(void* key, XSObject* const object, XSModel*
const xsModel)
+void XSObjectFactory::putObjectInMap(void* key, XSObject* const object)
{
fXercesToXSMap->put(key, object);
fDeleteVector->addElement(object);
@@ -1046,8 +1038,8 @@
{
constraintType = XSConstants::VC_DEFAULT;
}
- else if (attDef->getDefaultType() & XMLAttDef::Fixed ||
- attDef->getDefaultType() & XMLAttDef::Required_And_Fixed)
+ else if ((attDef->getDefaultType() == XMLAttDef::Fixed) ||
+ (attDef->getDefaultType() == XMLAttDef::Required_And_Fixed))
{
constraintType = XSConstants::VC_FIXED;
}
1.16 +9 -1 xml-xerces/c/src/xercesc/framework/psvi/XSModel.cpp
Index: XSModel.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSModel.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- XSModel.cpp 24 Dec 2003 17:42:02 -0000 1.15
+++ XSModel.cpp 29 Dec 2003 16:15:42 -0000 1.16
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.16 2003/12/29 16:15:42 knoaman
+ * More PSVI updates
+ *
* Revision 1.15 2003/12/24 17:42:02 knoaman
* Misc. PSVI updates
*
@@ -878,7 +881,12 @@
XSObject* XSModel::getXSObject(void* key)
{
- return fObjFactory->getObjectFromMap(key, this);
+ XSObject* xsObj = fObjFactory->getObjectFromMap(key);
+
+ if (!xsObj && fParent)
+ xsObj = fParent->getXSObject(key);
+
+ return xsObj;
}
1.8 +7 -2
xml-xerces/c/src/xercesc/framework/psvi/XSAttributeDeclaration.cpp
Index: XSAttributeDeclaration.cpp
===================================================================
RCS file:
/home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSAttributeDeclaration.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- XSAttributeDeclaration.cpp 21 Nov 2003 22:34:45 -0000 1.7
+++ XSAttributeDeclaration.cpp 29 Dec 2003 16:15:42 -0000 1.8
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.8 2003/12/29 16:15:42 knoaman
+ * More PSVI updates
+ *
* Revision 1.7 2003/11/21 22:34:45 neilg
* More schema component model implementation, thanks to David Cargill.
* In particular, this cleans up and completes the XSModel, XSNamespaceItem,
@@ -149,8 +152,8 @@
if (fAttDef->getDefaultType() & XMLAttDef::Default)
return XSConstants::VC_DEFAULT;
- if (fAttDef->getDefaultType() & XMLAttDef::Fixed ||
- fAttDef->getDefaultType() & XMLAttDef::Required_And_Fixed)
+ if ((fAttDef->getDefaultType() == XMLAttDef::Fixed) ||
+ (fAttDef->getDefaultType() == XMLAttDef::Required_And_Fixed))
return XSConstants::VC_FIXED;
return XSConstants::VC_NONE;
1.105 +5 -5 xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp
Index: TraverseSchema.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -r1.104 -r1.105
--- TraverseSchema.cpp 24 Dec 2003 17:42:02 -0000 1.104
+++ TraverseSchema.cpp 29 Dec 2003 16:15:42 -0000 1.105
@@ -3591,15 +3591,15 @@
try {
- typeInfo->setDatatypeValidator
- (
+ DatatypeValidator* simpleDV =
fDatatypeRegistry->createDatatypeValidator
(
qualifiedName,
typeInfo->getBaseDatatypeValidator(),
facets, enums, false, 0, true, fMemoryManager
- )
- );
+ );
+ simpleDV->setAnonymous();
+ typeInfo->setDatatypeValidator(simpleDV);
}
catch (const XMLException& excep) {
reportSchemaError(simpleContent, XMLUni::fgValidityDomain,
XMLValid::DisplayErrorMessage, excep.getMessage());
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]