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

XmlSchemaException クラス

スキーマ例外に関する詳細情報返します

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

<SerializableAttribute> _
Public Class XmlSchemaException
    Inherits SystemException
Dim instance As XmlSchemaException
[SerializableAttribute] 
public class XmlSchemaException : SystemException
[SerializableAttribute] 
public ref class XmlSchemaException : public
 SystemException
/** @attribute SerializableAttribute() */ 
public class XmlSchemaException extends SystemException
SerializableAttribute 
public class XmlSchemaException extends
 SystemException
解説解説
使用例使用例

XmlSchemaException クラス使用する例を次に示します

Option Strict On
Option Explicit On

Imports System
Imports System.Xml
Imports System.Xml.Schema
Imports System.IO
Imports Microsoft.VisualBasic

Public Class ValidXSD
    Public Shared Sub Main()
        Dim fs As FileStream
        Dim schema As XmlSchema
        Try
            fs = New FileStream("example.xsd",
 FileMode.Open)
            schema = XmlSchema.Read(fs, New ValidationEventHandler(AddressOf
 ShowCompileError))

            Dim schemaSet As New
 XmlSchemaSet()
            AddHandler schemaSet.ValidationEventHandler, AddressOf
 ShowCompileError

            schemaSet.Add(schema)
            schemaSet.Compile()

            Dim compiledSchema As XmlSchema
 = Nothing

            For Each schema1 As
 XmlSchema In schemaSet.Schemas()
                compiledSchema = schema1
            Next

            schema = compiledSchema

            If schema.IsCompiled Then
                ' Schema is successfully compiled. 
                ' Do something with it here.
            End If

        Catch e As XmlSchemaException
            Console.WriteLine("LineNumber = {0}",
 e.LineNumber)
            Console.WriteLine("LinePosition = {0}",
 e.LinePosition)
            Console.WriteLine("Message = {0}", e.Message)
            Console.WriteLine("Source = {0}", e.Source)

        End Try
    End Sub 'Main


    Private Shared Sub ShowCompileError(ByVal
 sender As Object, ByVal
 e As ValidationEventArgs)
        Console.WriteLine("Validation Error: {0}",
 e.Message)
    End Sub 'ShowCompileError
End Class 'ValidXSD
using System;
using System.Xml;
using System.Xml.Schema;
using System.IO;

public class ValidXSD
{
    public static int Main()
    {

        FileStream fs;
        XmlSchema schema;
        try
        {
            fs = new FileStream("example.xsd", FileMode.Open);
            schema = XmlSchema.Read(fs, new ValidationEventHandler(ShowCompileError));

            XmlSchemaSet schemaSet = new XmlSchemaSet();
            schemaSet.ValidationEventHandler += new ValidationEventHandler(ShowCompileError);
            schemaSet.Add(schema);
            schemaSet.Compile();

            XmlSchema compiledSchema = null;

            foreach (XmlSchema schema1 in schemaSet.Schemas())
            {
                compiledSchema = schema1;
            }

            schema = compiledSchema;

            if (schema.IsCompiled)
            {
                // Schema is successfully compiled. 
                // Do something with it here.

            }
            return 0;
        }
        catch (XmlSchemaException e)
        {
            Console.WriteLine("LineNumber = {0}", e.LineNumber);
            Console.WriteLine("LinePosition = {0}", e.LinePosition);
            Console.WriteLine("Message = {0}", e.Message);
            return -1;
        }

    }

    private static void
 ShowCompileError(object sender, ValidationEventArgs e)
    {
        Console.WriteLine("Validation Error: {0}", e.Message);
    }
}
継承階層継承階層
System.Object
   System.Exception
     System.SystemException
      System.Xml.Schema.XmlSchemaException
         System.Xml.Schema.XmlSchemaInferenceException
         System.Xml.Schema.XmlSchemaValidationException
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlSchemaException メンバ
System.Xml.Schema 名前空間

XmlSchemaException コンストラクタ ()


XmlSchemaException コンストラクタ (String)

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

XmlSchemaException クラス新しインスタンスを、指定され例外メッセージ使用して初期化します。

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

public XmlSchemaException (
    string message
)
public:
XmlSchemaException (
    String^ message
)
public XmlSchemaException (
    String message
)
public function XmlSchemaException (
    message : String
)

パラメータ

message

エラー状態の string説明

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlSchemaException クラス
XmlSchemaException メンバ
System.Xml.Schema 名前空間

XmlSchemaException コンストラクタ (String, Exception, Int32, Int32)

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

XmlSchemaException クラス新しインスタンスを、例外メッセージ、この例外発生する原因になった Exception オブジェクトXML行番号、および XML の行位置指定して初期化します。

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

Public Sub New ( _
    message As String, _
    innerException As Exception, _
    lineNumber As Integer, _
    linePosition As Integer _
)
Dim message As String
Dim innerException As Exception
Dim lineNumber As Integer
Dim linePosition As Integer

Dim instance As New XmlSchemaException(message,
 innerException, lineNumber, linePosition)
public XmlSchemaException (
    string message,
    Exception innerException,
    int lineNumber,
    int linePosition
)
public:
XmlSchemaException (
    String^ message, 
    Exception^ innerException, 
    int lineNumber, 
    int linePosition
)
public XmlSchemaException (
    String message, 
    Exception innerException, 
    int lineNumber, 
    int linePosition
)
public function XmlSchemaException (
    message : String, 
    innerException : Exception, 
    lineNumber : int, 
    linePosition : int
)

パラメータ

message

エラー状態の string説明

innerException

この例外発生する原因になった元の T:System.Exception オブジェクト

lineNumber

この例外発生する原因になった XML行番号

linePosition

この例外発生する原因になった XML の行位置

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlSchemaException クラス
XmlSchemaException メンバ
System.Xml.Schema 名前空間

XmlSchemaException コンストラクタ (String, Exception)

XmlSchemaException クラス新しインスタンスを、例外メッセージおよびこの例外発生する原因になった元の Exception オブジェクト指定して初期化します。

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

Public Sub New ( _
    message As String, _
    innerException As Exception _
)
Dim message As String
Dim innerException As Exception

Dim instance As New XmlSchemaException(message,
 innerException)
public XmlSchemaException (
    string message,
    Exception innerException
)
public:
XmlSchemaException (
    String^ message, 
    Exception^ innerException
)
public XmlSchemaException (
    String message, 
    Exception innerException
)
public function XmlSchemaException (
    message : String, 
    innerException : Exception
)

パラメータ

message

エラー状態の string説明

innerException

この例外発生する原因になった元の T:System.Exception オブジェクト

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlSchemaException クラス
XmlSchemaException メンバ
System.Xml.Schema 名前空間

XmlSchemaException コンストラクタ

すべての XmlSchemaException プロパティを、指定した StreamingContextSerializationInfo クラスストリーム転送します
オーバーロードの一覧オーバーロードの一覧

名前 説明
XmlSchemaException () XmlSchemaException クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

XmlSchemaException (String) XmlSchemaException クラス新しインスタンスを、指定され例外メッセージ使用して初期化します。

.NET Compact Framework によってサポートされています。

XmlSchemaException (SerializationInfo, StreamingContext) XmlSchemaExceptionすべてのプロパティを含む指定した SerializationInfo 情報および StreamingContext 情報使用して新しXmlSchemaException オブジェクト構築します
XmlSchemaException (String, Exception) XmlSchemaException クラス新しインスタンスを、例外メッセージおよびこの例外発生する原因になった元の Exception オブジェクト指定して初期化します。

.NET Compact Framework によってサポートされています。

XmlSchemaException (String, Exception, Int32, Int32) XmlSchemaException クラス新しインスタンスを、例外メッセージ、この例外発生する原因になった Exception オブジェクトXML行番号、および XML の行位置指定して初期化します。

.NET Compact Framework によってサポートされています。

参照参照

関連項目

XmlSchemaException クラス
XmlSchemaException メンバ
System.Xml.Schema 名前空間

XmlSchemaException コンストラクタ (SerializationInfo, StreamingContext)

XmlSchemaExceptionすべてのプロパティを含む指定した SerializationInfo 情報および StreamingContext 情報使用して新しXmlSchemaException オブジェクト構築します

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

Protected Sub New ( _
    info As SerializationInfo, _
    context As StreamingContext _
)
Dim info As SerializationInfo
Dim context As StreamingContext

Dim instance As New XmlSchemaException(info,
 context)
protected XmlSchemaException (
    SerializationInfo info,
    StreamingContext context
)
protected:
XmlSchemaException (
    SerializationInfo^ info, 
    StreamingContext context
)
protected XmlSchemaException (
    SerializationInfo info, 
    StreamingContext context
)
protected function XmlSchemaException (
    info : SerializationInfo, 
    context : StreamingContext
)

パラメータ

info

SerializationInfo。

context

StreamingContext。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlSchemaException クラス
XmlSchemaException メンバ
System.Xml.Schema 名前空間

XmlSchemaException プロパティ


XmlSchemaException メソッド


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

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

XmlSchemaException クラス
System.Xml.Schema 名前空間

XmlSchemaException メンバ

スキーマ例外に関する詳細情報返します

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


パブリック コンストラクタパブリック コンストラクタ
( プロテクト コンストラクタ参照)
  名前 説明
パブリック メソッド XmlSchemaException オーバーロードされますすべての XmlSchemaException プロパティを、指定した StreamingContextSerializationInfo クラスストリーム転送します
プロテクト コンストラクタプロテクト コンストラクタ
  名前 説明
プロテクト メソッド XmlSchemaException オーバーロードされますすべての XmlSchemaException プロパティを、指定した StreamingContextSerializationInfo クラスストリーム転送します
パブリック プロパティパブリック プロパティ
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ HResult  特定の例外割り当てられているコード化数値である HRESULT を取得または設定します。(Exception から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

XmlSchemaException クラス
System.Xml.Schema 名前空間


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

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

辞書ショートカット

すべての辞書の索引

「XmlSchemaException」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS