コード例 #1
0
ファイル: HtmlAttributes.cs プロジェクト: jeiea/osuDownloader
        // [NOCPP[

        internal void ProcessNonNcNames <T>(TreeBuilder <T> treeBuilder, XmlViolationPolicy namePolicy) where T : class
        {
            for (int i = 0; i < length; i++)
            {
                AttributeName attName = names[i];
                if (!attName.IsNcName(mode))
                {
                    string name = attName.GetLocal(mode);
                    switch (namePolicy)
                    {
                    case XmlViolationPolicy.AlterInfoset:
                        names[i] = AttributeName.Create(NCName.EscapeName(name));
                        goto case XmlViolationPolicy.Allow;                                 // fall through

                    case XmlViolationPolicy.Allow:
                        if (attName != AttributeName.XML_LANG)
                        {
                            treeBuilder.Warn("Attribute \u201C" + name + "\u201D is not serializable as XML 1.0.");
                        }
                        break;

                    case XmlViolationPolicy.Fatal:
                        treeBuilder.Fatal("Attribute \u201C" + name + "\u201D is not serializable as XML 1.0.");
                        break;
                    }
                }
            }
        }