Rediger

Del via


XmlSchemaAnyAttribute Class

Definition

Represents the World Wide Web Consortium (W3C) anyAttribute element.

public ref class XmlSchemaAnyAttribute : System::Xml::Schema::XmlSchemaAnnotated
public class XmlSchemaAnyAttribute : System.Xml.Schema.XmlSchemaAnnotated
type XmlSchemaAnyAttribute = class
    inherit XmlSchemaAnnotated
Public Class XmlSchemaAnyAttribute
Inherits XmlSchemaAnnotated
Inheritance
XmlSchemaAnyAttribute

Examples

The following example creates the anyAttribute element.

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

class XMLSchemaExamples
{
    public static void Main()
    {

        XmlSchema schema = new XmlSchema();

        // <element name="stringElementWithAnyAttribute">
        XmlSchemaElement element = new XmlSchemaElement();
        schema.Items.Add(element);
        element.Name = "stringElementWithAnyAttribute";

        XmlSchemaComplexType complexType = new XmlSchemaComplexType();
        element.SchemaType = complexType;

        XmlSchemaSimpleContent simpleContent = new XmlSchemaSimpleContent();
        complexType.ContentModel = simpleContent;

        // <extension base="xs:string">
        XmlSchemaSimpleContentExtension extension = new XmlSchemaSimpleContentExtension();
        simpleContent.Content = extension;
        extension.BaseTypeName = new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema");

        // <anyAttribute namespace="##targetNamespace"/