Редагувати

Поділитися через


XmlSchemaValidator.ValidateText Method

Definition

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

Overloads

ValidateText(String)

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.

ValidateText(XmlValueGetter)

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.

ValidateText(String)

Source:
XmlSchemaValidator.cs
Source:
XmlSchemaValidator.cs
Source:
XmlSchemaValidator.cs

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.

public:
 void ValidateText(System::String ^ elementValue);
public void ValidateText (string elementValue);
member this.ValidateText : string -> unit
Public Sub ValidateText (elementValue As String)

Parameters

elementValue
String

A text string to validate in the current element context.

Exceptions

The text string specified is not allowed in the current element context.

The ValidateText method was not called in the correct sequence. For example, the ValidateText method is called after calling ValidateAttribute.

The text string parameter cannot be null.

Remarks

The following are important notes to consider when using the ValidateText method.

  • If the element has simple content, the text string specified is concatenated on each call to the ValidateText method until the ValidateEndElement method is called. When the ValidateEndElement method is called, all the text is validated.

  • If the element has complex content, no text concatenation occurs.

Applies to

ValidateText(XmlValueGetter)

Source:
XmlSchemaValidator.cs
Source:
XmlSchemaValidator.cs
Source:
XmlSchemaValidator.cs

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.

public:
 void ValidateText(System::Xml::Schema::XmlValueGetter ^ elementValue);
public void ValidateText (System.Xml.Schema.XmlValueGetter elementValue);
member this.ValidateText : System.Xml.Schema.XmlValueGetter -> unit
Public Sub ValidateText (elementValue As XmlValueGetter)

Parameters

elementValue
XmlValueGetter

An XmlValueGetterdelegate used to pass the text value as a Common Language Runtime (CLR) type compatible with the XML Schema Definition Language (XSD) type of the attribute.

Exceptions

The text string specified is not allowed in the current element context.

The ValidateText method was not called in the correct sequence. For example, the ValidateText method is called after calling ValidateAttribute.

The text string parameter cannot be null.

Remarks

The following are important notes to consider when using the ValidateText method.

  • If the element has simple content, the text string specified is concatenated on each call to the ValidateText method until the ValidateEndElement method is called. When the ValidateEndElement method is called, all the text is validated.

  • If the element has complex content, no text concatenation occurs.

See also

Applies to