Пример #1
0
        public static IDocumentPlug CreateDocumentPlugFromXmlSchema(string schemaPath)
        {
            Stream        schemaStream = new FileStream(schemaPath, FileMode.Open, FileAccess.Read);
            IDocumentPlug plug         = XmlSchemaHelper.CreateDocumentPlug(schemaStream);

            return(plug);
        }
Пример #2
0
        public static Dictionary <string, string> RetrieveFacetMetadata(XmlSchemaElement element, string stringMinL, string stringMaxL,
                                                                        out int minL, out int maxL)
        {
            minL = ParseInt(stringMinL);
            maxL = ParseInt(stringMaxL);
            Dictionary <string, string> allowedValues = null;

            XmlSchemaSimpleTypeRestriction sr = null;

            if (element.ElementType is XmlSchemaSimpleType)
            {
                sr = (element.ElementType as XmlSchemaSimpleType).Content as XmlSchemaSimpleTypeRestriction;
            }
            if (sr == null)
            {
                return(allowedValues);
            }

            XmlSchemaObjectCollection objC = sr.Facets;

            foreach (object obj in objC)
            {
                if (obj is XmlSchemaEnumerationFacet)
                {
                    if (allowedValues == null)
                    {
                        allowedValues = new Dictionary <string, string>(10);
                    }

                    string val         = ((XmlSchemaEnumerationFacet)obj).Value;
                    string description = XmlSchemaHelper.ReadDocumentationFromEnumeration((XmlSchemaEnumerationFacet)obj);
                    allowedValues[val] = description;
                }
            }

            return(allowedValues);
        }
Пример #3
0
        public static IDocumentPlug CreateDocumentPlugFromXmlSchema(XmlSchemaCollection collection, string targetNamespace, string name)
        {
            IDocumentPlug plug = XmlSchemaHelper.CreateDocumentPlug(collection, targetNamespace, name);

            return(plug);
        }
Пример #4
0
        public static IDocumentPlug CreateDocumentPlugFromXmlSchema(Stream schemaStream)
        {
            IDocumentPlug plug = XmlSchemaHelper.CreateDocumentPlug(schemaStream);

            return(plug);
        }
Пример #5
0
        public static IDocumentPlug CreateDocumentPlugFromXmlSchema(string schemaPath, string targetNamespace, string name)
        {
            IDocumentPlug plug = XmlSchemaHelper.CreateDocumentPlug(schemaPath, targetNamespace, name);

            return(plug);
        }