System::Xml::Schema::XmlSchemaValidator Class Referencefinal

Inherits System::Object.

Public Types

using Ptr = SharedPtr< XmlSchemaValidator >
 An alias for shared pointer to an instance of this class. More...
 
- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Public Member Functions

ASPOSECPP_SHARED_API void set_XmlResolver (const SharedPtr< System::Xml::XmlResolver > &value)
 
ASPOSECPP_SHARED_API SharedPtr< IXmlLineInfoget_LineInfoProvider ()
 
ASPOSECPP_SHARED_API void set_LineInfoProvider (const SharedPtr< IXmlLineInfo > &value)
 
ASPOSECPP_SHARED_API SharedPtr< Uriget_SourceUri ()
 
ASPOSECPP_SHARED_API void set_SourceUri (const SharedPtr< Uri > &value)
 
ASPOSECPP_SHARED_API SharedPtr< Objectget_ValidationEventSender ()
 
ASPOSECPP_SHARED_API void set_ValidationEventSender (const SharedPtr< Object > &value)
 
ASPOSECPP_SHARED_API XmlSchemaValidator (const SharedPtr< XmlNameTable > &nameTable, const SharedPtr< XmlSchemaSet > &schemas, const SharedPtr< IXmlNamespaceResolver > &namespaceResolver, XmlSchemaValidationFlags validationFlags)
 
ASPOSECPP_SHARED_API void AddSchema (const SharedPtr< XmlSchema > &schema)
 
ASPOSECPP_SHARED_API void Initialize ()
 
ASPOSECPP_SHARED_API void Initialize (const SharedPtr< XmlSchemaObject > &partialValidationType)
 
ASPOSECPP_SHARED_API void ValidateElement (const String &localName, const String &namespaceUri, const SharedPtr< XmlSchemaInfo > &schemaInfo)
 
ASPOSECPP_SHARED_API void ValidateElement (const String &localName, const String &namespaceUri, const SharedPtr< XmlSchemaInfo > &schemaInfo, const String &xsiType, const String &xsiNil, const String &xsiSchemaLocation, const String &xsiNoNamespaceSchemaLocation)
 
ASPOSECPP_SHARED_API SharedPtr< ObjectValidateAttribute (const String &localName, const String &namespaceUri, const String &attributeValue, const SharedPtr< XmlSchemaInfo > &schemaInfo)
 
ASPOSECPP_SHARED_API SharedPtr< ObjectValidateAttribute (const String &localName, const String &namespaceUri, XmlValueGetter attributeValue, const SharedPtr< XmlSchemaInfo > &schemaInfo)
 
ASPOSECPP_SHARED_API void GetUnspecifiedDefaultAttributes (const SharedPtr< Collections::Generic::List< SharedPtr< Object >>> &defaultAttributes)
 
ASPOSECPP_SHARED_API void ValidateEndOfAttributes (const SharedPtr< XmlSchemaInfo > &schemaInfo)
 
ASPOSECPP_SHARED_API void ValidateText (const String &elementValue)
 
ASPOSECPP_SHARED_API void ValidateText (XmlValueGetter elementValue)
 
ASPOSECPP_SHARED_API void ValidateWhitespace (const String &elementValue)
 
ASPOSECPP_SHARED_API void ValidateWhitespace (XmlValueGetter elementValue)
 
ASPOSECPP_SHARED_API SharedPtr< ObjectValidateEndElement (const SharedPtr< XmlSchemaInfo > &schemaInfo)
 
ASPOSECPP_SHARED_API SharedPtr< ObjectValidateEndElement (const SharedPtr< XmlSchemaInfo > &schemaInfo, const SharedPtr< Object > &typedValue)
 
ASPOSECPP_SHARED_API void SkipToEndElement (const SharedPtr< XmlSchemaInfo > &schemaInfo)
 
ASPOSECPP_SHARED_API void EndValidation ()
 
ASPOSECPP_SHARED_API ArrayPtr< SharedPtr< XmlSchemaParticle > > GetExpectedParticles ()
 
ASPOSECPP_SHARED_API ArrayPtr< SharedPtr< XmlSchemaAttribute > > GetExpectedAttributes ()
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Public Attributes

System::Xml::Schema::ValidationEventHandler ValidationEventHandler
 The ValidationEventHandler that receives schema validation warnings and errors encountered during schema validation. More...
 

Protected Member Functions

virtual ASPOSECPP_SHARED_API ~XmlSchemaValidator ()
 

Additional Inherited Members

- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 

Detailed Description

Represents an XML Schema Definition Language (XSD) Schema validation engine. The XmlSchemaValidator class cannot be inherited.

Attention
Objects of this class should only be allocated using System::MakeObject() function. Never create instances of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

Member Typedef Documentation

◆ Ptr

An alias for shared pointer to an instance of this class.

Constructor & Destructor Documentation

◆ XmlSchemaValidator()

ASPOSECPP_SHARED_API System::Xml::Schema::XmlSchemaValidator::XmlSchemaValidator ( const SharedPtr< XmlNameTable > &  nameTable,
const SharedPtr< XmlSchemaSet > &  schemas,
const SharedPtr< IXmlNamespaceResolver > &  namespaceResolver,
XmlSchemaValidationFlags  validationFlags 
)

Initializes a new instance of the XmlSchemaValidator class.

Parameters
nameTableAn XmlNameTable object containing element and attribute names as atomized strings.
schemasAn XmlSchemaSet object containing the XML Schema Definition Language (XSD) schemas used for validation.
namespaceResolverAn IXmlNamespaceResolver object used for resolving namespaces encountered during validation.
validationFlagsAn XmlSchemaValidationFlags value specifying schema validation options.
Exceptions
ArgumentNullExceptionOne or more of the parameters specified are nullptr.
XmlSchemaExceptionAn error occurred while compiling schemas in the XmlSchemaSet parameter.

◆ ~XmlSchemaValidator()

virtual ASPOSECPP_SHARED_API System::Xml::Schema::XmlSchemaValidator::~XmlSchemaValidator ( )
protectedvirtual

Member Function Documentation

◆ AddSchema()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::AddSchema ( const SharedPtr< XmlSchema > &  schema)

Adds an XML Schema Definition Language (XSD) schema to the set of schemas used for validation.

Parameters
schemaAn XmlSchema object to add to the set of schemas used for validation.
Exceptions
ArgumentNullExceptionThe XmlSchema parameter specified is nullptr.
XmlSchemaValidationExceptionThe target namespace of the XmlSchema parameter matches that of any element or attribute already encountered by the XmlSchemaValidator object.
XmlSchemaExceptionThe XmlSchema parameter is invalid.

◆ EndValidation()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::EndValidation ( )

Ends validation and checks identity constraints for the entire XML document.

Exceptions
XmlSchemaValidationExceptionAn identity constraint error was found in the XML document.

◆ get_LineInfoProvider()

ASPOSECPP_SHARED_API SharedPtr<IXmlLineInfo> System::Xml::Schema::XmlSchemaValidator::get_LineInfoProvider ( )

Returns the line number information for the XML node being validated.

Returns
An IXmlLineInfo object.

◆ get_SourceUri()

ASPOSECPP_SHARED_API SharedPtr<Uri> System::Xml::Schema::XmlSchemaValidator::get_SourceUri ( )

Returns the source URI for the XML node being validated.

Returns
A Uri object representing the source URI for the XML node being validated; the default is nullptr.

◆ get_ValidationEventSender()

ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::Schema::XmlSchemaValidator::get_ValidationEventSender ( )

Returns the object sent as the sender object of a validation event.

Returns
An Object; the default is this XmlSchemaValidator object.

◆ GetExpectedAttributes()

ASPOSECPP_SHARED_API ArrayPtr<SharedPtr<XmlSchemaAttribute> > System::Xml::Schema::XmlSchemaValidator::GetExpectedAttributes ( )

Returns the expected attributes for the current element context.

Returns
An array of XmlSchemaAttribute objects or an empty array if there are no expected attributes.

◆ GetExpectedParticles()

ASPOSECPP_SHARED_API ArrayPtr<SharedPtr<XmlSchemaParticle> > System::Xml::Schema::XmlSchemaValidator::GetExpectedParticles ( )

Returns the expected particles in the current element context.

Returns
An array of XmlSchemaParticle objects or an empty array if there are no expected particles.

◆ GetUnspecifiedDefaultAttributes()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::GetUnspecifiedDefaultAttributes ( const SharedPtr< Collections::Generic::List< SharedPtr< Object >>> &  defaultAttributes)

Validates identity constraints on the default attributes and populates the List specified with XmlSchemaAttribute objects for any attributes with default values that have not been previously validated using the XmlSchemaValidator::ValidateAttribute method in the element context.

Parameters
defaultAttributesA List to populate with XmlSchemaAttribute objects for any attributes not yet encountered during validation in the element context.

◆ Initialize() [1/2]

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::Initialize ( )

Initializes the state of the XmlSchemaValidator object.

Exceptions
InvalidOperationExceptionCalling the XmlSchemaValidator::Initialize method is valid immediately after the construction of an XmlSchemaValidator object or after a call to XmlSchemaValidator::EndValidation only.

◆ Initialize() [2/2]

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::Initialize ( const SharedPtr< XmlSchemaObject > &  partialValidationType)

Initializes the state of the XmlSchemaValidator object using the XmlSchemaObject specified for partial validation.

Parameters
partialValidationTypeAn XmlSchemaElement, XmlSchemaAttribute, or XmlSchemaType object used to initialize the validation context of the XmlSchemaValidator object for partial validation.
Exceptions
InvalidOperationExceptionCalling the XmlSchemaValidator::Initialize method is valid immediately after the construction of an XmlSchemaValidator object or after a call to XmlSchemaValidator::EndValidation only.
ArgumentExceptionThe XmlSchemaObject parameter is not an XmlSchemaElement, XmlSchemaAttribute, or XmlSchemaType object.
ArgumentNullExceptionThe XmlSchemaObject parameter cannot be nullptr.

◆ set_LineInfoProvider()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::set_LineInfoProvider ( const SharedPtr< IXmlLineInfo > &  value)

Sets the line number information for the XML node being validated.

Parameters
valueThe value to set.

◆ set_SourceUri()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::set_SourceUri ( const SharedPtr< Uri > &  value)

Sets the source URI for the XML node being validated.

Parameters
valueThe value to set.

◆ set_ValidationEventSender()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::set_ValidationEventSender ( const SharedPtr< Object > &  value)

Sets the object sent as the sender object of a validation event.

Parameters
valueThe value to set.

◆ set_XmlResolver()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::set_XmlResolver ( const SharedPtr< System::Xml::XmlResolver > &  value)

Sets the XmlResolver object used to resolve xs:import and xs:include elements as well as xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes.

Parameters
valueThe value to set.

◆ SkipToEndElement()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::SkipToEndElement ( const SharedPtr< XmlSchemaInfo > &  schemaInfo)

Skips validation of the current element content and prepares the XmlSchemaValidator object to validate content in the parent element's context.

Parameters
schemaInfoAn XmlSchemaInfo object whose properties are set if the current element content is successfully skipped. This parameter can be nullptr.
Exceptions
InvalidOperationExceptionThe method was not called in the correct sequence. For example, calling XmlSchemaValidator::SkipToEndElement after calling XmlSchemaValidator::SkipToEndElement.

◆ ValidateAttribute() [1/2]

ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::Schema::XmlSchemaValidator::ValidateAttribute ( const String localName,
const String namespaceUri,
const String attributeValue,
const SharedPtr< XmlSchemaInfo > &  schemaInfo 
)

Validates the attribute name, namespace URI, and value in the current element context.

Parameters
localNameThe local name of the attribute to validate.
namespaceUriThe namespace URI of the attribute to validate.
attributeValueThe value of the attribute to validate.
schemaInfoAn XmlSchemaInfo object whose properties are set on successful validation of the attribute. This parameter can be nullptr.
Returns
The validated attribute's value.
Exceptions
XmlSchemaValidationExceptionThe attribute is not valid in the current element context.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateAttribute method was not called in the correct sequence. For example, calling XmlSchemaValidator::ValidateAttribute after calling XmlSchemaValidator::ValidateEndOfAttributes.
ArgumentNullExceptionOne or more of the parameters specified are nullptr.

◆ ValidateAttribute() [2/2]

ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::Schema::XmlSchemaValidator::ValidateAttribute ( const String localName,
const String namespaceUri,
XmlValueGetter  attributeValue,
const SharedPtr< XmlSchemaInfo > &  schemaInfo 
)

Validates the attribute name, namespace URI, and value in the current element context.

Parameters
localNameThe local name of the attribute to validate.
namespaceUriThe namespace URI of the attribute to validate.
attributeValueAn XmlValueGetter callback used to pass the attribute's value as a type compatible with the XML Schema Definition Language (XSD) type of the attribute.
schemaInfoAn XmlSchemaInfo object whose properties are set on successful validation of the attribute. This parameter and can be nullptr.
Returns
The validated attribute's value.
Exceptions
XmlSchemaValidationExceptionThe attribute is not valid in the current element context.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateAttribute method was not called in the correct sequence. For example, calling XmlSchemaValidator::ValidateAttribute after calling XmlSchemaValidator::ValidateEndOfAttributes.
ArgumentNullExceptionOne or more of the parameters specified are nullptr.

◆ ValidateElement() [1/2]

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::ValidateElement ( const String localName,
const String namespaceUri,
const SharedPtr< XmlSchemaInfo > &  schemaInfo 
)

Validates the element in the current context.

Parameters
localNameThe local name of the element to validate.
namespaceUriThe namespace URI of the element to validate.
schemaInfoAn XmlSchemaInfo object whose properties are set on successful validation of the element's name. This parameter can be nullptr.
Exceptions
XmlSchemaValidationExceptionThe element's name is not valid in the current context.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateElement method was not called in the correct sequence. For example, the XmlSchemaValidator::ValidateElement method is called after calling XmlSchemaValidator::ValidateAttribute.

◆ ValidateElement() [2/2]

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::ValidateElement ( const String localName,
const String namespaceUri,
const SharedPtr< XmlSchemaInfo > &  schemaInfo,
const String xsiType,
const String xsiNil,
const String xsiSchemaLocation,
const String xsiNoNamespaceSchemaLocation 
)

Validates the element in the current context with the xsi:Type, xsi:Nil, xsi:SchemaLocation, and xsi:NoNamespaceSchemaLocation attribute values specified.

Parameters
localNameThe local name of the element to validate.
namespaceUriThe namespace URI of the element to validate.
schemaInfoAn XmlSchemaInfo object whose properties are set on successful validation of the element's name. This parameter can be nullptr.
xsiTypeThe xsi:Type attribute value of the element. This parameter can be nullptr.
xsiNilThe xsi:Nil attribute value of the element. This parameter can be nullptr.
xsiSchemaLocationThe xsi:SchemaLocation attribute value of the element. This parameter can be nullptr.
xsiNoNamespaceSchemaLocationThe xsi:NoNamespaceSchemaLocation attribute value of the element. This parameter can be nullptr.
Exceptions
XmlSchemaValidationExceptionThe element's name is not valid in the current context.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateElement method was not called in the correct sequence. For example, the XmlSchemaValidator::ValidateElement method is called after calling XmlSchemaValidator::ValidateAttribute.

◆ ValidateEndElement() [1/2]

ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::Schema::XmlSchemaValidator::ValidateEndElement ( const SharedPtr< XmlSchemaInfo > &  schemaInfo)

Verifies if the text content of the element is valid according to its data type for elements with simple content, and verifies if the content of the current element is complete for elements with complex content.

Parameters
schemaInfoAn XmlSchemaInfo object whose properties are set on successful validation of the element. This parameter can be nullptr.
Returns
The parsed, typed text value of the element if the element has simple content.
Exceptions
XmlSchemaValidationExceptionThe element's content is not valid.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateEndElement method was not called in the correct sequence. For example, if the XmlSchemaValidator::ValidateEndElement method is called after calling XmlSchemaValidator::SkipToEndElement.

◆ ValidateEndElement() [2/2]

ASPOSECPP_SHARED_API SharedPtr<Object> System::Xml::Schema::XmlSchemaValidator::ValidateEndElement ( const SharedPtr< XmlSchemaInfo > &  schemaInfo,
const SharedPtr< Object > &  typedValue 
)

Verifies if the text content of the element specified is valid according to its data type.

Parameters
schemaInfoAn XmlSchemaInfo object whose properties are set on successful validation of the text content of the element. This parameter can be nullptr.
typedValueThe typed text content of the element.
Returns
The parsed, typed simple content of the element.
Exceptions
XmlSchemaValidationExceptionThe element's text content is not valid.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateEndElement method was not called in the correct sequence (for example, if the XmlSchemaValidator::ValidateEndElement method is called after calling XmlSchemaValidator::SkipToEndElement), calls to the XmlSchemaValidator::ValidateText method have been previously made, or the element has complex content.
ArgumentNullExceptionThe typed text content parameter cannot be nullptr.

◆ ValidateEndOfAttributes()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::ValidateEndOfAttributes ( const SharedPtr< XmlSchemaInfo > &  schemaInfo)

Verifies whether all the required attributes in the element context are present and prepares the XmlSchemaValidator object to validate the child content of the element.

Parameters
schemaInfoAn XmlSchemaInfo object whose properties are set on successful verification that all the required attributes in the element context are present. This parameter can be nullptr.
Exceptions
XmlSchemaValidationExceptionOne or more of the required attributes in the current element context were not found.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateEndOfAttributes method was not called in the correct sequence. For example, calling XmlSchemaValidator::ValidateEndOfAttributes after calling XmlSchemaValidator::SkipToEndElement.
ArgumentNullExceptionOne or more of the parameters specified are nullptr.

◆ ValidateText() [1/2]

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::ValidateText ( const String elementValue)

Validates whether the text string specified is allowed in the current element context, and accumulates the text for validation if the current element has simple content.

Parameters
elementValueA text string to validate in the current element context.
Exceptions
XmlSchemaValidationExceptionThe text string specified is not allowed in the current element context.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateText method was not called in the correct sequence. For example, the XmlSchemaValidator::ValidateText method is called after calling XmlSchemaValidator::ValidateAttribute.
ArgumentNullExceptionThe text string parameter cannot be nullptr.

◆ ValidateText() [2/2]

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::ValidateText ( XmlValueGetter  elementValue)

Validates whether the text returned by the XmlValueGetter object specified is allowed in the current element context, and accumulates the text for validation if the current element has simple content.

Parameters
elementValueAn XmlValueGetter callback used to pass the text value as a type compatible with the XML Schema Definition Language (XSD) type of the attribute.
Exceptions
XmlSchemaValidationExceptionThe text string specified is not allowed in the current element context.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateText method was not called in the correct sequence. For example, the XmlSchemaValidator::ValidateText method is called after calling XmlSchemaValidator::ValidateAttribute.
ArgumentNullExceptionThe text string parameter cannot be nullptr.

◆ ValidateWhitespace() [1/2]

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::ValidateWhitespace ( const String elementValue)

Validates whether the white space in the string specified is allowed in the current element context, and accumulates the white space for validation if the current element has simple content.

Parameters
elementValueA white space string to validate in the current element context.
Exceptions
XmlSchemaValidationExceptionWhite space is not allowed in the current element context.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateWhitespace method was not called in the correct sequence. For example, if the XmlSchemaValidator::ValidateWhitespace method is called after calling XmlSchemaValidator::ValidateAttribute.

◆ ValidateWhitespace() [2/2]

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaValidator::ValidateWhitespace ( XmlValueGetter  elementValue)

Validates whether the white space returned by the XmlValueGetter object specified is allowed in the current element context, and accumulates the white space for validation if the current element has simple content.

Parameters
elementValueAn XmlValueGetter callback used to pass the white space value as a type compatible with the XML Schema Definition Language (XSD) type of the attribute.
Exceptions
XmlSchemaValidationExceptionWhite space is not allowed in the current element context.
InvalidOperationExceptionThe XmlSchemaValidator::ValidateWhitespace method was not called in the correct sequence. For example, if the XmlSchemaValidator::ValidateWhitespace method is called after calling XmlSchemaValidator::ValidateAttribute.

Member Data Documentation

◆ ValidationEventHandler

System::Xml::Schema::ValidationEventHandler System::Xml::Schema::XmlSchemaValidator::ValidationEventHandler

The ValidationEventHandler that receives schema validation warnings and errors encountered during schema validation.