Esempio n. 1
0
        public override XmlElement CreateElement(string prefix, string localName, string ns)
        {
            XmlElement result = SvgElementFactory.Create(prefix, localName, ns, this);

            if (result != null)
            {
                return(result);
            }

            if (string.Equals(ns, SvgNamespace, StringComparison.OrdinalIgnoreCase))
            {
                return(new SvgElement(prefix, localName, ns, this));
            }
            // Now, if the ns is empty, we try creating with the default namespace for cases
            // where the node is imported from an external SVG document...
            if (string.IsNullOrWhiteSpace(ns))
            {
                result = SvgElementFactory.Create(prefix, localName, SvgNamespace, this);
                if (result != null)
                {
                    return(result);
                }
            }

            return(base.CreateElement(prefix, localName, ns));
        }
Esempio n. 2
0
        public override XmlElement CreateElement(string prefix, string localName, string ns)
        {
            XmlElement result = SvgElementFactory.Create(prefix, localName, ns, this);

            if (result != null)
            {
                return(result);
            }
            else if (ns == SvgNamespace)
            {
                return(new SvgElement(prefix, localName, ns, this));
            }
            else
            {
                // Now, if the ns is empty, we try creating with the default namespace for cases
                // where the node is imported from an external SVG document...
                if (String.IsNullOrEmpty(ns))
                {
                    result = SvgElementFactory.Create(prefix, localName, SvgNamespace, this);
                    if (result != null)
                    {
                        return(result);
                    }
                }
            }

            return(base.CreateElement(prefix, localName, ns));
        }