System.Data.XmlTreeGen.WriteSchemaRoot C# (CSharp) Метод

WriteSchemaRoot() приватный Метод

private WriteSchemaRoot ( XmlDocument xd, XmlElement rootSchema, string targetNamespace ) : void
xd XmlDocument
rootSchema XmlElement
targetNamespace string
Результат void
        internal void WriteSchemaRoot(XmlDocument xd, XmlElement rootSchema, string targetNamespace)
        {
            /*
                        if (_ds != null)
                            rootSchema.SetAttribute(Keywords.XSDID, XmlConvert.EncodeLocalName(_ds.DataSetName));
                        else
                            rootSchema.SetAttribute(Keywords.XSDID, XmlConvert.EncodeLocalName("NewDataSet"));
            */


            if (!string.IsNullOrEmpty(targetNamespace))
            {
                rootSchema.SetAttribute(Keywords.TARGETNAMESPACE, targetNamespace);
                rootSchema.SetAttribute(Keywords.XMLNS_MSTNS, targetNamespace);
            }
            // Add the namespaces
            // rootSchema.SetAttribute(Keywords.XMLNS, Keywords.XSD_ATOM.String));
            rootSchema.SetAttribute(Keywords.XMLNS, targetNamespace);
            rootSchema.SetAttribute(Keywords.XMLNS_XSD, Keywords.XSDNS);
            rootSchema.SetAttribute(Keywords.XMLNS_MSDATA, Keywords.MSDNS);
            if ((_ds != null) && (HaveExtendedProperties(_ds)))
            {
                rootSchema.SetAttribute(Keywords.XMLNS_MSPROP, Keywords.MSPROPNS);
            }

            if (!string.IsNullOrEmpty(targetNamespace))
            {
                rootSchema.SetAttribute(Keywords.XSD_ATTRIBUTEFORMDEFAULT, Keywords.QUALIFIED);
                rootSchema.SetAttribute(Keywords.XSD_ELEMENTFORMDEFAULT, Keywords.QUALIFIED);
            }
        }