/// <summary>
        /// Returns whether the specified {@code page} is {@link SvgPage} or not.
        /// </summary>
        /// <param name="page">the page</param>
        /// <returns>whether the specified {@code page} is {@link SvgPage} or not</returns>
        protected bool IsSvg(SgmlPage page)
        {
            DomElement documentElement = page.getDocumentElement();

            return(documentElement != null && page.hasFeature(SVG) && String.Equals("svg", documentElement.getTagName()) &&
                   HTMLParser.SVG_NAMESPACE.equals(documentElement.getNamespaceURI()));
        }
        /// <summary>
        /// Create a Page object for the specified web response.
        /// </summary>
        /// <param name="webResponse">the response from the server</param>
        /// <param name="webWindow">the window that this page will be loaded into</param>
        /// <returns>the new page object</returns>
        public IPage CreatePage(WebResponse webResponse, IWebWindow webWindow)
        {
            String contentType = DetermineContentType(webResponse.GetContentType().ToLower(), // TODO : Locale.ENGLISH
                                                      webResponse.GetContentAsStream());

            PageType pageType = DeterminePageType(contentType);

            switch (pageType)
            {
            case PageType.HTML:
                return(CreateHtmlPage(webResponse, webWindow));

            case PageType.JAVASCRIPT:
                return(CreateJavaScriptPage(webResponse, webWindow));

            case PageType.XML:
                SgmlPage   sgmlPage = CreateXmlPage(webResponse, webWindow);
                DomElement doc      = sgmlPage.getDocumentElement();
                if (doc != null && HTMLParser.XHTML_NAMESPACE.equals(doc.getNamespaceURI()))
                {
                    return(CreateXHtmlPage(webResponse, webWindow));
                }
                return(sgmlPage);

            case PageType.TEXT:
                return(CreateTextPage(webResponse, webWindow));

            default:
                return(CreateUnexpectedPage(webResponse, webWindow));
            }
        }