XmlSchemaMinInclusiveFacet クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > XmlSchemaMinInclusiveFacet クラスの意味・解説 

XmlSchemaMinInclusiveFacet クラス

W3C (World Wide Web Consortium) で指定されXML スキーマminInclusive 要素表します。このクラス使用すると、simpleType 要素最小値制限設定できます要素の値は minInclusive 要素の値以上でなければなりません。

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

Public Class XmlSchemaMinInclusiveFacet
    Inherits XmlSchemaFacet
Dim instance As XmlSchemaMinInclusiveFacet
public class XmlSchemaMinInclusiveFacet : XmlSchemaFacet
public ref class XmlSchemaMinInclusiveFacet
 : public XmlSchemaFacet
public class XmlSchemaMinInclusiveFacet extends
 XmlSchemaFacet
public class XmlSchemaMinInclusiveFacet extends
 XmlSchemaFacet
使用例使用例

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

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

Class XMLSchemaExamples
    Public Shared Sub Main()

        Dim schema As New
 XmlSchema()

        ' <xs:simpleType name="OrderQuantityType">
        Dim OrderQuantityType As New
 XmlSchemaSimpleType()
        OrderQuantityType.Name = "OrderQuantityType"

        ' <xs:restriction base="xs:int">
        Dim restriction As New
 XmlSchemaSimpleTypeRestriction()
        restriction.BaseTypeName = New XmlQualifiedName("int",
 "http://www.w3.org/2001/XMLSchema")

        ' <xs:minInclusive value="5"/>
        Dim minInclusive As New
 XmlSchemaMinInclusiveFacet()
        minInclusive.Value = "5"
        restriction.Facets.Add(minInclusive)

        OrderQuantityType.Content = restriction

        schema.Items.Add(OrderQuantityType)

        ' <xs:element name="item">
        Dim element As New
 XmlSchemaElement()
        element.Name = "item"

        ' <xs:complexType>
        Dim complexType As New
 XmlSchemaComplexType()

        ' <xs:attribute name="OrderQuantity" type="OrderQuantityType"/>
        Dim OrderQuantityAttribute As New
 XmlSchemaAttribute()
        OrderQuantityAttribute.Name = "OrderQuantity"
        OrderQuantityAttribute.SchemaTypeName = New XmlQualifiedName("OrderQuantityType",
 "")
        complexType.Attributes.Add(OrderQuantityAttribute)

        element.SchemaType = complexType

        schema.Items.Add(element)

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

        schemaSet.Add(schema)
        schemaSet.Compile()

        Dim compiledSchema As XmlSchema = Nothing

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

        Dim nsmgr As New
 XmlNamespaceManager(New NameTable())
        nsmgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema")
        compiledSchema.Write(Console.Out, nsmgr)
    End Sub

    Public Shared Sub ValidationCallbackOne(ByVal
 sender As Object, ByVal
 args As ValidationEventArgs)
        Console.WriteLine(args.Message)
    End Sub

End Class
using System;
using System.Xml;
using System.Xml.Schema;

class XMLSchemaExamples
{
    public static void Main()
    {

        XmlSchema schema = new XmlSchema();

        // <xs:simpleType name="OrderQuantityType">
        XmlSchemaSimpleType OrderQuantityType = new XmlSchemaSimpleType();
        OrderQuantityType.Name = "OrderQuantityType";

        // <xs:restriction base="xs:int">
        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
        restriction.BaseTypeName = new XmlQualifiedName("int",
 "http://www.w3.org/2001/XMLSchema");

        // <xs:minInclusive value="5"/>
        XmlSchemaMinInclusiveFacet minInclusive = new XmlSchemaMinInclusiveFacet();
        minInclusive.Value = "5";
        restriction.Facets.Add(minInclusive);

        OrderQuantityType.Content = restriction;

        schema.Items.Add(OrderQuantityType);

        // <xs:element name="item">
        XmlSchemaElement element = new XmlSchemaElement();
        element.Name = "item";

        // <xs:complexType>
        XmlSchemaComplexType complexType = new XmlSchemaComplexType();

        // <xs:attribute name="OrderQuantity" type="OrderQuantityType"/>
        XmlSchemaAttribute OrderQuantityAttribute = new XmlSchemaAttribute();
        OrderQuantityAttribute.Name = "OrderQuantity";
        OrderQuantityAttribute.SchemaTypeName = new XmlQualifiedName("OrderQuantityType",
 "");
        complexType.Attributes.Add(OrderQuantityAttribute);

        element.SchemaType = complexType;

        schema.Items.Add(element);

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

        XmlSchema compiledSchema = null;

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

        XmlNamespaceManager nsmgr = new XmlNamespaceManager(new
 NameTable());
        nsmgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");
        compiledSchema.Write(Console.Out, nsmgr);
    }

    public static void ValidationCallbackOne(object
 sender, ValidationEventArgs args)
    {
        Console.WriteLine(args.Message);
    }
}

前述コード例に対して生成される XML ファイル次に示します

<?xml version="1.0" encoding="IBM437"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:simpleType name="OrderQuantityType">
        <xs:restriction base="xs:int">
            <xs:minInclusive value="5"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:element name="item">
        <xs:complexType>
            <xs:attribute name="OrderQuantity"
 type="OrderQuantityType"/>
        </xs:complexType>
    </xs:element>

</xs:schema>
継承階層継承階層
System.Object
   System.Xml.Schema.XmlSchemaObject
     System.Xml.Schema.XmlSchemaAnnotated
       System.Xml.Schema.XmlSchemaFacet
        System.Xml.Schema.XmlSchemaMinInclusiveFacet
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlSchemaMinInclusiveFacet メンバ
System.Xml.Schema 名前空間



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

辞書ショートカット

すべての辞書の索引

「XmlSchemaMinInclusiveFacet クラス」の関連用語

XmlSchemaMinInclusiveFacet クラスのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS