CreateAnyTypeElementDecl() public static method

public static CreateAnyTypeElementDecl ( ) : SchemaElementDecl
return SchemaElementDecl
 private static XmlSchemaComplexType CreateAnyType(XmlSchemaContentProcessing processContents)
 {
     XmlSchemaComplexType type = new XmlSchemaComplexType();
     type.SetQualifiedName(DatatypeImplementation.QnAnyType);
     XmlSchemaAny item = new XmlSchemaAny {
         MinOccurs = 0M,
         MaxOccurs = 79228162514264337593543950335M,
         ProcessContents = processContents
     };
     item.BuildNamespaceList(null);
     XmlSchemaSequence sequence = new XmlSchemaSequence();
     sequence.Items.Add(item);
     type.SetContentTypeParticle(sequence);
     type.SetContentType(XmlSchemaContentType.Mixed);
     type.ElementDecl = SchemaElementDecl.CreateAnyTypeElementDecl();
     type.ElementDecl.SchemaType = type;
     ParticleContentValidator validator = new ParticleContentValidator(XmlSchemaContentType.Mixed);
     validator.Start();
     validator.OpenGroup();
     validator.AddNamespaceList(item.NamespaceList, item);
     validator.AddStar();
     validator.CloseGroup();
     ContentValidator validator2 = validator.Finish(true);
     type.ElementDecl.ContentValidator = validator2;
     XmlSchemaAnyAttribute attribute = new XmlSchemaAnyAttribute {
         ProcessContents = processContents
     };
     attribute.BuildNamespaceList(null);
     type.SetAttributeWildcard(attribute);
     type.ElementDecl.AnyAttribute = attribute;
     return type;
 }
 static XmlSchemaComplexType()
 {
     untypedAnyType.SetQualifiedName(new XmlQualifiedName("untypedAny", "http://www.w3.org/2003/11/xpath-datatypes"));
     untypedAnyType.IsMixed = true;
     untypedAnyType.SetContentTypeParticle(anyTypeLax.ContentTypeParticle);
     untypedAnyType.SetContentType(XmlSchemaContentType.Mixed);
     untypedAnyType.ElementDecl = SchemaElementDecl.CreateAnyTypeElementDecl();
     untypedAnyType.ElementDecl.SchemaType = untypedAnyType;
     untypedAnyType.ElementDecl.ContentValidator = AnyTypeContentValidator;
 }
Esempio n. 3
0
        static XmlSchemaComplexType()
        {
            anyType = new XmlSchemaComplexType();
            anyType.SetContentType(XmlSchemaContentType.Mixed);
            anyType.ElementDecl = SchemaElementDecl.CreateAnyTypeElementDecl();
            XmlSchemaAnyAttribute anyAttribute = new XmlSchemaAnyAttribute();

            anyAttribute.BuildNamespaceList(null);
            anyType.SetAttributeWildcard(anyAttribute);
            anyType.ElementDecl.AnyAttribute = anyAttribute;
        }
Esempio n. 4
0
        //const byte dupDeclMask = 0x08;

        private static XmlSchemaComplexType CreateUntypedAnyType()
        {
            // Create xdt:untypedAny
            var untypedAny = new XmlSchemaComplexType();

            untypedAny.SetQualifiedName(new XmlQualifiedName("untypedAny", XmlReservedNs.NsXQueryDataType));
            untypedAny.IsMixed = true;
            untypedAny.SetContentTypeParticle(s_anyTypeLax.ContentTypeParticle);
            untypedAny.SetContentType(XmlSchemaContentType.Mixed);

            untypedAny.ElementDecl                  = SchemaElementDecl.CreateAnyTypeElementDecl();
            untypedAny.ElementDecl.SchemaType       = untypedAny;
            untypedAny.ElementDecl.ContentValidator = AnyTypeContentValidator;

            return(untypedAny);
        }
Esempio n. 5
0
        //const byte dupDeclMask = 0x08;

        static XmlSchemaComplexType()
        {
            anyTypeLax  = CreateAnyType(XmlSchemaContentProcessing.Lax);
            anyTypeSkip = CreateAnyType(XmlSchemaContentProcessing.Skip);

            // Create xdt:untypedAny
            untypedAnyType = new XmlSchemaComplexType();
            untypedAnyType.SetQualifiedName(new XmlQualifiedName("untypedAny", XmlReservedNs.NsXQueryDataType));
            untypedAnyType.IsMixed = true;
            untypedAnyType.SetContentTypeParticle(anyTypeLax.ContentTypeParticle);
            untypedAnyType.SetContentType(XmlSchemaContentType.Mixed);

            untypedAnyType.ElementDecl                  = SchemaElementDecl.CreateAnyTypeElementDecl();
            untypedAnyType.ElementDecl.SchemaType       = untypedAnyType;
            untypedAnyType.ElementDecl.ContentValidator = AnyTypeContentValidator;
        }
Esempio n. 6
0
        private static XmlSchemaComplexType CreateAnyType(XmlSchemaContentProcessing processContents)
        {
            XmlSchemaComplexType localAnyType = new XmlSchemaComplexType();

            localAnyType.SetQualifiedName(DatatypeImplementation.QnAnyType);

            XmlSchemaAny anyElement = new XmlSchemaAny();

            anyElement.MinOccurs = decimal.Zero;
            anyElement.MaxOccurs = decimal.MaxValue;

            anyElement.ProcessContents = processContents;
            anyElement.BuildNamespaceList(null);
            XmlSchemaSequence seq = new XmlSchemaSequence();

            seq.Items.Add(anyElement);

            localAnyType.SetContentTypeParticle(seq);
            localAnyType.SetContentType(XmlSchemaContentType.Mixed);

            localAnyType.ElementDecl            = SchemaElementDecl.CreateAnyTypeElementDecl();
            localAnyType.ElementDecl.SchemaType = localAnyType;

            //Create contentValidator for Any
            ParticleContentValidator contentValidator = new ParticleContentValidator(XmlSchemaContentType.Mixed);

            contentValidator.Start();
            contentValidator.OpenGroup();
            contentValidator.AddNamespaceList(anyElement.NamespaceList !, anyElement);
            contentValidator.AddStar();
            contentValidator.CloseGroup();
            ContentValidator anyContentValidator = contentValidator.Finish(true);

            localAnyType.ElementDecl.ContentValidator = anyContentValidator;

            XmlSchemaAnyAttribute anyAttribute = new XmlSchemaAnyAttribute();

            anyAttribute.ProcessContents = processContents;
            anyAttribute.BuildNamespaceList(null);
            localAnyType.SetAttributeWildcard(anyAttribute);
            localAnyType.ElementDecl.AnyAttribute = anyAttribute;
            return(localAnyType);
        }