コード例 #1
0
ファイル: GmlProfileReader.cs プロジェクト: perro75/S100
        private ComplexType readComplexTypeElements(XmlNode comp, ComplexType c)
        {
            foreach (XmlNode ele in this.getElement(comp))
            {
                if (ele.Attributes.GetNamedItem("name") == null)
                {
                    continue;
                }

                var elename = ele.Attributes.GetNamedItem("name").InnerText;
                //XXX added check fotr null because of S100gmlbase
                var eletype = ele.Attributes.GetNamedItem("type") == null ? "no type" : ele.Attributes.GetNamedItem("type").InnerText;

                var min = ele.Attributes.GetNamedItem("minOccurs");
                var max = ele.Attributes.GetNamedItem("maxOccurs");

                var minoccurs = (min == null) ? "1" : min.InnerText;
                var maxoccurs = (max == null) ? "1" : max.InnerText;

                //check if element has parent "choice" and set minOccurs == 0
                if (CommonReader.readParentTag(ele).Equals("xs:choice"))
                {
                    minoccurs = "0";
                }

                //add feature attributes
                c.addItem(elename, eletype, minoccurs, maxoccurs, false, this.csNameSpace);
            }

            return(c);
        }
コード例 #2
0
ファイル: GmlProfileReader.cs プロジェクト: perro75/S100
        private void readAttributes()
        {
            foreach (XmlNode element in this.getAttributes())
            {
                var name = CommonReader.readNodeAttribute(element, "name");
                //the namespace these elements are put into in csCode
                var ns            = this.csNameSpace;
                var type          = CommonReader.readNodeAttribute(element, "type");
                var documentation = CommonReader.readInnerText(this.getNodeDocumentation(element));

                var a = new Attribut_(name, ns, type, documentation);
                attributes[aIdx++] = a;
            }
        }
コード例 #3
0
ファイル: GmlProfileReader.cs プロジェクト: perro75/S100
        private void readAttributeGroups()
        {
            foreach (XmlNode group in this.getAttributeGroups())
            {
                var gName         = CommonReader.readNodeAttribute(group, "name");
                var documentation = CommonReader.readInnerText(this.getNodeDocumentation(group));

                foreach (XmlNode element in this.getAttributes(group))
                {
                    var name = CommonReader.readNodeAttribute(element, "name");
                    var ns   = this.csNameSpace;
                    var type = CommonReader.readNodeAttribute(element, "type");
                    //var documentation = this.readInnerText(this.fileReader.getNodeDocumentation(element));

                    var a = new Attribut_(name, ns, type, documentation, gName);
                    //put data into array
                    attributes[aIdx++] = a;
                }
            }
        }
コード例 #4
0
ファイル: GmlProfileReader.cs プロジェクト: perro75/S100
        private void readElements()
        {
            foreach (XmlNode element in this.getElements())
            {
                var name = CommonReader.readNodeAttribute(element, "name");

                //the namespace these elements are put into in csCode
                var ns = this.csNameSpace;

                var type          = CommonReader.readNodeAttribute(element, "type");
                var isAbstract    = CommonReader.readNodeAttribute(element, "abstract");
                var substGroup    = CommonReader.readNodeAttribute(element, "substitutionGroup");
                var nillable      = CommonReader.readNodeAttribute(element, "nillable");
                var documentation = CommonReader.readInnerText(this.getNodeDocumentation(element));

                var e = new Element(name, ns, type, isAbstract == "true", substGroup, nillable, documentation);
                e = combineElementAndType(e);
                this.elements[this.eIdx++] = e;
            }
        }