XmlSchemaNotation Kelas

Definisi

notation Mewakili elemen dari Skema XML seperti yang ditentukan oleh World Wide Web Consortium (W3C). Deklarasi Skema notation XML adalah rekonstruksi XML 1.0 NOTATION deklarasi. Tujuan notasi adalah untuk menjelaskan format data non-XML dalam dokumen XML.

public ref class XmlSchemaNotation : System::Xml::Schema::XmlSchemaAnnotated
public class XmlSchemaNotation : System.Xml.Schema.XmlSchemaAnnotated
type XmlSchemaNotation = class
    inherit XmlSchemaAnnotated
Public Class XmlSchemaNotation
Inherits XmlSchemaAnnotated
Warisan

Contoh

Contoh berikut menunjukkan penggunaan XmlSchemaNotation kelas .

using System;
using System.Xml;
using System.Xml.Schema;

class XMLSchemaExamples
{
    public static void Main()
    {

        XmlSchema schema = new XmlSchema();

        // <xs:notation name="jpeg" public="image/jpeg" system="viewer.exe" />
        XmlSchemaNotation notation = new XmlSchemaNotation();
        notation.Name = "jpeg";
        notation.Public = "image/jpeg";
        notation.System = "viewer.exe";

        schema.Items.Add(notation);

        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);
    }
}
Imports System.Xml
Imports System.Xml.Schema

Class XMLSchemaExamples
    Public Shared Sub Main()

        Dim schema As XmlSchema = New XmlSchema()

        ' <xs:notation name="jpeg" public="image/jpeg" system="viewer.exe" />
        Dim notation As XmlSchemaNotation = New XmlSchemaNotation()
        notation.Name = "jpeg"
        notation.Public = "image/jpeg"
        notation.System = "viewer.exe"

        schema.Items.Add(notation)

        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

File XML berikut dibuat untuk contoh kode sebelumnya.

<?xml version="1.0" encoding="IBM437"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:notation name="jpeg" public="image/jpeg" system="viewer.exe" />
</xs:schema>

Konstruktor

Nama Deskripsi
XmlSchemaNotation()

Menginisialisasi instans baru dari kelas XmlSchemaNotation.

Properti

Nama Deskripsi
Annotation

Mendapatkan atau mengatur annotation properti.

(Diperoleh dari XmlSchemaAnnotated)
Id

Mendapatkan atau mengatur id string.

(Diperoleh dari XmlSchemaAnnotated)
LineNumber

Mendapatkan atau mengatur nomor baris dalam file yang schema dirujuk elemen.

(Diperoleh dari XmlSchemaObject)
LinePosition

Mendapatkan atau mengatur posisi baris dalam file yang schema dirujuk elemen.

(Diperoleh dari XmlSchemaObject)
Name

Mendapatkan atau mengatur nama notasi.

Namespaces

Mendapatkan atau mengatur XmlSerializerNamespaces untuk digunakan dengan objek skema ini.

(Diperoleh dari XmlSchemaObject)
Parent

Mendapatkan atau mengatur induk dari ini XmlSchemaObject.

(Diperoleh dari XmlSchemaObject)
Public

Mendapatkan atau mengatur public pengidentifikasi.

SourceUri

Mendapatkan atau mengatur lokasi sumber untuk file yang memuat skema.

(Diperoleh dari XmlSchemaObject)
System

Mendapatkan atau mengatur system pengidentifikasi.

UnhandledAttributes

Mendapatkan atau mengatur atribut yang memenuhi syarat yang bukan milik namespace target skema saat ini.

(Diperoleh dari XmlSchemaAnnotated)

Metode

Nama Deskripsi
Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan Type instans saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari Objectsaat ini.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Berlaku untuk