Ejemplo n.º 1
0
        public static IDocumentPlug CreateDocumentPlugFromXmlSchema(string schemaPath)
        {
            Stream        schemaStream = new FileStream(schemaPath, FileMode.Open, FileAccess.Read);
            IDocumentPlug plug         = XmlSchemaHelper.CreateDocumentPlug(schemaStream);

            return(plug);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public static IDocumentPlug CreateDocumentPlugFromXmlSchema(XmlSchemaCollection collection, string targetNamespace, string name)
        {
            IDocumentPlug plug = XmlSchemaHelper.CreateDocumentPlug(collection, targetNamespace, name);

            return(plug);
        }
Ejemplo n.º 4
0
        public static IDocumentPlug CreateDocumentPlugFromXmlSchema(Stream schemaStream)
        {
            IDocumentPlug plug = XmlSchemaHelper.CreateDocumentPlug(schemaStream);

            return(plug);
        }
Ejemplo n.º 5
0
        public static IDocumentPlug CreateDocumentPlugFromXmlSchema(string schemaPath, string targetNamespace, string name)
        {
            IDocumentPlug plug = XmlSchemaHelper.CreateDocumentPlug(schemaPath, targetNamespace, name);

            return(plug);
        }