You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2001/11/26 21:43:55 UTC
cvs commit: xml-xerces/c/src/validators/schema TraverseSchema.hpp TraverseSchema.cpp
knoaman 01/11/26 12:43:55
Modified: c/src/validators/schema TraverseSchema.hpp
TraverseSchema.cpp
Log:
anyType fix.
Revision Changes Path
1.29 +3 -2 xml-xerces/c/src/validators/schema/TraverseSchema.hpp
Index: TraverseSchema.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/schema/TraverseSchema.hpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- TraverseSchema.hpp 2001/11/20 20:21:49 1.28
+++ TraverseSchema.hpp 2001/11/26 20:43:54 1.29
@@ -55,7 +55,7 @@
*/
/*
- * $Id: TraverseSchema.hpp,v 1.28 2001/11/20 20:21:49 knoaman Exp $
+ * $Id: TraverseSchema.hpp,v 1.29 2001/11/26 20:43:54 knoaman Exp $
*/
#if !defined(TRAVERSESCHEMA_HPP)
@@ -438,7 +438,8 @@
const XMLCh* const baseRawName,
const XMLCh* const baseLocalPart,
const XMLCh* const baseURI,
- const bool isMixed);
+ const bool isMixed,
+ const bool isBaseAnyType = false);
/**
* Process "base" information for a complexType
1.65 +24 -6 xml-xerces/c/src/validators/schema/TraverseSchema.cpp
Index: TraverseSchema.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/schema/TraverseSchema.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- TraverseSchema.cpp 2001/11/21 16:15:34 1.64
+++ TraverseSchema.cpp 2001/11/26 20:43:54 1.65
@@ -55,7 +55,7 @@
*/
/*
- * $Id: TraverseSchema.cpp,v 1.64 2001/11/21 16:15:34 tng Exp $
+ * $Id: TraverseSchema.cpp,v 1.65 2001/11/26 20:43:54 knoaman Exp $
*/
// ---------------------------------------------------------------------------
@@ -3516,12 +3516,16 @@
const XMLCh* prefix = getPrefix(baseName);
const XMLCh* localPart = getLocalPart(baseName);
const XMLCh* uri = resolvePrefixToURI(prefix);
+ bool isBaseAnyType = false;
// -------------------------------------------------------------
// check if the base is "anyType"
// -------------------------------------------------------------
- if (!(XMLString::compareString(uri, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) == 0
- && XMLString::compareString(localPart, SchemaSymbols::fgATTVAL_ANYTYPE) == 0)) {
+ if (XMLString::compareString(uri, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) == 0 &&
+ XMLString::compareString(localPart, SchemaSymbols::fgATTVAL_ANYTYPE) == 0) {
+ isBaseAnyType = true;
+ }
+ else {
processBaseTypeInfo(baseName, localPart, uri, typeInfo);
@@ -3542,7 +3546,7 @@
XUtil::getFirstChildElement(complexContent), true);
processComplexContent(typeName, content, typeInfo, baseName, localPart,
- uri, mixedContent);
+ uri, mixedContent, isBaseAnyType);
if (XUtil::getNextSiblingElement(complexContent) != 0) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::InvalidChildInComplexContent);
@@ -5306,7 +5310,8 @@
const XMLCh* const baseRawName,
const XMLCh* const baseLocalPart,
const XMLCh* const baseURI,
- const bool isMixed) {
+ const bool isMixed,
+ const bool isBaseAnyType) {
ContentSpecNode* specNode = 0;
DOM_Element attrNode;
@@ -5451,7 +5456,8 @@
if (!specNode) {
if (baseSpecNode) {
- typeInfo->setContentSpec(new ContentSpecNode(*baseSpecNode));
+ specNode = new ContentSpecNode(*baseSpecNode);
+ typeInfo->setContentSpec(specNode);
typeInfo->setAdoptContentSpec(true);
}
}
@@ -5467,6 +5473,18 @@
}
}
else {
+
+ if (isBaseAnyType) {
+
+ QName elemName(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, fEmptyNamespaceURI);
+ specNode = new ContentSpecNode(&elemName);
+ specNode->setType(ContentSpecNode::Any);
+ specNode->setMinOccurs(0);
+ specNode->setMaxOccurs(SchemaSymbols::UNBOUNDED);
+ typeInfo->setContentSpec(specNode);
+ typeInfo->setContentType(SchemaElementDecl::Mixed_Complex);
+ }
+
typeInfo->setDerivedBy(0);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org