Export (0) Print
Expand All

Extensions.GetSchemaInfo Method (XAttribute)

Gets the post-schema-validation infoset (PSVI) of a validated attribute.

Namespace:  System.Xml.Schema
Assembly:  System.Xml.Linq (in System.Xml.Linq.dll)

public static IXmlSchemaInfo GetSchemaInfo(
	this XAttribute source
)

Parameters

source
Type: System.Xml.Linq.XAttribute

An XAttribute that has been previously validated.

Return Value

Type: System.Xml.Schema.IXmlSchemaInfo
A IXmlSchemaInfo that contains the post-schema-validation infoset for an XAttribute.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type XAttribute. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

You can use the IXmlSchemaInfo returned by this method to determine certain characteristics of a validated attribute. For example, you can determine if the attribute came from a default attribute value in an XSD.

You use the SchemaAttribute property to get a partial validation type (XmlSchemaAttribute). You can use it to revalidate an attribute without validating an entire document.

For an example of this property, see Validate.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft