You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2001/05/10 19:49:53 UTC
cvs commit: xml-xerces/c/src/validators/schema ComplexTypeInfo.cpp SchemaValidator.cpp TraverseSchema.cpp
tng 01/05/10 10:49:53
Modified: c/src/internal XMLScanner2.cpp
c/src/validators/schema ComplexTypeInfo.cpp
SchemaValidator.cpp TraverseSchema.cpp
Log:
Schema: SchemaValidator fixes
Revision Changes Path
1.28 +3 -3 xml-xerces/c/src/internal/XMLScanner2.cpp
Index: XMLScanner2.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/internal/XMLScanner2.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- XMLScanner2.cpp 2001/05/03 20:34:30 1.27
+++ XMLScanner2.cpp 2001/05/10 17:49:30 1.28
@@ -55,7 +55,7 @@
*/
/*
- * $Id: XMLScanner2.cpp,v 1.27 2001/05/03 20:34:30 tng Exp $
+ * $Id: XMLScanner2.cpp,v 1.28 2001/05/10 17:49:30 tng Exp $
*/
@@ -1170,7 +1170,7 @@
emitError(XMLErrs::BadSchemaLocation);
} else {
for(unsigned int i=0; i<size; i=i+2) {
- resolveSchemaGrammar(schemaLocation->elementAt(i), schemaLocation->elementAt(i+1));
+ resolveSchemaGrammar(schemaLocation->elementAt(i+1), schemaLocation->elementAt(i));
}
}
@@ -1308,7 +1308,7 @@
fValidator->emitError(XMLValid::WrongTargetNamespace, loc, uri);
grammar = new SchemaGrammar();
- TraverseSchema traverseSchema(root, fURIStringPool, grammar, fGrammarResolver, this, fValidator, uri, fEntityResolver);
+ TraverseSchema traverseSchema(root, fURIStringPool, grammar, fGrammarResolver, this, fValidator, srcToFill->getSystemId(), fEntityResolver, fErrorHandler);
}
}
fGrammar = grammar;
1.4 +7 -1 xml-xerces/c/src/validators/schema/ComplexTypeInfo.cpp
Index: ComplexTypeInfo.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/schema/ComplexTypeInfo.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ComplexTypeInfo.cpp 2001/05/10 16:33:12 1.3
+++ ComplexTypeInfo.cpp 2001/05/10 17:49:40 1.4
@@ -56,9 +56,15 @@
/*
* $Log: ComplexTypeInfo.cpp,v $
+ * Revision 1.4 2001/05/10 17:49:40 tng
+ * Schema: SchemaValidator fixes
+ *
* Revision 1.3 2001/05/10 16:33:12 knoaman
* Traverse Schema Part III + error messages.
*
+ * Revision 1.2 2001/05/03 20:34:41 tng
+ * Schema: SchemaValidator update
+ *
* Revision 1.1 2001/04/19 17:43:14 knoaman
* More schema implementation classes.
*
@@ -97,7 +103,7 @@
ComplexTypeInfo::~ComplexTypeInfo()
{
delete [] fTypeName;
-
+
if (fAdoptContentSpec) {
delete fContentSpec;
}
1.5 +8 -0 xml-xerces/c/src/validators/schema/SchemaValidator.cpp
Index: SchemaValidator.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/schema/SchemaValidator.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SchemaValidator.cpp 2001/05/03 20:34:44 1.4
+++ SchemaValidator.cpp 2001/05/10 17:49:42 1.5
@@ -56,6 +56,9 @@
/*
* $Log: SchemaValidator.cpp,v $
+ * Revision 1.5 2001/05/10 17:49:42 tng
+ * Schema: SchemaValidator fixes
+ *
* Revision 1.4 2001/05/03 20:34:44 tng
* Schema: SchemaValidator update
*
@@ -592,6 +595,11 @@
if (fNil && (miscFlags & SchemaSymbols::NILLABLE) == 0 ) {
fNil = false;
emitError(XMLValid::NillNotAllowed, elemDef->getFullName());
+ }
+
+ if (((SchemaElementDecl*) elemDef)->getModelType() == SchemaElementDecl::Simple) {
+ fBufferDatatype = true;
+ fDatatypeBuffer.reset();
}
}
1.3 +232 -226 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TraverseSchema.cpp 2001/05/10 16:33:17 1.2
+++ TraverseSchema.cpp 2001/05/10 17:49:44 1.3
@@ -56,9 +56,15 @@
/*
* $Log: TraverseSchema.cpp,v $
+ * Revision 1.3 2001/05/10 17:49:44 tng
+ * Schema: SchemaValidator fixes
+ *
* Revision 1.2 2001/05/10 16:33:17 knoaman
* Traverse Schema Part III + error messages.
*
+ * Revision 1.1 2001/05/03 19:18:06 knoaman
+ * TraverseSchema Part II.
+ *
*/
// ---------------------------------------------------------------------------
@@ -114,12 +120,12 @@
chLatin_x, chLatin_m, chLatin_l, chLatin_n, chLatin_s, chColon, chNull
};
-const XMLCh fgAnonSNamePrefix[] =
+const XMLCh fgAnonSNamePrefix[] =
{
chLatin_S, chNull
};
-const XMLCh fgAnonCNamePrefix[] =
+const XMLCh fgAnonCNamePrefix[] =
{
chLatin_C, chNull
};
@@ -250,8 +256,8 @@
}
else{
- // for complex type registry, attribute decl registry and
- // namespace mapping, needs to check whether the passed in
+ // for complex type registry, attribute decl registry and
+ // namespace mapping, needs to check whether the passed in
// Grammar was a newly instantiated one.
fComplexTypeRegistry = fSchemaGrammar->getComplexTypeRegistry();
@@ -281,7 +287,7 @@
fSchemaGrammar->setDatatypeRegistry(fDatatypeRegistry);
fSchemaGrammar->setTargetNamespace(fTargetNSURIString);
- fGrammarResolver->putGrammar(fSchemaGrammar->getTargetNamespace(),
+ fGrammarResolver->putGrammar(fSchemaGrammar->getTargetNamespace(),
fSchemaGrammar);
} // end else
@@ -299,9 +305,9 @@
retrieveNamespaceMapping();
- fElementDefaultQualified =
+ fElementDefaultQualified =
fSchemaRootElement.getAttribute(SchemaSymbols::fgATT_ELEMENTFORMDEFAULT).equals(SchemaSymbols::fgATTVAL_QUALIFIED);
- fAttributeDefaultQualified =
+ fAttributeDefaultQualified =
fSchemaRootElement.getAttribute(SchemaSymbols::fgATT_ATTRIBUTEFORMDEFAULT).equals(SchemaSymbols::fgATTVAL_QUALIFIED);
// Get finalDefault/blockDefault values
@@ -325,9 +331,9 @@
/**
* Traverse include
*
- * <include
- * id = ID
- * schemaLocation = anyURI
+ * <include
+ * id = ID
+ * schemaLocation = anyURI
* {any attributes with non-schema namespace . . .}>
* Content: (annotation?)
* </include>
@@ -344,7 +350,7 @@
// ------------------------------------------------------------------
// Get 'schemaLocation' attribute
// ------------------------------------------------------------------
- const XMLCh* schemaLocation =
+ const XMLCh* schemaLocation =
getElementAttValue(elem, SchemaSymbols::fgATT_SCHEMALOCATION);
if (XMLString::stringLen(schemaLocation) == 0) {
@@ -354,7 +360,7 @@
// ------------------------------------------------------------------
// Resolve schema location
- // ------------------------------------------------------------------
+ // ------------------------------------------------------------------
InputSource* srcToFill = resolveSchemaLocation(schemaLocation);
Janitor<InputSource> janSrc(srcToFill);
@@ -413,11 +419,11 @@
if (!root.isNull()) {
- const XMLCh* targetNSURIString =
+ const XMLCh* targetNSURIString =
getElementAttValue(root,SchemaSymbols::fgATT_TARGETNAMESPACE);
if (XMLString::stringLen(targetNSURIString) != 0
- && XMLString::compareString(targetNSURIString,
+ && XMLString::compareString(targetNSURIString,
fTargetNSURIString) != 0){
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::IncludeNamespaceDifference,
schemaLocation, targetNSURIString);
@@ -429,7 +435,7 @@
// --------------------------------------------------------
if (fSchemaInfoRoot == 0) {
- fSchemaInfoRoot =
+ fSchemaInfoRoot =
new SchemaInfo(fElementDefaultQualified,
fAttributeDefaultQualified,
fBlockDefault,
@@ -448,12 +454,12 @@
setCurrentSchemaURL(includeURL);
traverseSchemaHeader();
- // and now we'd better save this stuff!
- fCurrentSchemaInfo =
+ // and now we'd better save this stuff!
+ fCurrentSchemaInfo =
new SchemaInfo(fElementDefaultQualified,
- fAttributeDefaultQualified,
+ fAttributeDefaultQualified,
fBlockDefault,
- fFinalDefault,
+ fFinalDefault,
fCurrentScope,
fCurrentSchemaURL,
fSchemaRootElement,
@@ -496,7 +502,7 @@
// ------------------------------------------------------------------
// Get 'schemaLocation' attribute
// ------------------------------------------------------------------
- const XMLCh* schemaLocation =
+ const XMLCh* schemaLocation =
getElementAttValue(elem, SchemaSymbols::fgATT_SCHEMALOCATION);
if (XMLString::stringLen(schemaLocation) == 0) {
@@ -506,7 +512,7 @@
// ------------------------------------------------------------------
// Resolve schema location
- // ------------------------------------------------------------------
+ // ------------------------------------------------------------------
InputSource* srcToFill = resolveSchemaLocation(schemaLocation);
Janitor<InputSource> janSrc(srcToFill);
@@ -572,7 +578,7 @@
if (!root.isNull()) {
- const XMLCh* targetNSURIString =
+ const XMLCh* targetNSURIString =
getElementAttValue(root,SchemaSymbols::fgATT_TARGETNAMESPACE);
if (XMLString::compareString(targetNSURIString, nameSpace) != 0) {
@@ -601,14 +607,14 @@
/**
* Traverse the Choice, Sequence declaration
*
- * <choice-sequqnce
- * id = ID
+ * <choice-sequqnce
+ * id = ID
* maxOccurs = (nonNegativeInteger | unbounded) : 1
* minOccurs = nonNegativeInteger : 1
* Content: (annotation?, (element | group | choice | sequence | any)*)
* </choice-sequence>
*/
-ContentSpecNode*
+ContentSpecNode*
TraverseSchema::traverseChoiceSequence(const DOM_Element& elem,
const int modelGroupType)
{
@@ -636,34 +642,34 @@
contentSpecNode = new ContentSpecNode(eltQName);
seeParticle = true;
- }
+ }
else if (childName.equals(SchemaSymbols::fgELT_GROUP)) {
contentSpecNode = 0/*traverseGroupDecl(child)*/;
- if (contentSpecNode == 0)
+ if (contentSpecNode == 0)
continue;
seeParticle = true;
- }
+ }
else if (childName.equals(SchemaSymbols::fgELT_CHOICE)) {
- contentSpecNode =
+ contentSpecNode =
traverseChoiceSequence(child,ContentSpecNode::Choice);
seeParticle = true;
- }
+ }
else if (childName.equals(SchemaSymbols::fgELT_SEQUENCE)) {
contentSpecNode =
traverseChoiceSequence(child,ContentSpecNode::Sequence);
seeParticle = true;
- }
+ }
else if (childName.equals(SchemaSymbols::fgELT_ANY)) {
contentSpecNode = traverseAny(child);
seeParticle = true;
- }
+ }
else {
- fBuffer.set(childName.rawBuffer(), childName.length());
+ fBuffer.set(childName.rawBuffer(), childName.length());
reportSchemaError(XMLUni::fgValidityDomain, XMLValid::GroupContentRestricted,
fBuffer.getRawBuffer());
}
@@ -696,14 +702,14 @@
/**
* Traverse SimpleType declaration:
* <simpleType
- * id = ID
+ * id = ID
* name = NCName>
* Content: (annotation? , ((list | restriction | union)))
* </simpleType>
*
* traverse <list>|<restriction>|<union>
*/
-int TraverseSchema::traverseSimpleTypeDecl(const DOM_Element& childElem)
+int TraverseSchema::traverseSimpleTypeDecl(const DOM_Element& childElem)
{
const XMLCh* name = getElementAttValue(childElem,SchemaSymbols::fgATT_NAME);
@@ -769,7 +775,7 @@
/**
* Traverse ComplexType Declaration - CR Implementation.
- *
+ *
* <complexType
* abstract = boolean
* block = #all or (possibly empty) subset of {extension, restriction}
@@ -798,7 +804,7 @@
name = genAnonTypeName(fgAnonCNamePrefix, fComplexTypeAnonCount);
}
-
+
if (!XMLString::isValidNCName(name)) {
//REVISIT - Should we return or continue and save type with wrong name?
@@ -833,7 +839,7 @@
// ------------------------------------------------------------------
// First, handle any ANNOTATION declaration and get next child
// ------------------------------------------------------------------
- DOM_Element child = checkContent(elem, XUtil::getFirstChildElement(elem),
+ DOM_Element child = checkContent(elem, XUtil::getFirstChildElement(elem),
true);
// ------------------------------------------------------------------
@@ -851,7 +857,7 @@
// ------------------------------------------------------------------
try {
if (child == 0) {
- // EMPTY complexType with complexContent
+ // EMPTY complexType with complexContent
processComplexContent(name, child, typeInfo, 0,0,0, false);
}
else {
@@ -910,13 +916,13 @@
typeInfo->setFinalSet(finalSet);
typeInfo->setScopeDefined(scopeDefined);
- if (XMLString::stringLen(lBlock) != 0
+ if (XMLString::stringLen(lBlock) != 0
&& XMLString::compareString(lBlock,SchemaSymbols::fgATTVAL_POUNDALL) != 0
&& ((blockSet & finalBlockValid) == 0)) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::InvalidComplexTypeBlockValue, lBlock);
}
- if (XMLString::stringLen(lFinal) != 0
+ if (XMLString::stringLen(lFinal) != 0
&& XMLString::compareString(lFinal,SchemaSymbols::fgATTVAL_POUNDALL) != 0
&& ((finalSet & finalBlockValid) == 0)) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::InvalidComplexTypeFinalValue, lFinal);
@@ -949,8 +955,8 @@
/**
* Traverse Any declaration
*
- * <any
- * id = ID
+ * <any
+ * id = ID
* maxOccurs = (nonNegativeInteger | unbounded) : 1
* minOccurs = nonNegativeInteger : 1
* namespace = ((##any | ##other) | List of (anyURI |
@@ -1012,10 +1018,10 @@
// ------------------------------------------------------------------
int emptyURI = fURIStringPool->addOrFind(XMLUni::fgZeroLenString);
ContentSpecNode* retSpecNode = 0;
- QName elemName(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString,
+ QName elemName(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString,
fTargetNSURI);
- if (XMLString::stringLen(nameSpace) == 0
+ if (XMLString::stringLen(nameSpace) == 0
|| XMLString::compareString(nameSpace, SchemaSymbols::fgATTVAL_TWOPOUNDANY) == 0) {
retSpecNode = new ContentSpecNode(&elemName);
@@ -1067,7 +1073,7 @@
}
retSpecNode = secondNode;
- delete nameSpaceTokens;
+ delete nameSpaceTokens;
}
return retSpecNode;
@@ -1077,8 +1083,8 @@
/**
* Traverse all
*
- * <all
- * id = ID
+ * <all
+ * id = ID
* maxOccurs = 1 : 1
* minOccurs = (0 | 1) : 1
* {any attributes with non-schema namespace . . .}>
@@ -1117,9 +1123,9 @@
contentSpecNode = new ContentSpecNode(eltQName);
seeParticle = true;
- }
+ }
else {
- fBuffer.set(childName.rawBuffer(), childName.length());
+ fBuffer.set(childName.rawBuffer(), childName.length());
reportSchemaError(0, 0, fBuffer.getRawBuffer()); //Content of all group is restricted to elements only. '{0}' encountered and ignored."
}
@@ -1155,23 +1161,23 @@
/**
* Traverses Schema attribute declaration.
- *
- * <attribute
+ *
+ * <attribute
* fixed = string
* default = string
- * form = qualified | unqualified
- * id = ID
- * name = NCName
- * ref = QName
- * type = QName
+ * form = qualified | unqualified
+ * id = ID
+ * name = NCName
+ * ref = QName
+ * type = QName
* use = optional | prohibited | required : optional
>
* Content: (annotation? , simpleType?)
* <attribute/>
- *
+ *
* @param elem: the declaration of the attribute under consideration
*
- * @param typeInfo: Contains the complex type info of the element to which
+ * @param typeInfo: Contains the complex type info of the element to which
* the attribute declaration is attached.
*
*/
@@ -1205,7 +1211,7 @@
if (nameEmpty && refEmpty) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::NoNameRefAttribute);
return;
- }
+ }
if(XMLString::stringLen(defaultVal) != 0) {
@@ -1235,7 +1241,7 @@
}
// processing 'name'
- if (!XMLString::isValidNCName(name)
+ if (!XMLString::isValidNCName(name)
|| XMLString::compareString(name, XMLUni::fgXMLNSString) == 0) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::InvalidAttributeName, name);
@@ -1282,7 +1288,7 @@
fBuffer.getRawBuffer()) == 0) {
break;
}
-
+
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::InvalidAttributeContent, fBuffer.getRawBuffer());
simpleType = XUtil::getNextSiblingElement(simpleType);
}
@@ -1327,7 +1333,7 @@
}
else if (XMLString::compareString(localPart,XMLUni::fgIDRefsString) == 0) {
attType = XMLAttDef::IDRefs;
- }
+ }
else if (XMLString::compareString(localPart,XMLUni::fgEntityString) == 0) {
attType = XMLAttDef::Entity;
}
@@ -1349,7 +1355,7 @@
if (dv == 0 && XMLString::stringLen(typeURI) == 0) {
- DOM_Element topLevelType =
+ DOM_Element topLevelType =
getTopLevelComponentByName(SchemaSymbols::fgELT_SIMPLETYPE, localPart);
if (topLevelType != 0) {
@@ -1372,7 +1378,7 @@
if (dv == 0
&& XMLString::compareString(typeURI, fTargetNSURIString) == 0) {
- DOM_Element topLevelType =
+ DOM_Element topLevelType =
getTopLevelComponentByName(SchemaSymbols::fgELT_SIMPLETYPE,
localPart);
@@ -1396,11 +1402,11 @@
if (XMLString::stringLen(useVal) != 0) {
- if (XMLString::compareString(useVal,
+ if (XMLString::compareString(useVal,
SchemaSymbols::fgATTVAL_REQUIRED) == 0) {
required = true;
}
- else if (XMLString::compareString(useVal,
+ else if (XMLString::compareString(useVal,
SchemaSymbols::fgATTVAL_PROHIBITED) == 0) {
prohibited = true;
}
@@ -1422,8 +1428,8 @@
}
}
- // create SchemaAttDef
- SchemaAttDef* attDef =
+ // create SchemaAttDef
+ SchemaAttDef* attDef =
new SchemaAttDef(XMLUni::fgZeroLenString, name, uriIndex, attType);
attDef->setDatatypeValidator(dv);
@@ -1465,23 +1471,23 @@
/**
* Traverses Schema element declaration.
- *
- * <element
+ *
+ * <element
* abstract = boolean : false
* block = (#all | List of (substitution | extension | restriction
- * | list | union))
- * default = string
- * final = (#all | List of (extension | restriction))
- * fixed = string
+ * | list | union))
+ * default = string
+ * final = (#all | List of (extension | restriction))
+ * fixed = string
* form = (qualified | unqualified)
- * id = ID
+ * id = ID
* maxOccurs = (nonNegativeInteger | unbounded) : 1
* minOccurs = nonNegativeInteger : 1
- * name = NCName
+ * name = NCName
* nillable = boolean : false
- * ref = QName
- * substitutionGroup = QName
- * type = QName
+ * ref = QName
+ * substitutionGroup = QName
+ * type = QName
* Content: (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*))
* </element>
*
@@ -1608,7 +1614,7 @@
noErrorFound = false;
}
- contentSpecType = SchemaElementDecl::Simple;
+ contentSpecType = SchemaElementDecl::Simple;
anonymousType = true;
content = XUtil::getNextSiblingElement(content);
}
@@ -1627,7 +1633,7 @@
const XMLCh* typeStr = getElementAttValue(elem, SchemaSymbols::fgATT_TYPE);
if (XMLString::stringLen(typeStr) > 0) {
- if (anonymousType) {
+ if (anonymousType) {
noErrorFound = false;
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::ElementWithTypeAndAnonType, name);
@@ -1649,12 +1655,12 @@
}
// Handle the substitutionGroup
- const XMLCh* subsGroupName =
+ const XMLCh* subsGroupName =
getElementAttValue(elem, SchemaSymbols::fgATT_SUBSTITUTIONGROUP);
if (XMLString::stringLen(subsGroupName) != 0) {
- SchemaElementDecl* subsElemDecl =
+ SchemaElementDecl* subsElemDecl =
getSubstituteGroupElemDecl(subsGroupName, noErrorFound);
if (subsElemDecl != 0) {
@@ -1687,7 +1693,7 @@
if (typeInfo == 0 && validator == 0) {
if (noErrorFound) { // ur type
- contentSpecType = SchemaElementDecl::Any;
+ contentSpecType = SchemaElementDecl::Any;
}
else {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::UntypedElement, name);
@@ -1713,7 +1719,7 @@
}
}
- // Now we can handle validation etc. of default and fixed attributes,
+ // Now we can handle validation etc. of default and fixed attributes,
// since we finally have all the type information.
if(XMLString::stringLen(fixed) != 0) {
deflt = fixed;
@@ -1733,13 +1739,13 @@
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::DatatypeValidationFailure, deflt);
}
- if(typeInfo != 0 &&
+ if(typeInfo != 0 &&
(typeInfo->getContentType() != SchemaElementDecl::Mixed &&
typeInfo->getContentType() != SchemaElementDecl::Simple)) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::NotSimpleOrMixedElement, name);
}
}
-
+
// key/keyref/unique processing
// TO DO
@@ -1773,7 +1779,7 @@
const XMLCh* typeName = fStringPool.getValueForId(typeNameIndex);
const XMLCh* baseTypeName = getElementAttValue(content,
SchemaSymbols::fgATT_ITEMTYPE);
-
+
if (XUtil::getNextSiblingElement(content) != 0) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::SimpleTypeContentError);
}
@@ -1822,7 +1828,7 @@
try {
- DatatypeValidator* newValidator =
+ DatatypeValidator* newValidator =
fDatatypeRegistry->getDatatypeValidator(qualifiedName);
if (newValidator == 0) {
@@ -1909,7 +1915,7 @@
facets = new RefHashTableOf<KVStringPair>(29, true);
}
- if (XMLString::compareString(facetStr,
+ if (XMLString::compareString(facetStr,
SchemaSymbols::fgELT_ENUMERATION) == 0) {
// REVISIT
@@ -1925,7 +1931,7 @@
if (isFirstPattern) { // fBuffer.isEmpty() - overhead call
pattern.set(attValue.rawBuffer(), attValueLen);
}
- else { //datatypes: 5.2.4 pattern
+ else { //datatypes: 5.2.4 pattern
isFirstPattern = false;
pattern.append(chPipe);
@@ -1974,7 +1980,7 @@
try {
- DatatypeValidator* newValidator =
+ DatatypeValidator* newValidator =
fDatatypeRegistry->getDatatypeValidator(qualifiedName);
if (newValidator == 0) {
@@ -2003,12 +2009,12 @@
int size = 1;
DOM_Element content = contentElem;
- const XMLCh* const typeName =
+ const XMLCh* const typeName =
fStringPool.getValueForId(typeNameIndex);
const XMLCh* baseTypeName = getElementAttValue(content,
SchemaSymbols::fgATT_MEMBERTYPES);
DatatypeValidator* baseValidator = 0;
- RefVectorOf<DatatypeValidator>* validators =
+ RefVectorOf<DatatypeValidator>* validators =
new RefVectorOf<DatatypeValidator>(4, false);
Janitor<DVRefVector> janValidators(validators);
@@ -2092,7 +2098,7 @@
try {
- DatatypeValidator* newValidator =
+ DatatypeValidator* newValidator =
fDatatypeRegistry->getDatatypeValidator(qualifiedName);
if (newValidator == 0) {
@@ -2111,21 +2117,21 @@
return fStringPool.addOrFind(qualifiedName);
}
+
-
/**
- * Traverse SimpleContent Declaration
- *
- * <simpleContent
- * id = ID
+ * Traverse SimpleContent Declaration
+ *
+ * <simpleContent
+ * id = ID
* {any attributes with non-schema namespace...}>
*
- * Content: (annotation? , (restriction | extension))
+ * Content: (annotation? , (restriction | extension))
* </simpleContent>
*
* <restriction
* base = QNAME
- * id = ID
+ * id = ID
* {any attributes with non-schema namespace...}>
*
* Content: (annotation?, (simpleType?, (minExclusive | minInclusive
@@ -2136,7 +2142,7 @@
*
* <extension
* base = QNAME
- * id = ID
+ * id = ID
* {any attributes with non-schema namespace...}>
* Content: (annotation? , ((attribute | attributeGroup)* , anyAttribute?))
* </extension>
@@ -2151,7 +2157,7 @@
// -----------------------------------------------------------------------
typeInfo->setContentType(SchemaElementDecl::Simple);
- DOM_Element simpleContent =
+ DOM_Element simpleContent =
checkContent(contentDecl, XUtil::getFirstChildElement(contentDecl),false);
// If there are no children, return
@@ -2178,9 +2184,9 @@
}
// -----------------------------------------------------------------------
- // Handle the base type name
+ // Handle the base type name
// -----------------------------------------------------------------------
- const XMLCh* baseName =
+ const XMLCh* baseName =
getElementAttValue(simpleContent, SchemaSymbols::fgATT_BASE);
if (XMLString::stringLen(baseName) == 0) {
@@ -2194,8 +2200,8 @@
const XMLCh* uri = resolvePrefixToURI(prefix);
DatatypeValidator* baseValidator = getDatatypeValidator(uri, localPart);
- if (baseValidator != 0
- && ((baseValidator->getFinalSet()
+ if (baseValidator != 0
+ && ((baseValidator->getFinalSet()
& SchemaSymbols::EXTENSION) == typeInfo->getDerivedBy())) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::DisallowedSimpleTypeExtension,
@@ -2218,9 +2224,9 @@
// Process the content of the derivation
// -----------------------------------------------------------------------
//Skip over any annotations in the restriction or extension elements
- DOM_Element content = checkContent(simpleContent,
+ DOM_Element content = checkContent(simpleContent,
XUtil::getFirstChildElement(simpleContent), true);
-
+
if (typeInfo->getDerivedBy() == SchemaSymbols::RESTRICTION) {
//Schema Spec: 5.11: Complex Type Definition Properties Correct: 2
@@ -2230,7 +2236,7 @@
throw;
}
else {
- typeInfo->setBaseDatatypeValidator(
+ typeInfo->setBaseDatatypeValidator(
typeInfo->getBaseComplexTypeInfo()->getDatatypeValidator());
}
@@ -2239,11 +2245,11 @@
// ---------------------------------------------------------------
// There may be a simple type definition in the restriction
// element. The data type validator will be based on it, if
- // specified
+ // specified
// ---------------------------------------------------------------
if (content.getLocalName().equals(SchemaSymbols::fgELT_SIMPLETYPE)) {
- int simpleTypeNameIndex = traverseSimpleTypeDecl(content);
+ int simpleTypeNameIndex = traverseSimpleTypeDecl(content);
if (simpleTypeNameIndex !=-1) {
@@ -2272,15 +2278,15 @@
fBuffer.set(content.getLocalName().rawBuffer(), content.getLocalName().length());
facetId = fStringPool.addOrFind(fBuffer.getRawBuffer());
facetName = fStringPool.getValueForId(facetId);
-
+
// if not a valid facet, break from the loop
if (!isValidFacet(SchemaSymbols::fgELT_SIMPLECONTENT, facetName)) {
break;
}
-
+
if (content.getNodeType() == DOM_Node::ELEMENT_NODE) {
- DOMString attValue =
+ DOMString attValue =
content.getAttribute(SchemaSymbols::fgATT_VALUE);
if (facets == 0) {
@@ -2289,7 +2295,7 @@
fBuffer.set(attValue.rawBuffer(), attValue.length());
- if (XMLString::compareString(facetName,
+ if (XMLString::compareString(facetName,
SchemaSymbols::fgELT_ENUMERATION) == 0) {
enumData.append(fBuffer.getRawBuffer());
@@ -2301,7 +2307,7 @@
if (isFirstPattern) { // fBuffer.isEmpty() - overhead call
pattern.set(fBuffer.getRawBuffer());
}
- else { //datatypes: 5.2.4 pattern
+ else { //datatypes: 5.2.4 pattern
isFirstPattern = false;
pattern.append(chPipe);
@@ -2320,7 +2326,7 @@
}
}
- content = XUtil::getNextSiblingElement(content);
+ content = XUtil::getNextSiblingElement(content);
}
if (facets != 0) {
@@ -2349,7 +2355,7 @@
);
}
- XMLCh* qualifiedName =
+ XMLCh* qualifiedName =
getQualifiedName(fStringPool.addOrFind(typeName));
try {
@@ -2360,7 +2366,7 @@
(
fDatatypeRegistry->createDatatypeValidator
(
- fStringPool.getValueForId(nameId),
+ fStringPool.getValueForId(nameId),
typeInfo->getBaseDatatypeValidator(),
facets, false, 0
)
@@ -2398,26 +2404,26 @@
processAttributes(content, baseName, localPart, uri, typeInfo);
}
- if (XUtil::getNextSiblingElement(simpleContent) != 0) {
+ if (XUtil::getNextSiblingElement(simpleContent) != 0) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::InvalidChildInSimpleContent);
}
} // End of function traverseSimpleContentDecl
/**
- * Traverse complexContent Declaration
- *
- * <complexContent
- * id = ID
- * mixed = boolean
+ * Traverse complexContent Declaration
+ *
+ * <complexContent
+ * id = ID
+ * mixed = boolean
* {any attributes with non-schema namespace...}>
*
- * Content: (annotation? , (restriction | extension))
+ * Content: (annotation? , (restriction | extension))
* </complexContent>
*
* <restriction
* base = QNAME
- * id = ID
+ * id = ID
* {any attributes with non-schema namespace...}>
*
* Content: (annotation? , (group | all | choice | sequence)?,
@@ -2426,9 +2432,9 @@
*
* <extension
* base = QNAME
- * id = ID
+ * id = ID
* {any attributes with non-schema namespace...}>
- * Content: (annotation? , (group | all | choice | sequence)?,
+ * Content: (annotation? , (group | all | choice | sequence)?,
* ((attribute | attributeGroup)* , anyAttribute?))
* </extension>
*/
@@ -2441,7 +2447,7 @@
// Determine whether the content is mixed, or element-only
// Setting here overrides any setting on the complex type decl
// -----------------------------------------------------------------------
- const XMLCh* const mixed =
+ const XMLCh* const mixed =
getElementAttValue(contentDecl, SchemaSymbols::fgATT_MIXED);
bool mixedContent = isMixed;
@@ -2454,13 +2460,13 @@
}
// -----------------------------------------------------------------------
- // Since the type must have complex content, set the simple type validators
+ // Since the type must have complex content, set the simple type validators
// to null
// -----------------------------------------------------------------------
typeInfo->setDatatypeValidator(0);
typeInfo->setBaseDatatypeValidator(0);
- DOM_Element complexContent =
+ DOM_Element complexContent =
checkContent(contentDecl,XUtil::getFirstChildElement(contentDecl),false);
// If there are no children, return
@@ -2486,9 +2492,9 @@
}
// -----------------------------------------------------------------------
- // Handle the base type name
+ // Handle the base type name
// -----------------------------------------------------------------------
- const XMLCh* baseName =
+ const XMLCh* baseName =
getElementAttValue(contentDecl, SchemaSymbols::fgATT_BASE);
if (XMLString::stringLen(baseName) == 0) {
@@ -2502,14 +2508,14 @@
const XMLCh* uri = resolvePrefixToURI(prefix);
// -------------------------------------------------------------
- // check if the base is "anyType"
+ // check if the base is "anyType"
// -------------------------------------------------------------
if (!(XMLString::compareString(uri, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) == 0
&& XMLString::compareString(localPart, SchemaSymbols::fgATTVAL_ANYTYPE) == 0)) {
processBaseTypeInfo(baseName, localPart, uri, typeInfo);
-
- //Check that the base is a complex type
+
+ //Check that the base is a complex type
if (typeInfo->getBaseComplexTypeInfo() == 0) {
reportSchemaError(XMLUni::fgXMLErrDomain,
@@ -2535,8 +2541,8 @@
/**
- * <anyAttribute
- * id = ID
+ * <anyAttribute
+ * id = ID
* namespace = ##any | ##other | ##local | list of {uri, ##targetNamespace}>
* processContents = (lax | skip | strict) : strict
* Content: (annotation?)
@@ -2588,7 +2594,7 @@
fBuffer.reset();
- if (XMLString::stringLen(nameSpace) == 0
+ if (XMLString::stringLen(nameSpace) == 0
|| XMLString::compareString(nameSpace, SchemaSymbols::fgATTVAL_TWOPOUNDANY) == 0) {
// Do nothing - defaulted already
}
@@ -2618,7 +2624,7 @@
fBuffer.append(separator);
}
- if (XMLString::compareString(token,
+ if (XMLString::compareString(token,
SchemaSymbols::fgATTVAL_TWOPOUNDTRAGETNAMESPACE) == 0) {
fBuffer.append(fTargetNSURIString);
}
@@ -2713,17 +2719,17 @@
if (name.equals(SchemaSymbols::fgELT_ANNOTATION)) {
traverseAnnotationDecl(child);
- }
+ }
else if (name.equals(SchemaSymbols::fgELT_INCLUDE)) {
- traverseInclude(child);
- }
+ traverseInclude(child);
+ }
else if (name.equals(SchemaSymbols::fgELT_IMPORT)) {
- traverseImport(child);
- }
+ traverseImport(child);
+ }
else if (name.equals(SchemaSymbols::fgELT_REDEFINE)) {
- }
+ }
else
break;
}
@@ -2739,11 +2745,11 @@
}
else if (name.equals(SchemaSymbols::fgELT_SIMPLETYPE)) {
traverseSimpleTypeDecl(child);
- }
+ }
else if (name.equals(SchemaSymbols::fgELT_COMPLEXTYPE)) {
traverseComplexTypeDecl(child);
}
- else if (name.equals(SchemaSymbols::fgELT_ELEMENT)) {
+ else if (name.equals(SchemaSymbols::fgELT_ELEMENT)) {
traverseElementDecl(child);
}
else if (name.equals(SchemaSymbols::fgELT_ATTRIBUTEGROUP)) {
@@ -2754,7 +2760,7 @@
}
else if (name.equals(SchemaSymbols::fgELT_GROUP)) {
traverseGroupDecl(child);
- }
+ }
else if (name.equals(SchemaSymbols::fgELT_NOTATION)) {
traverseNotationDecl(child); //TO DO
} else {
@@ -2781,7 +2787,7 @@
if (content.getLocalName().equals(SchemaSymbols::fgELT_ANNOTATION)) {
- traverseAnnotationDecl(contentElem);
+ traverseAnnotationDecl(contentElem);
content = XUtil::getNextSiblingElement(content);
if (content == 0) { // must be followed by content
@@ -2810,7 +2816,7 @@
DatatypeValidator* dv = 0;
- if (XMLString::stringLen(uriStr) == 0
+ if (XMLString::stringLen(uriStr) == 0
|| XMLString::compareString(uriStr, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) == 0) {
dv = fDatatypeRegistry->getDatatypeValidator(localPartStr);
}
@@ -2844,10 +2850,10 @@
}
-DatatypeValidator*
+DatatypeValidator*
TraverseSchema::checkForSimpleTypeValidator(const DOM_Element& content) {
- int typeNameIndex = traverseSimpleTypeDecl(content);
+ int typeNameIndex = traverseSimpleTypeDecl(content);
DatatypeValidator* baseValidator = 0;
if (typeNameIndex != -1) {
@@ -2865,10 +2871,10 @@
return baseValidator;
}
-ComplexTypeInfo*
+ComplexTypeInfo*
TraverseSchema::checkForComplexTypeInfo(const DOM_Element& content) {
- int typeNameIndex = traverseComplexTypeDecl(content);
+ int typeNameIndex = traverseComplexTypeDecl(content);
ComplexTypeInfo* baseTypeInfo = 0;
if (typeNameIndex != -1) {
@@ -2897,12 +2903,12 @@
if (baseValidator == 0) {
- DOM_Element baseTypeNode =
+ DOM_Element baseTypeNode =
getTopLevelComponentByName(SchemaSymbols::fgELT_SIMPLETYPE, localPart);
if (baseTypeNode != 0) {
- traverseSimpleTypeDecl(baseTypeNode);
+ traverseSimpleTypeDecl(baseTypeNode);
baseValidator = getDatatypeValidator(uri, localPart);
}
}
@@ -2926,7 +2932,7 @@
}
-DOM_Element
+DOM_Element
TraverseSchema::getTopLevelComponentByName(const XMLCh* const compCategory,
const XMLCh* const name) {
@@ -2963,9 +2969,9 @@
return XMLUni::fgZeroLenString;
}
- // REVISIT, !!!! a hack: needs to be updated later, cause now we only use
+ // REVISIT, !!!! a hack: needs to be updated later, cause now we only use
// localpart to key build-in datatype.
- if (XMLString::stringLen(prefix) == 0 &&
+ if (XMLString::stringLen(prefix) == 0 &&
XMLString::compareString(uriStr, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) == 0
&& XMLString::stringLen(fTargetNSURIString) == 0) {
@@ -2979,7 +2985,7 @@
bool TraverseSchema::isTopLevelComponent(const DOM_Element& elem) {
DOMString parentName = elem.getParentNode().getLocalName();
-
+
fBuffer.set(parentName.rawBuffer(), parentName.length());
XMLCh* nameStr = fBuffer.getRawBuffer();
@@ -3011,14 +3017,14 @@
}
unsigned int elemIndex = fSchemaGrammar->getElemId(eltName->getURI(),
- localPart, 0,
+ localPart, 0,
Grammar::TOP_LEVEL_SCOPE);
//if not found, traverse the top level element that if referenced
if (elemIndex == XMLElementDecl::fgInvalidElemId) {
- DOM_Element targetElem =
- getTopLevelComponentByName(SchemaSymbols::fgELT_ELEMENT,
+ DOM_Element targetElem =
+ getTopLevelComponentByName(SchemaSymbols::fgELT_ELEMENT,
localPart);
if (targetElem == 0) {
@@ -3027,7 +3033,7 @@
// REVISIT do we return 0 or what? for now we will return QName created
return eltName;
}
- }
+ }
return eltName;
}
@@ -3039,7 +3045,7 @@
}
if (XMLString::compareString(blockStr, SchemaSymbols::fgATTVAL_POUNDALL) == 0) {
- return SchemaSymbols::EXTENSION + SchemaSymbols::LIST +
+ return SchemaSymbols::EXTENSION + SchemaSymbols::LIST +
SchemaSymbols::RESTRICTION + SchemaSymbols::UNION +
SchemaSymbols::SUBSTITUTION;
}
@@ -3064,7 +3070,7 @@
if ((blockSet & SchemaSymbols::UNION) == 0) {
blockSet += SchemaSymbols::UNION;
- }
+ }
else {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::UnionRepeated);
}
@@ -3111,7 +3117,7 @@
}
if (XMLString::compareString(finalStr, SchemaSymbols::fgATTVAL_POUNDALL) == 0) {
- return SchemaSymbols::EXTENSION + SchemaSymbols::LIST +
+ return SchemaSymbols::EXTENSION + SchemaSymbols::LIST +
SchemaSymbols::RESTRICTION + SchemaSymbols::UNION;
}
@@ -3126,7 +3132,7 @@
if ((finalSet & SchemaSymbols::UNION) == 0) {
finalSet += SchemaSymbols::UNION;
- }
+ }
else {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::UnionRepeated);
}
@@ -3198,7 +3204,7 @@
|| XMLString::compareString(name, SchemaSymbols::fgELT_UNIQUE) == 0);
}
-const XMLCh*
+const XMLCh*
TraverseSchema::checkTypeFromAnotherSchema(const XMLCh* const typeStr) {
const XMLCh* prefix = getPrefix(typeStr);
@@ -3214,7 +3220,7 @@
return 0;
}
-DatatypeValidator*
+DatatypeValidator*
TraverseSchema::getElementTypeValidator(const XMLCh* const typeStr,
bool& noErrorDetected,
const XMLCh* const otherSchemaURI,
@@ -3235,9 +3241,9 @@
if (dv == 0) {
- if (XMLString::compareString(typeURI,
+ if (XMLString::compareString(typeURI,
SchemaSymbols::fgURI_SCHEMAFORSCHEMA) != 0
- || XMLString::compareString(fTargetNSURIString,
+ || XMLString::compareString(fTargetNSURIString,
SchemaSymbols::fgURI_SCHEMAFORSCHEMA) == 0) {
DOM_Element elem = getTopLevelComponentByName(
@@ -3259,7 +3265,7 @@
}
-ComplexTypeInfo*
+ComplexTypeInfo*
TraverseSchema::getElementComplexTypeInfo(const XMLCh* const typeStr,
bool& noErrorDetected,
const XMLCh* const otherSchemaURI)
@@ -3283,7 +3289,7 @@
if (typeInfo == 0) {
- if (XMLString::compareString(typeURI,
+ if (XMLString::compareString(typeURI,
SchemaSymbols::fgURI_SCHEMAFORSCHEMA) != 0
|| XMLString::compareString(fTargetNSURIString,
SchemaSymbols::fgURI_SCHEMAFORSCHEMA) == 0) {
@@ -3305,7 +3311,7 @@
}
-SchemaElementDecl*
+SchemaElementDecl*
TraverseSchema::getSubstituteGroupElemDecl(const XMLCh* const name,
bool& noErrorDetected) {
@@ -3323,7 +3329,7 @@
if (elemDecl == 0) {
- DOM_Element subsGroupElem =
+ DOM_Element subsGroupElem =
getTopLevelComponentByName(SchemaSymbols::fgELT_ELEMENT,
localPart);
@@ -3341,7 +3347,7 @@
}
}
- if (elemDecl == 0
+ if (elemDecl == 0
|| (elemDecl->getDatatypeValidator() == 0
&& elemDecl->getComplexTypeInfo() == 0)) {
@@ -3352,7 +3358,7 @@
return elemDecl;
}
-SchemaElementDecl*
+SchemaElementDecl*
TraverseSchema::getElementDeclFromNS(const XMLCh* const nameUri,
const XMLCh* const localPart) {
@@ -3370,7 +3376,7 @@
return 0;
}
-bool
+bool
TraverseSchema::isSubstitutionGroupValid(const SchemaElementDecl* const subsElemDecl,
const ComplexTypeInfo* const typeInfo,
const DatatypeValidator* const validator,
@@ -3386,7 +3392,7 @@
// an element with the given type-relation.
// Note: we assume that (complex|simple)Type processing checks
// whether the type in question allows itself to
- // be modified as this element desires.
+ // be modified as this element desires.
// Check for type relationship;
// that is, make sure that the type we're deriving has some relatoinship
@@ -3419,7 +3425,7 @@
ComplexTypeInfo* subsTypeInfo = subsElemDecl->getComplexTypeInfo();
const ComplexTypeInfo* elemTypeInfo = typeInfo;
-
+
for (; elemTypeInfo != subsTypeInfo;
elemTypeInfo = elemTypeInfo->getBaseComplexTypeInfo()) {
}
@@ -3465,7 +3471,7 @@
}
-SchemaElementDecl*
+SchemaElementDecl*
TraverseSchema::createSchemaElementDecl(const DOM_Element& elem,
const bool topLevel,
const unsigned short elemType)
@@ -3505,13 +3511,13 @@
int finalValid = SchemaSymbols::RESTRICTION + SchemaSymbols::EXTENSION;
int blockValid = finalValid + SchemaSymbols::SUBSTITUTION;
- if (XMLString::stringLen(block) != 0
+ if (XMLString::stringLen(block) != 0
&& XMLString::compareString(block,SchemaSymbols::fgATTVAL_POUNDALL) != 0
&& ((blockSet & blockValid) == 0)) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::InvalidElementBlockValue, block);
}
- if (XMLString::stringLen(final) != 0
+ if (XMLString::stringLen(final) != 0
&& XMLString::compareString(final,SchemaSymbols::fgATTVAL_POUNDALL) != 0
&& ((finalSet & finalValid) == 0)) {
reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::InvalidElementFinalValue, final);
@@ -3541,7 +3547,7 @@
}
const XMLCh* prefix = getPrefix(name);
- SchemaElementDecl* elemDecl =
+ SchemaElementDecl* elemDecl =
new SchemaElementDecl(prefix, name, uriIndex,
(SchemaElementDecl::ModelTypes) elemType,
enclosingScope);
@@ -3598,7 +3604,7 @@
// the referred attribute declaration and traverse it.
if (fAttributeDeclRegistry->containsKey(localPart) == false) {
- DOM_Element referredAttribute =
+ DOM_Element referredAttribute =
getTopLevelComponentByName(SchemaSymbols::fgELT_ATTRIBUTE, localPart);
if (referredAttribute == 0) {
@@ -3619,12 +3625,12 @@
return;
}
- bool required = (XMLString::compareString(useAttr,
+ bool required = (XMLString::compareString(useAttr,
SchemaSymbols::fgATTVAL_REQUIRED) == 0);
- bool prohibited = (XMLString::compareString(useAttr,
+ bool prohibited = (XMLString::compareString(useAttr,
SchemaSymbols::fgATTVAL_PROHIBITED) == 0);
QName* attQName = refAttDef->getAttName();
- SchemaAttDef* attDef = new SchemaAttDef(attQName->getPrefix(),
+ SchemaAttDef* attDef = new SchemaAttDef(attQName->getPrefix(),
attQName->getLocalPart(),
attQName->getURI(),
refAttDef->getType());
@@ -3656,7 +3662,7 @@
unsigned int minOccurs = 0;
unsigned int maxOccurs = 0;
DOMString nOccurs = elem.getAttribute(SchemaSymbols::fgATT_MINOCCURS);
-
+
if (nOccurs.length() > 0) {
fBuffer.set(nOccurs.rawBuffer(), nOccurs.length());
@@ -3682,12 +3688,12 @@
fBuffer.reset();
}
- XMLCh* maxOccursStr = XMLString::replicate(fBuffer.getRawBuffer());
+ XMLCh* maxOccursStr = XMLString::replicate(fBuffer.getRawBuffer());
ArrayJanitor<XMLCh> janMaxOccur(maxOccursStr);
XMLString::trim(maxOccursStr);
-
- bool isMaxUnbounded =
+
+ bool isMaxUnbounded =
(XMLString::compareString(maxOccursStr, fgUnbounded) == 0);
if (XMLString::stringLen(maxOccursStr) == 0) {
@@ -3703,7 +3709,7 @@
ContentSpecNode* saveNode = specNode;
ContentSpecNode* retNode = specNode;
-
+
if (minOccurs == 1 && maxOccurs == 1) {
}
else if (minOccurs == 0 && maxOccurs == 1) {
@@ -3733,9 +3739,9 @@
if (minOccurs == 0) {
- ContentSpecNode* optional =
+ ContentSpecNode* optional =
new ContentSpecNode(ContentSpecNode::ZeroOrOne, saveNode, 0);
-
+
retNode = optional;
for (int i=0; i < (int)(maxOccurs-minOccurs-1); i++) {
@@ -3750,7 +3756,7 @@
retNode, saveNode, true, false);
}
- ContentSpecNode* optional =
+ ContentSpecNode* optional =
new ContentSpecNode(ContentSpecNode::ZeroOrOne, saveNode, 0, false);
for (int j=0; j < (int)(maxOccurs-minOccurs); j++) {
@@ -3787,7 +3793,7 @@
if (childName.equals(SchemaSymbols::fgELT_GROUP)) {
-// specNode = expandContentModel(traverseGroupDecl(childElem),
+// specNode = expandContentModel(traverseGroupDecl(childElem),
// childElem);
attrNode = XUtil::getNextSiblingElement(childElem);
}
@@ -3809,8 +3815,8 @@
specNode = expandContentModel(traverseAll(childElem), childElem);
attrNode = XUtil::getNextSiblingElement(childElem);
- //TO DO: REVISIT
- //check that minOccurs = 1 and maxOccurs = 1
+ //TO DO: REVISIT
+ //check that minOccurs = 1 and maxOccurs = 1
}
else if (isAttrOrAttrGroup(childElem)) {
// reset the contentType
@@ -3827,7 +3833,7 @@
if (isMixed) {
- // TODO - check to see if we MUST have an element. What if only attributes
+ // TODO - check to see if we MUST have an element. What if only attributes
// were specified??
// add #PCDATA leaf
@@ -3849,7 +3855,7 @@
typeInfo->setContentSpec(specNode);
// -----------------------------------------------------------------------
- // Merge in information from base, if it exists
+ // Merge in information from base, if it exists
// -----------------------------------------------------------------------
ComplexTypeInfo* baseTypeInfo = typeInfo->getBaseComplexTypeInfo();
if (baseTypeInfo != 0) {
@@ -3865,7 +3871,7 @@
baseLocalPart);
throw;
}
-
+
//REVISIT: !!!really hairy stuff to check the particle derivation OK in 5.10
}
else {
@@ -3886,7 +3892,7 @@
}
else if (baseSpecNode != 0) {
- typeInfo->setContentSpec(
+ typeInfo->setContentSpec(
new ContentSpecNode(ContentSpecNode::Sequence, baseSpecNode,
typeInfo->getContentSpec(), false,
typeInfo->getAdoptContentSpec()));
@@ -3898,7 +3904,7 @@
}
// -------------------------------------------------------------
- // Set the content type
+ // Set the content type
// -------------------------------------------------------------
if (isMixed) {
typeInfo->setContentType(SchemaElementDecl::Mixed);
@@ -3942,7 +3948,7 @@
DatatypeValidator* baseDTValidator = 0;
// -------------------------------------------------------------
- // check if the base type is from another schema
+ // check if the base type is from another schema
// -------------------------------------------------------------
if (isBaseFromAnotherSchema(uriStr)) {
@@ -3972,7 +3978,7 @@
// assume the base is a complexType and try to locate the base type first
baseComplexTypeInfo = fComplexTypeRegistry->get(fBuffer.getRawBuffer());
- // if not found, 2 possibilities:
+ // if not found, 2 possibilities:
// 1: ComplexType in question has not been compiled yet;
// 2: base is SimpleTYpe;
if (baseComplexTypeInfo == 0) {
@@ -4033,7 +4039,7 @@
fBuffer.append(chComma);
fBuffer.append(localPart);
- ComplexTypeInfo* typeInfo =
+ ComplexTypeInfo* typeInfo =
((SchemaGrammar*)grammar)->getComplexTypeRegistry()->get(fBuffer.getRawBuffer());
return typeInfo;
@@ -4076,11 +4082,11 @@
if (childName.equals(SchemaSymbols::fgELT_ATTRIBUTE)) {
traverseAttributeDecl(child, typeInfo);
- }
- else if (childName.equals(SchemaSymbols::fgELT_ATTRIBUTEGROUP)) {
+ }
+ else if (childName.equals(SchemaSymbols::fgELT_ATTRIBUTEGROUP)) {
// TO DO
}
- else if (childName.equals(SchemaSymbols::fgELT_ANYATTRIBUTE) ) {
+ else if (childName.equals(SchemaSymbols::fgELT_ANYATTRIBUTE) ) {
attWildCard = traverseAnyAttribute(child);
janAttWildCard.reset(attWildCard);
}
@@ -4111,7 +4117,7 @@
if (baseTypeInfo != 0 && baseTypeInfo->hasAttDefs()) {
- SchemaAttDefList& baseAttList = (SchemaAttDefList&)
+ SchemaAttDefList& baseAttList = (SchemaAttDefList&)
baseTypeInfo->getAttDefList();
while (baseAttList.hasMoreElements()) {
@@ -4120,7 +4126,7 @@
XMLAttDef::AttTypes attType = attDef.getType();
QName* attName = attDef.getAttName();
- if (attType == XMLAttDef::Any_Any
+ if (attType == XMLAttDef::Any_Any
|| attType == XMLAttDef::Any_List
|| attType == XMLAttDef::Any_Local
|| attType == XMLAttDef::Any_Other) {
@@ -4134,14 +4140,14 @@
}
// if found a duplicate, if it is derived by restriction,
- // then skip the one from the base type
+ // then skip the one from the base type
if (typeInfo->contains(attName->getLocalPart())) {
if (typeInfo->getDerivedBy() == SchemaSymbols::RESTRICTION) {
continue;
}
}
-
+
SchemaAttDef* newAttDef = new SchemaAttDef(attName->getPrefix(),
attName->getLocalPart(),
attName->getURI(),
@@ -4188,7 +4194,7 @@
const XMLCh* const uri,
ComplexTypeInfo* const typeInfo)
{
- SchemaGrammar* aGrammar = (SchemaGrammar*)
+ SchemaGrammar* aGrammar = (SchemaGrammar*)
fGrammarResolver->getGrammar(uri);
if (XMLString::stringLen(uri) == 0 || aGrammar == 0
@@ -4204,7 +4210,7 @@
return -1;
}
- SchemaAttDef* tempAtt = (SchemaAttDef*)
+ SchemaAttDef* tempAtt = (SchemaAttDef*)
aGrammar->getAttributeDeclRegistry()->get(name);
if (tempAtt == 0) {
@@ -4259,7 +4265,7 @@
if (fScanner && XMLString::compareString(msgDomain, XMLUni::fgXMLErrDomain) == 0) {
fScanner->emitError((XMLErrs::Codes) errorCode);
}
- else if (fValidator && fScanner->getDoValidation()
+ else if (fValidator && fScanner->getDoValidation()
&& XMLString::compareString(msgDomain, XMLUni::fgValidityDomain) == 0) {
fValidator->emitError((XMLValid::Codes) errorCode);
}
@@ -4275,14 +4281,14 @@
if (fScanner && XMLString::compareString(msgDomain, XMLUni::fgXMLErrDomain) == 0) {
fScanner->emitError((XMLErrs::Codes) errorCode,text1,text2,text3,text4);
}
- else if (fValidator && fScanner->getDoValidation()
+ else if (fValidator && fScanner->getDoValidation()
&& XMLString::compareString(msgDomain, XMLUni::fgValidityDomain) == 0) {
fValidator->emitError((XMLValid::Codes) errorCode,text1,text2,text3,text4);
}
}
InputSource* TraverseSchema::resolveSchemaLocation(const XMLCh* const loc) {
-
+
// ------------------------------------------------------------------
// Create an input source
// ------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org