Esempio n. 1
0
        /// <summary>
        /// Handles DynamicXmlNamespaceManager Resolve event.
        /// </summary>
        /// <param name="prefix">The prefix.</param>
        /// <returns></returns>
        private string OnResolveXmlNamespaceManager(string prefix)
        {
            string uri = null;

            if (this.ResolveNamespace != null)
            {
                var evtArgs = new SvgResolveNamespaceEventArgs(prefix);
                ResolveNamespace(this, evtArgs);
                uri = evtArgs.Uri;
            }
            if (string.IsNullOrWhiteSpace(uri))
            {
                // some defaults added here
                switch (prefix)
                {
                case "rdf":
                    uri = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
                    break;

                case "cc":
                    uri = "http://web.resource.org/cc";
                    break;

                case "dc":
                    uri = "http://purl.org/dc/elements/1.1/";
                    break;

                case "rdfs":
                    uri = "http://www.w3.org/2000/01/rdf-schema#";
                    break;

                case "owl":
                    uri = "http://www.w3.org/2002/07/owl#";
                    break;

                case "foaf":
                    uri = "http://xmlns.com/foaf/0.1/";
                    break;

                case "xsd":
                    uri = "http://www.w3c.org/2001/XMLSchema#";
                    break;

                case "xlink":
                    uri = "http://www.w3.org/1999/xlink";
                    break;
                }
            }
            return(uri);
        }
Esempio n. 2
0
 /// <summary>
 /// Handles DynamicXmlNamespaceManager Resolve event.
 /// </summary>
 /// <param name="prefix">The prefix.</param>
 /// <returns></returns>
 private string OnResolveXmlNamespaceManager(string prefix)
 {
     string uri = null;
     if (this.ResolveNamespace != null)
     {
         SvgResolveNamespaceEventArgs e = new SvgResolveNamespaceEventArgs(prefix);
         ResolveNamespace(this, e);
         uri = e.Uri;
     }
     if (String.IsNullOrEmpty(uri))
     {
         // some defaults added here
         switch (prefix)
         {
             case "rdf":
                 uri = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
                 break;
             case "cc":
                 uri = "http://web.resource.org/cc";
                 break;
             case "dc":
                 uri = "http://purl.org/dc/elements/1.1/";
                 break;
             case "rdfs":
                 uri = "http://www.w3.org/2000/01/rdf-schema#";
                 break;
             case "owl":
                 uri = "http://www.w3.org/2002/07/owl#";
                 break;
             case "foaf":
                 uri = "http://xmlns.com/foaf/0.1/";
                 break;
             case "xsd":
                 uri = "http://www.w3c.org/2001/XMLSchema#";
                 break;
             case "xlink":
                 uri = "http://www.w3.org/1999/xlink";
                 break;
         }
     }
     return uri;
 }