예제 #1
0
        ///
        ///	 <summary> * remove duplicate warnings from the list and set schemaloction
        ///	 *  </summary>
        ///	 * <param name="schemaLocation"> </param>
        ///
        public virtual void cleanXML(string schemaLocation)
        {
            VElement v = root.getChildElementVector(null, null, null, true, 0, false);

            v.unifyElement();
            root.removeChildren(null, null, null);
            int size = v.Count;

            for (int i = 0; i < size; i++)
            {
                root.appendChild(v.item(i));
            }
            if (schemaLocation == null)
            {
                root.setAttribute("ValidationResult", "NotPerformed");
            }
            else
            {
                root.setAttribute("SchemaLocation", schemaLocation);
                if (root.hasChildElement("FatalError", null))
                {
                    root.setAttribute("ValidationResult", "FatalError");
                }
                else if (root.hasChildElement("Error", null))
                {
                    root.setAttribute("ValidationResult", "Error");
                }
                else if (root.hasChildElement("Warning", null))
                {
                    root.setAttribute("ValidationResult", "Warning");
                }
                else
                {
                    root.setAttribute("ValidationResult", "Valid");
                }
            }
        }