neilg 2003/12/18 23:20:03
Modified: c/src/xercesc/internal IGXMLScanner.cpp SGXMLScanner.cpp
IGXMLScanner2.cpp
Log:
when validating a skipped element or attribute, we should not look for a declaration.
Revision Changes Path
1.52 +1 -6 xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp
Index: IGXMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- IGXMLScanner.cpp 17 Dec 2003 21:39:57 -0000 1.51
+++ IGXMLScanner.cpp 19 Dec 2003 07:20:03 -0000 1.52
@@ -2786,11 +2786,6 @@
if(fGrammarType == Grammar::SchemaGrammarType)
{
((SchemaElementDecl *)(elemDecl))->setValidity(PSVIDefs::INVALID);
- if (getPSVIHandler())
- {
- // REVISIT:
- // PSVIElement->setValidity(PSVIItem::VALIDITY_INVALID);
- }
}
}
}
1.69 +13 -15 xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp
Index: SGXMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- SGXMLScanner.cpp 17 Dec 2003 21:39:57 -0000 1.68
+++ SGXMLScanner.cpp 19 Dec 2003 07:20:03 -0000 1.69
@@ -2272,7 +2272,9 @@
// Ask the element to clear the 'provided' flag on all of the att defs
// that it owns, and to return us a boolean indicating whether it has
// any defs.
- ComplexTypeInfo *currType =
((SchemaValidator*)fValidator)->getCurrentTypeInfo();
+ ComplexTypeInfo *currType = (fValidate)
+ ?((SchemaValidator*)fValidator)->getCurrentTypeInfo()
+ :0;
const bool hasDefs = (currType && fValidate)
? currType->resetDefs()
: elemDecl->resetDefs();
@@ -2391,11 +2393,14 @@
//if schema, see if we should lax or skip the validation of
this attribute
if (anyAttributeValidation(attWildCard, uriId, skipThisOne,
laxThisOne)) {
- SchemaGrammar* sGrammar = (SchemaGrammar*)
fGrammarResolver->getGrammar(getURIText(uriId));
- if (sGrammar && sGrammar->getGrammarType() ==
Grammar::SchemaGrammarType) {
- RefHashTableOf<XMLAttDef>* attRegistry =
sGrammar->getAttributeDeclRegistry();
- if (attRegistry) {
- attDefForWildCard = attRegistry->get(suffPtr);
+ if(!skipThisOne)
+ {
+ SchemaGrammar* sGrammar = (SchemaGrammar*)
fGrammarResolver->getGrammar(getURIText(uriId));
+ if (sGrammar && sGrammar->getGrammarType() ==
Grammar::SchemaGrammarType) {
+ RefHashTableOf<XMLAttDef>* attRegistry =
sGrammar->getAttributeDeclRegistry();
+ if (attRegistry) {
+ attDefForWildCard =
attRegistry->get(suffPtr);
+ }
}
}
}
@@ -2444,13 +2449,6 @@
}
}
- // Find this attribute within the parent element. We pass both
- // the uriID/name and the raw QName buffer, since we don't know
- // how the derived validator and its elements store attributes.
- if (!attDef) {
- attDef = ((SchemaElementDecl *)elemDecl)->getAttDef(suffPtr, uriId);
- }
-
// now need to prepare for duplicate detection
if(attDef)
{
@@ -2595,7 +2593,7 @@
}
}
- if (fValidate && !skipThisOne) {
+ if (fValidate ) {
fValidator->validateAttrValue
(
attDefForWildCard
1.53 +14 -12 xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp
Index: IGXMLScanner2.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- IGXMLScanner2.cpp 17 Dec 2003 00:18:34 -0000 1.52
+++ IGXMLScanner2.cpp 19 Dec 2003 07:20:03 -0000 1.53
@@ -124,7 +124,7 @@
// know what's best. REVISIT: don't modify grammar at all; eliminate
// this step...
ComplexTypeInfo *currType = 0;
- if(fGrammar->getGrammarType() == Grammar::SchemaGrammarType)
+ if(fGrammar->getGrammarType() == Grammar::SchemaGrammarType && fValidate)
currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo();
const bool hasDefs = (currType && fValidate)
? currType->resetDefs()
@@ -245,11 +245,14 @@
//if schema, see if we should lax or skip the validation of
this attribute
if (anyAttributeValidation(attWildCard, uriId, skipThisOne,
laxThisOne)) {
- SchemaGrammar* sGrammar = (SchemaGrammar*)
fGrammarResolver->getGrammar(getURIText(uriId));
- if (sGrammar && sGrammar->getGrammarType() ==
Grammar::SchemaGrammarType) {
- RefHashTableOf<XMLAttDef>* attRegistry =
sGrammar->getAttributeDeclRegistry();
- if (attRegistry) {
- attDefForWildCard = attRegistry->get(suffPtr);
+ if(!skipThisOne)
+ {
+ SchemaGrammar* sGrammar = (SchemaGrammar*)
fGrammarResolver->getGrammar(getURIText(uriId));
+ if (sGrammar && sGrammar->getGrammarType() ==
Grammar::SchemaGrammarType) {
+ RefHashTableOf<XMLAttDef>* attRegistry =
sGrammar->getAttributeDeclRegistry();
+ if (attRegistry) {
+ attDefForWildCard =
attRegistry->get(suffPtr);
+ }
}
}
}
@@ -307,10 +310,9 @@
// Find this attribute within the parent element. We pass both
// the uriID/name and the raw QName buffer, since we don't know
// how the derived validator and its elements store attributes.
- if (!attDef) {
- if(fGrammarType == Grammar::SchemaGrammarType)
- attDef = ((SchemaElementDecl *)elemDecl)->getAttDef( suffPtr ,
uriId);
- else
+ else
+ {
+ if(fGrammarType == Grammar::DTDGrammarType)
attDef = ((DTDElementDecl *)elemDecl)->getAttDef ( namePtr);
}
@@ -484,7 +486,7 @@
}
}
- if (fValidate && !skipThisOne) {
+ if (fValidate ) {
fValidator->validateAttrValue
(
attDefForWildCard
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]