#include "../config/pathan_config.h" /* * Copyright (c) 2002, DecisionSoft Limited All rights reserved. * Please see LICENSE.TXT for more information. */ #include #include ValidationContext::ValidationContext() { _ptr=0; _contextType=GLOBAL_CONTEXT; } ValidationContext& ValidationContext::operator=(ValidationContext other) { _ptr=other._ptr; _contextType=other._contextType; return *this; } ValidationContext::ContextType ValidationContext::getContextType() const { return _contextType; } void ValidationContext::setContextType(ValidationContext::ContextType newVal) { _contextType=newVal; _ptr=0; } XERCES_CPP_NAMESPACE_QUALIFIER ComplexTypeInfo* ValidationContext::getCurrentType() const { if(_contextType!=TYPE_CONTEXT) DSLthrow(XPath2ErrorException,X("ValidationContext::getCurrentType"),X("The validation context doesn't contain a type")); return (XERCES_CPP_NAMESPACE_QUALIFIER ComplexTypeInfo*)_ptr; } void ValidationContext::setCurrentType(XERCES_CPP_NAMESPACE_QUALIFIER ComplexTypeInfo* newVal) { _contextType=TYPE_CONTEXT; _ptr=newVal; } XERCES_CPP_NAMESPACE_QUALIFIER SchemaElementDecl* ValidationContext::getCurrentElement() const { if(_contextType!=ELEMENT_CONTEXT) DSLthrow(XPath2ErrorException,X("ValidationContext::getCurrentElement"),X("The validation context doesn't contain an element")); return (XERCES_CPP_NAMESPACE_QUALIFIER SchemaElementDecl*)_ptr; } void ValidationContext::setCurrentElement(XERCES_CPP_NAMESPACE_QUALIFIER SchemaElementDecl* newVal) { _contextType=ELEMENT_CONTEXT; _ptr=newVal; } XERCES_CPP_NAMESPACE_QUALIFIER SchemaAttDef* ValidationContext::getCurrentAttribute() const { if(_contextType!=ATTRIBUTE_CONTEXT) DSLthrow(XPath2ErrorException,X("ValidationContext::getCurrentAttribute"),X("The validation context doesn't contain an attribute")); return (XERCES_CPP_NAMESPACE_QUALIFIER SchemaAttDef*)_ptr; } void ValidationContext::setCurrentAttribute(XERCES_CPP_NAMESPACE_QUALIFIER SchemaAttDef* newVal) { _contextType=ATTRIBUTE_CONTEXT; _ptr=newVal; }