Beispiel #1
0
        /// <summary>
        /// Write this document's schema mappings from the given XML document
        /// </summary>
        /// <param name="node">The node.</param>
        /// <param name="mgr">The namespace manager.</param>
        protected override void ReadSchemaMappings(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr)
        {
            foreach (XmlNode map in node.ChildNodes)
            {
                if (map.Name != "SchemaMapping") //NOXLATE
                {
                    continue;
                }

                var prv = map.Attributes["provider"]; //NOXLATE
                if (prv == null)
                {
                    throw new Exception(string.Format(Strings.ErrorBadDocumentExpectedAttribute, "provider"));
                }

                var sn = map.Attributes["name"];
                if (sn == null)
                {
                    throw new Exception(string.Format(Strings.ErrorBadDocumentExpectedAttribute, "name"));
                }

                foreach (XmlNode clsMap in map.ChildNodes)
                {
                    if (clsMap.Name != "complexType") //NOXLATE
                    {
                        continue;
                    }

                    var cn = clsMap.Attributes["name"]; //NOXLATE
                    if (cn == null)
                    {
                        throw new Exception(string.Format(Strings.ErrorBadDocumentExpectedAttribute, "name"));
                    }

                    var rdf = clsMap.FirstChild;
                    if (rdf == null || rdf.Name != "RasterDefinition")
                    {
                        throw new Exception(string.Format(Strings.ErrorBadDocumentExpectedElement, "RasterDefinition"));
                    }

                    RasterWmsItem item = new RasterWmsItem();
                    item.SchemaName = sn.Value;
                    item.ReadXml(rdf, mgr);

                    this.AddRasterItem(item);
                }
            }
        }
        /// <summary>
        /// Write this document's schema mappings from the given XML document
        /// </summary>
        /// <param name="node">The node.</param>
        /// <param name="mgr">The namespace manager.</param>
        protected override void ReadSchemaMappings(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr)
        {
            foreach (XmlNode map in node.ChildNodes)
            {
                if (map.Name != "SchemaMapping") //NOXLATE
                    continue;

                var prv = map.Attributes["provider"]; //NOXLATE
                if (prv == null)
                    throw new Exception(string.Format(Strings.ErrorBadDocumentExpectedAttribute, "provider"));

                var sn = map.Attributes["name"];
                if (sn == null)
                    throw new Exception(string.Format(Strings.ErrorBadDocumentExpectedAttribute, "name"));

                foreach (XmlNode clsMap in map.ChildNodes)
                {
                    if (clsMap.Name != "complexType") //NOXLATE
                        continue;

                    var cn = clsMap.Attributes["name"]; //NOXLATE
                    if (cn == null)
                        throw new Exception(string.Format(Strings.ErrorBadDocumentExpectedAttribute, "name"));

                    var rdf = clsMap.FirstChild;
                    if (rdf == null || rdf.Name != "RasterDefinition")
                        throw new Exception(string.Format(Strings.ErrorBadDocumentExpectedElement, "RasterDefinition"));

                    RasterWmsItem item = new RasterWmsItem();
                    item.SchemaName = sn.Value;
                    item.ReadXml(rdf, mgr);

                    this.AddRasterItem(item);
                }
            }
        }