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/04 16:50:46 UTC
cvs commit: xml-xerces/c/src/validators/schema SubstitutionGroupComparator.cpp SubstitutionGroupComparator.hpp
tng 01/05/04 07:50:43
Modified: c/src/validators/schema SubstitutionGroupComparator.cpp
SubstitutionGroupComparator.hpp
Log:
Fixed the cvs symbols.
Revision Changes Path
1.2 +43 -43 xml-xerces/c/src/validators/schema/SubstitutionGroupComparator.cpp
Index: SubstitutionGroupComparator.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/schema/SubstitutionGroupComparator.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SubstitutionGroupComparator.cpp 2001/05/03 21:02:39 1.1
+++ SubstitutionGroupComparator.cpp 2001/05/04 14:50:28 1.2
@@ -1,37 +1,37 @@
/*
* The Apache Software License, Version 1.1
- *
+ *
* Copyright (c) 1999-2000 The Apache Software Foundation. All rights
* reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
+ * notice, this list of conditions and the following disclaimer.
+ *
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache\@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
- *
+ *
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation, and was
* originally based on software copyright (c) 1999, International
@@ -55,8 +55,11 @@
*/
/*
- * $Log:
+ * $Log: SubstitutionGroupComparator.cpp,v $
+ * Revision 1.2 2001/05/04 14:50:28 tng
+ * Fixed the cvs symbols.
*
+ *
*/
@@ -73,11 +76,11 @@
, const QName& exemplar)
{
- if ((XMLString::compareString(anElement.getLocalPart(), exemplar.getLocalPart()) == 0) &&
- (anElement.getURI() == exemplar.getURI()))
+ if ((XMLString::compareString(anElement.getLocalPart(), exemplar.getLocalPart()) == 0) &&
+ (anElement.getURI() == exemplar.getURI()))
return true; // they're the same!
- if (!fGrammarResolver || !fStringPool )
+ if (!fGrammarResolver || !fStringPool )
{
ThrowXML(RuntimeException, XMLExcepts::SubGrpComparator_NGR);
}
@@ -87,13 +90,13 @@
const XMLCh* localpart = anElement.getLocalPart();
// In addition to simply trying to find a chain between anElement and exemplar,
- // we need to make sure that no steps in the chain are blocked.
+ // we need to make sure that no steps in the chain are blocked.
// That is, at every step, we need to make sure that the element
// being substituted for will permit being substituted
// for, and whether the type of the element will permit derivations in
// instance documents of this sort.
- if (!uri)
+ if (!uri)
return false;
SchemaGrammar *sGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(uri);
@@ -105,38 +108,38 @@
XMLCh* substitutionGroupFullName = pElemDecl->getSubstitutionGroupName();
bool foundIt = false;
- while (substitutionGroupFullName)
+ while (substitutionGroupFullName)
{
- int commaAt = XMLString::indexOf(substitutionGroupFullName, ',');
+ int commaAt = XMLString::indexOf(substitutionGroupFullName, ',');
XMLCh* tmpURI = 0;
XMLCh* tmpLocalpart = substitutionGroupFullName;
- if (commaAt >= 0)
+ if (commaAt >= 0)
{
- if (commaAt > 0)
+ if (commaAt > 0)
XMLString::subString(tmpURI, substitutionGroupFullName, 0, commaAt);
-
- XMLString::subString(tmpLocalpart, substitutionGroupFullName, commaAt+1, XMLString::stringLen(substitutionGroupFullName));
+
+ XMLString::subString(tmpLocalpart, substitutionGroupFullName, commaAt+1, XMLString::stringLen(substitutionGroupFullName));
}
- if (!tmpURI)
+ if (!tmpURI)
return false;
-
+
sGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(tmpURI);
- if (!sGrammar)
- return false;
+ if (!sGrammar)
+ return false;
uriId = fStringPool->addOrFind(tmpURI);
pElemDecl = (SchemaElementDecl*) sGrammar->getElemDecl(uriId, tmpLocalpart, 0, Grammar::TOP_LEVEL_SCOPE);
-
- if (!pElemDecl)
- return false;
- if ((XMLString::compareString(tmpLocalpart, exemplar.getLocalPart()) == 0) &&
- (uriId == exemplar.getURI()))
+ if (!pElemDecl)
+ return false;
+
+ if ((XMLString::compareString(tmpLocalpart, exemplar.getLocalPart()) == 0) &&
+ (uriId == exemplar.getURI()))
{
// time to check for block value on element
- if((pElemDecl->getBlockSet() & SchemaSymbols::SUBSTITUTION) != 0)
- return false;
+ if((pElemDecl->getBlockSet() & SchemaSymbols::SUBSTITUTION) != 0)
+ return false;
foundIt = true;
break;
@@ -145,14 +148,14 @@
substitutionGroupFullName = pElemDecl->getSubstitutionGroupName();
}//while
- if (!foundIt)
- return false;
+ if (!foundIt)
+ return false;
// this will contain anElement's complexType information.
ComplexTypeInfo *aComplexType = anElementDecl->getComplexTypeInfo();
int exemplarBlockSet = pElemDecl->getBlockSet();
- if(!aComplexType)
+ if(!aComplexType)
{
// check on simpleType case
DatatypeValidator *anElementDV = anElementDecl->getDatatypeValidator();
@@ -162,23 +165,23 @@
((anElementDV == exemplarDV) ||
((exemplarBlockSet & SchemaSymbols::RESTRICTION) == 0)));
}
-
+
// now we have to make sure there are no blocks on the complexTypes that this is based upon
int anElementDerivationMethod = aComplexType->getDerivedBy();
- if((anElementDerivationMethod & exemplarBlockSet) != 0)
+ if((anElementDerivationMethod & exemplarBlockSet) != 0)
return false;
// this will contain exemplar's complexType information.
ComplexTypeInfo *exemplarComplexType = pElemDecl->getComplexTypeInfo();
for(ComplexTypeInfo *tempType = aComplexType;
- tempType != 0 && tempType != exemplarComplexType;
+ tempType != 0 && tempType != exemplarComplexType;
tempType = tempType->getBaseComplexTypeInfo())
{
- if((tempType->getBlockSet() & anElementDerivationMethod) != 0)
+ if((tempType->getBlockSet() & anElementDerivationMethod) != 0)
return false;
}//for
-
+
return true;
}
/**
1.2 +17 -17 xml-xerces/c/src/validators/schema/SubstitutionGroupComparator.hpp
Index: SubstitutionGroupComparator.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/schema/SubstitutionGroupComparator.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SubstitutionGroupComparator.hpp 2001/05/03 21:02:40 1.1
+++ SubstitutionGroupComparator.hpp 2001/05/04 14:50:31 1.2
@@ -1,37 +1,37 @@
/*
* The Apache Software License, Version 1.1
- *
+ *
* Copyright (c) 1999-2000 The Apache Software Foundation. All rights
* reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
+ * notice, this list of conditions and the following disclaimer.
+ *
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache\@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
- *
+ *
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation, and was
* originally based on software copyright (c) 1999, International
@@ -55,7 +55,7 @@
*/
/*
- * $Id
+ * $Id: SubstitutionGroupComparator.hpp,v 1.2 2001/05/04 14:50:31 tng Exp $
*/
#if !defined(SUBSTITUTIONGROUPCOMPARATOR_HPP)
@@ -69,7 +69,7 @@
class VALIDATORS_EXPORT SubstitutionGroupComparator
{
public:
-
+
// -----------------------------------------------------------------------
// Public Constructor
// -----------------------------------------------------------------------
@@ -98,7 +98,7 @@
/** @name Validation Function */
//@{
- /**
+ /**
* Checks that the "anElement" is within the subsitution group.
*
* @param anElement QName of the element
@@ -118,14 +118,14 @@
// Unimplemented Ctor
// -----------------------------------------------------------------------
SubstitutionGroupComparator();
-
+
// -----------------------------------------------------------------------
// Private data members
//
//
// -----------------------------------------------------------------------
-
+
GrammarResolver *fGrammarResolver;
XMLStringPool *fStringPool;
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org