System.Xml.Xsl.XmlQueryTypeFactory.ItemType.Create C# (CSharp) Method

Create() public static method

Create Document, Element or Attribute with specified name test, content type and nillable.
public static Create ( XmlTypeCode code, XmlQualifiedNameTest nameTest, XmlSchemaType contentType, bool isNillable ) : XmlQueryType
code XmlTypeCode
nameTest XmlQualifiedNameTest
contentType System.Xml.Schema.XmlSchemaType
isNillable bool
return XmlQueryType
            public static XmlQueryType Create(XmlTypeCode code, XmlQualifiedNameTest nameTest, XmlSchemaType contentType, bool isNillable) {
                // If this is a Document, Element, or Attribute,
                switch (code) {
                case XmlTypeCode.Document:
                case XmlTypeCode.Element:
                    if (nameTest.IsWildcard) {
                        // Normalize document(*, xs:anyType), element(*, xs:anyType)
                        if (contentType == XmlSchemaComplexType.AnyType)
                            return Create(code, false);

                        // Normalize document(xs:untypedAny), element(*, xs:untypedAny)
                        if (contentType == XmlSchemaComplexType.UntypedAnyType) {
                            Debug.Assert(!isNillable);
                            if (code == XmlTypeCode.Element)
                                return UntypedElement;
                            if (code == XmlTypeCode.Document)
                                return UntypedDocument;
                        }
                    }
                    // Create new ItemType
                    return new ItemType(code, nameTest, contentType, isNillable, false, true);

                case XmlTypeCode.Attribute:
                    if (nameTest.IsWildcard) {
                        // Normalize attribute(xs:anySimpleType)
                        if (contentType == DatatypeImplementation.AnySimpleType)
                            return Create(code, false);

                        // Normalize attribute(xs:untypedAtomic)
                        if (contentType == DatatypeImplementation.UntypedAtomicType)
                            return UntypedAttribute;
                    }
                    // Create new ItemType
                    return new ItemType(code, nameTest, contentType, isNillable, false, true);

                default:
                    return Create(code, false);

                }
            }

Same methods

XmlQueryTypeFactory.ItemType::Create ( XmlSchemaSimpleType schemaType, bool isStrict ) : XmlQueryType
XmlQueryTypeFactory.ItemType::Create ( XmlTypeCode code, bool isStrict ) : XmlQueryType
XmlQueryTypeFactory.ItemType