XmlSchemaValidatorとは? わかりやすく解説

XmlSchemaValidator イベント


パブリック イベントパブリック イベント

  名前 説明
パブリック イベント ValidationEventHandler スキーマ検証しているときに検出されるスキーマ検証警告検証エラー受信する ValidationEventHandler。
参照参照

関連項目

XmlSchemaValidator クラス
System.Xml.Schema 名前空間
XmlSerializer

その他の技術情報

XmlSchemaValidator のプッシュ ベース検証

XmlSchemaValidator クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

XML スキーマ定義言語 (XSD: XML Schema Definition Language) スキーマ検証エンジン表しますXmlSchemaValidator クラス継承できません。

名前空間: System.Xml.Schema
アセンブリ: System.Xml (system.xml.dll 内)
構文構文

Public NotInheritable Class
 XmlSchemaValidator
Dim instance As XmlSchemaValidator
public sealed class XmlSchemaValidator
public ref class XmlSchemaValidator sealed
public final class XmlSchemaValidator
public final class XmlSchemaValidator
解説解説

XmlSchemaValidator クラスには、プッシュ ベース方法XML スキーマについて XML データ検証するための、効率的パフォーマンスの高い機構用意されています。たとえば、XmlSchemaValidator クラス使用すると、XML infoset を XML ドキュメントとしてシリアル化しないでそのまま検証し次に検証 XML リーダー使用してドキュメントを再解析できますXmlSchemaValidator クラスは、カスタム XML データ ソース対す検証エンジン構築するために使用したり、検証 XML ライタ構築するための方法として使用したりすることもできます

XmlSchemaValidator クラス詳細については、「XmlSchemaValidator のプッシュ ベース検証」のトピック参照してください

セキュリティに関するメモセキュリティに関するメモ

既定では、XmlSchemaValidator オブジェクトの ProcessInlineSchema 検証フラグおよび ProcessSchemaLocation 検証フラグ設定されません。また既定では、XmlSchemaValidator オブジェクトの XmlResolver プロパティは、null 参照 (Visual Basic では Nothing) に設定されます。このためインクルード要素インポート要素、または再定義要素参照される外部スキーマ既定では解決されません。

使用例使用例

contosoBooks.xsd スキーマcontosoBooks.xml ファイル検証する例を次に示します。この例では、XmlSerializer クラス使用して contosoBooks.xml ファイルを逆シリアル化し、ノードの値を XmlSchemaValidator クラスメソッド渡します

Imports System
Imports System.Xml
Imports System.Xml.Schema
Imports System.Xml.Serialization

Namespace Microsoft.Samples.Xml.Schema

    Class XmlSchemaValidatorExamples

        Shared Sub Main()

            ' The XML document to deserialize into the XmlSerializer
 object.
            Dim reader As XmlReader = XmlReader.Create("contosoBooks.xml")

            ' The XmlSerializer object.
            Dim serializer As XmlSerializer
 = New XmlSerializer(GetType(ContosoBooks))
            Dim books As ContosoBooks = CType(serializer.Deserialize(reader),
 ContosoBooks)

            ' The XmlSchemaSet object containing the schema used to
 validate the XML document.
            Dim schemaSet As XmlSchemaSet =
 New XmlSchemaSet()
            schemaSet.Add("http://www.contoso.com/books",
 "contosoBooks.xsd")

            ' The XmlNamespaceManager object used to handle namespaces.
            Dim manager As XmlNamespaceManager
 = New XmlNamespaceManager(reader.NameTable)

            ' Assign a ValidationEventHandler to handle schema validation
 warnings and errors.
            Dim validator As XmlSchemaValidator
 = New XmlSchemaValidator(reader.NameTable, schemaSet, manager,
 XmlSchemaValidationFlags.None)
            'validator.ValidationEventHandler += New ValidationEventHandler(SchemaValidationEventHandler)
            AddHandler validator.ValidationEventHandler, AddressOf
 SchemaValidationEventHandler

            ' Initialize the XmlSchemaValidator object.
            validator.Initialize()

            ' Validate the bookstore element, verify that all required
 attributes are present
            ' and prepare to validate child content.
            validator.ValidateElement("bookstore",
 "http://www.contoso.com/books", Nothing)
            validator.ValidateEndOfAttributes(Nothing)

            ' Get the next exptected element in the bookstore context.
            Dim particles() As XmlSchemaParticle
 = validator.GetExpectedParticles()
            Dim nextElement As XmlSchemaElement
 = particles(0)
            Console.WriteLine("Expected Element: '{0}'", nextElement.Name)

            For Each book As
 BookType In books.book
                ' Validate the book element.
                validator.ValidateElement("book",
 "http://www.contoso.com/books", Nothing)

                ' Get the exptected attributes for the book element.
                Console.Write(vbCrLf & "Expected attributes:
 ")
                Dim attributes() As XmlSchemaAttribute
 = validator.GetExpectedAttributes()
                For Each attribute As
 XmlSchemaAttribute In attributes
                    Console.Write("'{0}' ", attribute.Name)
                Next
                Console.WriteLine()

                ' Validate the genre attribute and display it's post
 schema validation information.
                If Not book.Genre Is
 Nothing Then
                    validator.ValidateAttribute("genre",
 "", book.Genre, schemaInfo)
                End If
                DisplaySchemaInfo()

                ' Validate the publicationdate attribute and display
 it's post schema validation information.
                If Not book.PublicationDate
 = Nothing Then
                    validator.ValidateAttribute("publicationdate",
 "", dateTimeGetter(book.PublicationDate), schemaInfo)
                End If
                DisplaySchemaInfo()

                ' Validate the ISBN attribute and display it's post
 schema validation information.
                If Not book.Isbn Is
 Nothing Then
                    validator.ValidateAttribute("ISBN",
 "", book.Isbn, schemaInfo)
                End If
                DisplaySchemaInfo()

                ' Verify that all required attributes of the book element
 are present
                ' and prepare to validate child content.
                validator.ValidateEndOfAttributes(Nothing)

                ' Validate the title element and it's content.
                validator.ValidateElement("title",
 "http://www.contoso.com/books", Nothing)
                validator.ValidateEndElement(Nothing, book.Title)

                ' Validate the author element, verify that all required
 attributes are present
                ' and prepare to validate child content.
                validator.ValidateElement("author",
 "http://www.contoso.com/books", Nothing)
                validator.ValidateEndOfAttributes(Nothing)

                If Not book.Author.Name Is
 Nothing Then
                    ' Validate the name element and it's content.
                    validator.ValidateElement("name",
 "http://www.contoso.com/books", Nothing)
                    validator.ValidateEndElement(Nothing, book.Author.Name)
                End If

                If Not book.Author.FirstName
 Is Nothing Then
                    ' Validate the first-name element and it's content.
                    validator.ValidateElement("first-name",
 "http://www.contoso.com/books", Nothing)
                    validator.ValidateEndElement(Nothing, book.Author.FirstName)

                End If

                If Not book.Author.LastName
 Is Nothing Then
                    ' Validate the last-name element and it's content.
                    validator.ValidateElement("last-name",
 "http://www.contoso.com/books", Nothing)
                    validator.ValidateEndElement(Nothing, book.Author.LastName)
                End If

                ' Validate the content of the author element.
                validator.ValidateEndElement(Nothing)

                ' Validate the price element and it's content.
                validator.ValidateElement("price",
 "http://www.contoso.com/books", Nothing)
                validator.ValidateEndElement(Nothing, book.Price)

                ' Validate the content of the book element.
                validator.ValidateEndElement(Nothing)
            Next

            ' Validate the content of the bookstore element.
            validator.ValidateEndElement(Nothing)

            ' Close the XmlReader object.
            reader.Close()

        End Sub

        Shared schemaInfo As XmlSchemaInfo
 = New XmlSchemaInfo()
        Shared dateTimeGetterContent As Object

        Shared Function dateTimeGetterHandle()
 As Object

            Return dateTimeGetterContent

        End Function

        Shared Function dateTimeGetter(ByVal
 dateTime As DateTime) As XmlValueGetter

            dateTimeGetterContent = dateTime
            Return New XmlValueGetter(AddressOf
 dateTimeGetterHandle)

        End Function

        Shared Sub DisplaySchemaInfo()

            If Not schemaInfo.SchemaElement
 Is Nothing Then
                Console.WriteLine("Element '{0}' with type '{1}'
 is '{2}'", schemaInfo.SchemaElement.Name, schemaInfo.SchemaType, schemaInfo.Validity)
            ElseIf Not schemaInfo.SchemaAttribute
 Is Nothing Then
                Console.WriteLine("Attribute '{0}' with type '{1}'
 is '{2}'", schemaInfo.SchemaAttribute.Name, schemaInfo.SchemaType, schemaInfo.Validity)
            End If

        End Sub

        Shared Sub SchemaValidationEventHandler(ByVal
 sender As Object, ByVal
 e As ValidationEventArgs)

            Select Case e.Severity
                Case XmlSeverityType.Error
                    Console.WriteLine(vbCrLf & "Error: {0}",
 e.Message)
                    Exit Sub
                Case XmlSeverityType.Warning
                    Console.WriteLine(vbCrLf & "Warning: {0}",
 e.Message)
                    Exit Sub
            End Select

        End Sub

    End Class

    <XmlRootAttribute("bookstore", Namespace:="http://www.contoso.com/books",
 IsNullable:=False)> _
    Public Class ContosoBooks

        <XmlElementAttribute("book")> _
        Public book() As BookType

    End Class

    Public Class BookType

        <XmlAttributeAttribute("genre")> _
        Public Genre As String

        <XmlAttributeAttribute("publicationdate",
 DataType:="date")> _
        Public PublicationDate As DateTime

        <XmlAttributeAttribute("ISBN")> _
        Public Isbn As String

        <XmlElementAttribute("title")> _
        Public Title As String

        <XmlElementAttribute("author")> _
        Public Author As BookAuthor

        <XmlElementAttribute("price")> _
        Public Price As Decimal

    End Class

    Public Class BookAuthor

        <XmlElementAttribute("name")> _
        Public Name As String

        <XmlElementAttribute("first-name")>
 _
        Public FirstName As String

        <XmlElementAttribute("last-name")> _
        Public LastName As String

    End Class

End Namespace
using System;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace Microsoft.Samples.Xml.Schema
{
    class XmlSchemaValidatorExamples
    {
        static void Main()
        {
            // The XML document to deserialize into the XmlSerializer
 object.
            XmlReader reader = XmlReader.Create("contosoBooks.xml");

            // The XmlSerializer object.
            XmlSerializer serializer = new XmlSerializer(typeof(ContosoBooks));
            ContosoBooks books = (ContosoBooks)serializer.Deserialize(reader);

            // The XmlSchemaSet object containing the schema used to
 validate the XML document.
            XmlSchemaSet schemaSet = new XmlSchemaSet();
            schemaSet.Add("http://www.contoso.com/books",
 "contosoBooks.xsd");

            // The XmlNamespaceManager object used to handle namespaces.
            XmlNamespaceManager manager = new XmlNamespaceManager(reader.NameTable);

            // Assign a ValidationEventHandler to handle schema validation
 warnings and errors.
            XmlSchemaValidator validator = new XmlSchemaValidator(reader.NameTable,
 schemaSet, manager, XmlSchemaValidationFlags.None);
            validator.ValidationEventHandler += new ValidationEventHandler(SchemaValidationEventHandler);

            // Initialize the XmlSchemaValidator object.
            validator.Initialize();

            // Validate the bookstore element, verify that all required
 attributes are present
            // and prepare to validate child content.
            validator.ValidateElement("bookstore", "http://www.contoso.com/books",
 null);
            validator.ValidateEndOfAttributes(null);

            // Get the next exptected element in the bookstore context.
            XmlSchemaParticle[] particles = validator.GetExpectedParticles();
            XmlSchemaElement nextElement = particles[0] as XmlSchemaElement;
            Console.WriteLine("Expected Element: '{0}'", nextElement.Name);

            foreach (BookType book in books.Book)
            {
                // Validate the book element.
                validator.ValidateElement("book", "http://www.contoso.com/books",
 null);

                // Get the exptected attributes for the book element.
                Console.Write("\nExpected attributes: ");
                XmlSchemaAttribute[] attributes = validator.GetExpectedAttributes();
                foreach (XmlSchemaAttribute attribute in
 attributes)
                {
                    Console.Write("'{0}' ", attribute.Name);
                }
                Console.WriteLine();

                // Validate the genre attribute and display it's post
 schema validation information.
                if (book.Genre != null)
                {
                    validator.ValidateAttribute("genre", "",
 book.Genre, schemaInfo);
                }
                DisplaySchemaInfo();

                // Validate the publicationdate attribute and display
 it's post schema validation information.
                if (book.PublicationDate != null)
                {
                    validator.ValidateAttribute("publicationdate", "",
 dateTimeGetter(book.PublicationDate), schemaInfo);
                }
                DisplaySchemaInfo();

                // Validate the ISBN attribute and display it's post
 schema validation information.
                if (book.Isbn != null)
                {
                    validator.ValidateAttribute("ISBN", "", book.Isbn,
 schemaInfo);
                }
                DisplaySchemaInfo();

                // Verify that all required attributes of the book element
 are present
                // and prepare to validate child content.
                validator.ValidateEndOfAttributes(null);

                // Validate the title element and it's content.
                validator.ValidateElement("title", "http://www.contoso.com/books",
 null);
                validator.ValidateEndElement(null, book.Title);

                // Validate the author element, verify that all required
 attributes are present
                // and prepare to validate child content.
                validator.ValidateElement("author", "http://www.contoso.com/books",
 null);
                validator.ValidateEndOfAttributes(null);

                if (book.Author.Name != null)
                {
                    // Validate the name element and it's content.
                    validator.ValidateElement("name", "http://www.contoso.com/books",
 null);
                    validator.ValidateEndElement(null, book.Author.Name);
                }

                if (book.Author.FirstName != null)
                {
                    // Validate the first-name element and it's content.
                    validator.ValidateElement("first-name", "http://www.contoso.com/books",
 null);
                    validator.ValidateEndElement(null, book.Author.FirstName);

                }

                if (book.Author.LastName != null)
                {
                    // Validate the last-name element and it's content.
                    validator.ValidateElement("last-name", "http://www.contoso.com/books",
 null);
                    validator.ValidateEndElement(null, book.Author.LastName);
                }

                // Validate the content of the author element.
                validator.ValidateEndElement(null);

                // Validate the price element and it's content.
                validator.ValidateElement("price", "http://www.contoso.com/books",
 null);
                validator.ValidateEndElement(null, book.Price);

                // Validate the content of the book element.
                validator.ValidateEndElement(null);
            }

            // Validate the content of the bookstore element.
            validator.ValidateEndElement(null);

            // Close the XmlReader object.
            reader.Close();
        }

        static XmlSchemaInfo schemaInfo = new
 XmlSchemaInfo();
        static object dateTimeGetterContent;

        static object dateTimeGetterHandle()
        {
            return dateTimeGetterContent;
        }

        static XmlValueGetter dateTimeGetter(DateTime dateTime)
        {
            dateTimeGetterContent = dateTime;
            return new XmlValueGetter(dateTimeGetterHandle);
        }

        static void DisplaySchemaInfo()
        {
            if (schemaInfo.SchemaElement != null)
            {
                Console.WriteLine("Element '{0}' with type '{1}' is '{2}'"
,
                    schemaInfo.SchemaElement.Name, schemaInfo.SchemaType, schemaInfo.Validity);
            }
            else if (schemaInfo.SchemaAttribute
 != null)
            {
                Console.WriteLine("Attribute '{0}' with type '{1}' is '{2}'"
,
                    schemaInfo.SchemaAttribute.Name, schemaInfo.SchemaType, schemaInfo.Validity);
            }
        }

        static void SchemaValidationEventHandler(object
 sender, ValidationEventArgs e)
        {
            switch (e.Severity)
            {
                case XmlSeverityType.Error:
                    Console.WriteLine("\nError: {0}", e.Message);
                    break;
                case XmlSeverityType.Warning:
                    Console.WriteLine("\nWarning: {0}", e.Message);
                    break;
            }
        }
    }

    [XmlRootAttribute("bookstore", Namespace = "http://www.contoso.com/books",
 IsNullable = false)]
    public class ContosoBooks
    {
        [XmlElementAttribute("book")]
        public BookType[] Book;
    }

    public class BookType
    {
        [XmlAttributeAttribute("genre")]
        public string Genre;

        [XmlAttributeAttribute("publicationdate", DataType = "date")]
        public DateTime PublicationDate;

        [XmlAttributeAttribute("ISBN")]
        public string Isbn;

        [XmlElementAttribute("title")]
        public string Title;

        [XmlElementAttribute("author")]
        public BookAuthor Author;

        [XmlElementAttribute("price")]
        public Decimal Price;
    }

    public class BookAuthor
    {
        [XmlElementAttribute("name")]
        public string Name;

        [XmlElementAttribute("first-name")]
        public string FirstName;

        [XmlElementAttribute("last-name")]
        public string LastName;
    }
}

この例では、入力として、contosoBooks.xml というファイル使用してます。

<bookstore xmlns="http://www.contoso.com/books">
    <book genre="autobiography"
 publicationdate="1981-03-22" ISBN="1-861003-11-0">
        <title>The
 Autobiography of Benjamin Franklin</title>
        <author>
            <first-name>Benjamin</first-name>
            <last-name>Franklin</last-name>
        </author>
        <price>8.99</price>
    </book>
    <book genre="novel" publicationdate="1967-11-17"
 ISBN="0-201-63361-2">
        <title>The
 Confidence Man</title>
        <author>
            <first-name>Herman</first-name>
            <last-name>Melville</last-name>
        </author>
        <price>11.99</price>
    </book>
    <book genre="philosophy"
 publicationdate="1991-02-15" ISBN="1-861001-57-6">
        <title>The
 Gorgias</title>
        <author>
            <name>Plato</name>
        </author>
        <price>9.99</price>
    </book>
</bookstore>

またこの例では、入力として、contosoBooks.xsd使用してます。

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified"
 elementFormDefault="qualified" targetNamespace="http://www.contoso.com/books"
 xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="bookstore">
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded"
 name="book">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element
 name="title" type="xs:string" />
                            <xs:element
 name="author">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element
 minOccurs="0" name="name" type="xs:string" />
                                        <xs:element
 minOccurs="0" name="first-name" type="xs:string"
 />
                                        <xs:element
 minOccurs="0" name="last-name" type="xs:string" />
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                            <xs:element
 name="price" type="xs:decimal" />
                        </xs:sequence>
                        <xs:attribute
 name="genre" type="xs:string" use="required" />
                        <xs:attribute
 name="publicationdate" type="xs:date" use="required"
 />
                        <xs:attribute
 name="ISBN" type="xs:string" use="required" />
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
継承階層継承階層
System.Object
  System.Xml.Schema.XmlSchemaValidator
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlSchemaValidator メンバ
System.Xml.Schema 名前空間
XmlSerializer
その他の技術情報
XmlSchemaValidator のプッシュ ベース検証

XmlSchemaValidator コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

XmlSchemaValidator クラス新しインスタンス初期化します。

名前空間: System.Xml.Schema
アセンブリ: System.Xml (system.xml.dll 内)
構文構文

Public Sub New ( _
    nameTable As XmlNameTable, _
    schemas As XmlSchemaSet, _
    namespaceResolver As IXmlNamespaceResolver, _
    validationFlags As XmlSchemaValidationFlags _
)
Dim nameTable As XmlNameTable
Dim schemas As XmlSchemaSet
Dim namespaceResolver As IXmlNamespaceResolver
Dim validationFlags As XmlSchemaValidationFlags

Dim instance As New XmlSchemaValidator(nameTable,
 schemas, namespaceResolver, validationFlags)
public XmlSchemaValidator (
    XmlNameTable nameTable,
    XmlSchemaSet schemas,
    IXmlNamespaceResolver namespaceResolver,
    XmlSchemaValidationFlags validationFlags
)
public:
XmlSchemaValidator (
    XmlNameTable^ nameTable, 
    XmlSchemaSet^ schemas, 
    IXmlNamespaceResolver^ namespaceResolver, 
    XmlSchemaValidationFlags validationFlags
)
public XmlSchemaValidator (
    XmlNameTable nameTable, 
    XmlSchemaSet schemas, 
    IXmlNamespaceResolver namespaceResolver, 
    XmlSchemaValidationFlags validationFlags
)
public function XmlSchemaValidator (
    nameTable : XmlNameTable, 
    schemas : XmlSchemaSet, 
    namespaceResolver : IXmlNamespaceResolver, 
    validationFlags : XmlSchemaValidationFlags
)

パラメータ

nameTable

要素名と属性名の最小単位分割され文字列格納された XmlNameTable オブジェクト

schemas

検証使用する XML スキーマ定義言語 (XSD) スキーマ格納された XmlSchemaSet オブジェクト

namespaceResolver

検証中に検出される名前空間解決するために使用する IXmlNamespaceResolver オブジェクト

validationFlags

スキーマ検証オプション指定する XmlSchemaValidationFlags 値。

例外例外
例外種類条件

ArgumentNullException

指定されパラメータ1 つ以上が null 参照 (Visual Basic では Nothing) です。

XmlSchemaException

XmlSchemaSet パラメータ内のスキーマコンパイルしているときにエラー発生しました

解説解説

XmlSchemaValidator コンストラクタ使用するときに考慮する必要がある重要な注意事項次に示します

セキュリティに関するメモセキュリティに関するメモ

既定では、XmlSchemaValidator オブジェクトProcessInlineSchema 検証フラグおよび ProcessSchemaLocation 検証フラグ設定されません。また既定では、XmlSchemaValidator オブジェクトの XmlResolver プロパティは、null 参照 (Visual Basic では Nothing) に設定されます。このためインクルード要素インポート要素、または再定義要素参照される外部スキーマ既定では解決されません。

使用例使用例
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlSchemaValidator クラス
XmlSchemaValidator メンバ
System.Xml.Schema 名前空間
XmlNameTable クラス
XmlSchemaSet クラス
IXmlNamespaceResolver インターフェイス
XmlSchemaValidationFlags 列挙

XmlSchemaValidator プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ XmlResolver xs:import 要素xs:include 要素および xsi:schemaLocation 属性xsi:noNamespaceSchemaLocation 属性解決使用する XmlResolver オブジェクト設定します
参照参照

関連項目

XmlSchemaValidator クラス
System.Xml.Schema 名前空間
XmlSerializer

その他の技術情報

XmlSchemaValidator のプッシュ ベース検証

XmlSchemaValidator メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド AddSchema 検証使用するスキーマセットXML スキーマ定義言語 (XSD) スキーマ追加します
パブリック メソッド EndValidation 検証終了しXML ドキュメント全体に対して ID 制約チェックします
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 ( Object から継承されます。)
パブリック メソッド GetExpectedAttributes 現在の要素コンテキストに対して予期される属性返します
パブリック メソッド GetExpectedParticles 現在の要素コンテキスト予期されるパーティクル返します
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 ( Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド GetUnspecifiedDefaultAttributes これまで要素コンテキストで ValidateAttribute メソッド使用して検証されたことのない、既定値を持つ任意の属性について、XmlSchemaAttribute オブジェクト指定された ArrayList を設定します
パブリック メソッド Initialize オーバーロードされます。 XmlSchemaValidator オブジェクトの状態を初期化します。
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド SkipToEndElement 現在の要素内容対す検証スキップし、親要素コンテキスト内容検証するように XmlSchemaValidator オブジェクト準備します
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
パブリック メソッド ValidateAttribute オーバーロードされます現在の要素コンテキスト属性検証します。
パブリック メソッド ValidateElement オーバーロードされます現在のコンテキスト要素検証します。
パブリック メソッド ValidateEndElement オーバーロードされます単純な内容要素に対しては、要素テキストがそのデータ型従った有効な内容かどうかについて検証し複雑な内容要素に対しては、現在の要素内容が完全かどうか検証します。
パブリック メソッド ValidateEndOfAttributes 必要なすべての属性要素コンテキスト存在するかどうか検証し要素の子内容検証するための XmlSchemaValidator オブジェクト準備します
パブリック メソッド ValidateText オーバーロードされます現在の要素コンテキストテキスト許可されているかどうか検証し現在の要素単純な内容場合検証用のテキスト累積します。
パブリック メソッド ValidateWhitespace オーバーロードされます現在の要素コンテキスト空白許可されているかどうか検証し現在の要素単純な内容場合検証用の空白累積します。
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

XmlSchemaValidator クラス
System.Xml.Schema 名前空間
XmlSerializer

その他の技術情報

XmlSchemaValidator のプッシュ ベース検証

XmlSchemaValidator メンバ

XML スキーマ定義言語 (XSD: XML Schema Definition Language) スキーマ検証エンジン表します。XmlSchemaValidator クラス継承できません。

XmlSchemaValidator データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド XmlSchemaValidator XmlSchemaValidator クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ XmlResolver xs:import 要素xs:include 要素および xsi:schemaLocation 属性xsi:noNamespaceSchemaLocation 属性解決使用する XmlResolver オブジェクト設定します
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド AddSchema 検証使用するスキーマセットXML スキーマ定義言語 (XSD) スキーマ追加します
パブリック メソッド EndValidation 検証終了しXML ドキュメント全体に対して ID 制約チェックします
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 (Object から継承されます。)
パブリック メソッド GetExpectedAttributes 現在の要素コンテキストに対して予期される属性返します
パブリック メソッド GetExpectedParticles 現在の要素コンテキスト予期されるパーティクル返します
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 (Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド GetUnspecifiedDefaultAttributes これまで要素コンテキストで ValidateAttribute メソッド使用して検証されたことのない、既定値を持つ任意の属性について、XmlSchemaAttribute オブジェクト指定された ArrayList を設定します
パブリック メソッド Initialize オーバーロードされますXmlSchemaValidator オブジェクトの状態を初期化します。
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド SkipToEndElement 現在の要素内容対す検証スキップし、親要素コンテキスト内容検証するように XmlSchemaValidator オブジェクト準備します
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
パブリック メソッド ValidateAttribute オーバーロードされます現在の要素コンテキスト属性検証します。
パブリック メソッド ValidateElement オーバーロードされます現在のコンテキスト要素検証します。
パブリック メソッド ValidateEndElement オーバーロードされます単純な内容要素に対しては、要素テキストがそのデータ型従った有効な内容かどうかについて検証し複雑な内容要素に対しては、現在の要素内容が完全かどうか検証します。
パブリック メソッド ValidateEndOfAttributes 必要なすべての属性要素コンテキスト存在するかどうか検証し要素の子内容検証するための XmlSchemaValidator オブジェクト準備します
パブリック メソッド ValidateText オーバーロードされます現在の要素コンテキストテキスト許可されているかどうか検証し現在の要素単純な内容場合検証用のテキスト累積します。
パブリック メソッド ValidateWhitespace オーバーロードされます現在の要素コンテキスト空白許可されているかどうか検証し現在の要素単純な内容場合検証用の空白累積します。
プロテクト メソッドプロテクト メソッド
パブリック イベントパブリック イベント
  名前 説明
パブリック イベント ValidationEventHandler スキーマ検証しているときに検出されるスキーマ検証警告検証エラー受信する ValidationEventHandler。
参照参照

関連項目

XmlSchemaValidator クラス
System.Xml.Schema 名前空間
XmlSerializer

その他の技術情報

XmlSchemaValidator のプッシュ ベース検証


このページでは「.NET Framework クラス ライブラリ リファレンス」からXmlSchemaValidatorを検索した結果を表示しています。
Weblioに収録されているすべての辞書からXmlSchemaValidatorを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からXmlSchemaValidator を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「XmlSchemaValidator」の関連用語

XmlSchemaValidatorのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



XmlSchemaValidatorのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS