gareth 2003/08/29 04:44:18 Modified: c/src/xercesc/validators/schema SchemaElementDecl.hpp c/tests/DOM/TypeInfo TypeInfo.cpp c/tests/DOM/TypeInfo/data TypeInfo.xml TypeInfo.xsd TypeInfoNoDTD.xml TypeInfoNoDTD.xsd Log: If a type was explicitly declared as anyType that now gets set in DOMTypeInfo. Added test cases. Revision Changes Path 1.12 +8 -13 xml-xerces/c/src/xercesc/validators/schema/SchemaElementDecl.hpp Index: SchemaElementDecl.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/SchemaElementDecl.hpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- SchemaElementDecl.hpp 18 May 2003 14:02:08 -0000 1.11 +++ SchemaElementDecl.hpp 29 Aug 2003 11:44:18 -0000 1.12 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.12 2003/08/29 11:44:18 gareth + * If a type was explicitly declared as anyType that now gets set in DOMTypeInfo. Added test cases. + * * Revision 1.11 2003/05/18 14:02:08 knoaman * Memory manager implementation: pass per instance manager. * @@ -616,12 +619,8 @@ else if(fDatatypeValidator) return fDatatypeValidator->getTypeLocalName(); - //its anyType if we have not done validation on it - if(getValidationAttempted() == PSVIDefs::NONE) - return SchemaSymbols::fgATTVAL_ANYTYPE; - - - return 0; + //its anyType if we have not done validation on it or none of the above exist + return SchemaSymbols::fgATTVAL_ANYTYPE; } inline PSVIDefs::Complexity SchemaElementDecl::getTypeType() const { @@ -644,12 +643,8 @@ else if(fDatatypeValidator) return fDatatypeValidator->getTypeUri(); - //its anyType if we have not done validation on it - if(getValidationAttempted() == PSVIDefs::NONE) - return SchemaSymbols::fgURI_SCHEMAFORSCHEMA; - - - return 0; + //its anyType if we have not done validation on it or none of the above exist + return SchemaSymbols::fgURI_SCHEMAFORSCHEMA; } inline const XMLCh* SchemaElementDecl::getMemberTypeName() const { @@ -718,7 +713,7 @@ return fDatatypeValidator->getAnonymous(); } - return true; + return false; } inline const XMLCh* SchemaElementDecl::getDOMTypeInfoName() const { 1.7 +6 -0 xml-xerces/c/tests/DOM/TypeInfo/TypeInfo.cpp Index: TypeInfo.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/tests/DOM/TypeInfo/TypeInfo.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TypeInfo.cpp 27 Aug 2003 13:19:14 -0000 1.6 +++ TypeInfo.cpp 29 Aug 2003 11:44:18 -0000 1.7 @@ -192,6 +192,9 @@ DOMAttr *testAttr; + testAttr = testEle->getAttributeNodeNS(0, X("anySimpleType")); + DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__); + testAttr = testEle->getAttributeNodeNS(0, X("string")); DOMTYPEINFOTEST(testAttr->getTypeInfo(), SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__); @@ -463,6 +466,9 @@ testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling(); DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgDT_POSITIVEINTEGER, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__); + + testEle = (DOMElement *)testEle->getNextSibling()->getNextSibling(); + DOMTYPEINFOTEST(testEle->getTypeInfo(), SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, __LINE__); return passed; } 1.4 +2 -0 xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfo.xml Index: TypeInfo.xml =================================================================== RCS file: /home/cvs/xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfo.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TypeInfo.xml 27 Aug 2003 13:19:14 -0000 1.3 +++ TypeInfo.xml 29 Aug 2003 11:44:18 -0000 1.4 @@ -1,6 +1,7 @@ <!DOCTYPE root SYSTEM "TypeInfo.dtd" > <root xsi:noNamespaceSchemaLocation="TypeInfo.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ss="http://www.secondSchema" > <attrTest +anySimpleType="asdas" string="string" boolean="true" decimal="2.0" @@ -87,6 +88,7 @@ <level1unsignedShort >1</level1unsignedShort> <level1unsignedByte >1</level1unsignedByte> <level1positiveInteger >1</level1positiveInteger> + <level1anyType /> </eleTest> <simpleDerTest decimalDerived="50" stringDerived="hello" > <decimalDerived >20</decimalDerived> 1.3 +2 -0 xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfo.xsd Index: TypeInfo.xsd =================================================================== RCS file: /home/cvs/xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfo.xsd,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TypeInfo.xsd 6 Feb 2003 13:52:33 -0000 1.2 +++ TypeInfo.xsd 29 Aug 2003 11:44:18 -0000 1.3 @@ -213,10 +213,12 @@ <xs:element name="level1unsignedShort" type="xs:unsignedShort" /> <xs:element name="level1unsignedByte" type="xs:unsignedByte" /> <xs:element name="level1positiveInteger" type="xs:positiveInteger" /> + <xs:element name="level1anyType" type="xs:anyType" /> </xs:sequence> </xs:complexType> <xs:complexType name="attrTestType" > + <xs:attribute name="anySimpleType" type="xs:anySimpleType" /> <xs:attribute name="string" type="xs:string" /> <xs:attribute name="boolean" type="xs:boolean" /> <xs:attribute name="decimal" type="xs:decimal" /> 1.4 +2 -0 xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfoNoDTD.xml Index: TypeInfoNoDTD.xml =================================================================== RCS file: /home/cvs/xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfoNoDTD.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TypeInfoNoDTD.xml 27 Aug 2003 13:19:14 -0000 1.3 +++ TypeInfoNoDTD.xml 29 Aug 2003 11:44:18 -0000 1.4 @@ -1,5 +1,6 @@ <root xsi:noNamespaceSchemaLocation="TypeInfoNoDTD.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ss="http://www.secondSchema" > <attrTest +anySimpleType="asdas" string="string" boolean="true" decimal="2.0" @@ -84,6 +85,7 @@ <level1unsignedShort >1</level1unsignedShort> <level1unsignedByte >1</level1unsignedByte> <level1positiveInteger >1</level1positiveInteger> + <level1anyType /> </eleTest> <simpleDerTest decimalDerived="50" stringDerived="hello" > <decimalDerived >20</decimalDerived> 1.3 +2 -0 xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfoNoDTD.xsd Index: TypeInfoNoDTD.xsd =================================================================== RCS file: /home/cvs/xml-xerces/c/tests/DOM/TypeInfo/data/TypeInfoNoDTD.xsd,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TypeInfoNoDTD.xsd 6 Feb 2003 13:52:33 -0000 1.2 +++ TypeInfoNoDTD.xsd 29 Aug 2003 11:44:18 -0000 1.3 @@ -213,10 +213,12 @@ <xs:element name="level1unsignedShort" type="xs:unsignedShort" /> <xs:element name="level1unsignedByte" type="xs:unsignedByte" /> <xs:element name="level1positiveInteger" type="xs:positiveInteger" /> + <xs:element name="level1anyType" type="xs:anyType" /> </xs:sequence> </xs:complexType> <xs:complexType name="attrTestType" > + <xs:attribute name="anySimpleType" type="xs:anySimpleType" /> <xs:attribute name="string" type="xs:string" /> <xs:attribute name="boolean" type="xs:boolean" /> <xs:attribute name="decimal" type="xs:decimal" />
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]