Exemplo n.º 1
0
		public Tag GetTag()
		{
			AttributeList attributes = new AttributeList();

			foreach(Attribute x in List)
			{
				attributes.Add((Attribute)x.Clone());
			}

            Tag retVal = new Tag(m_tag, attributes);

			return(retVal);
		}
Exemplo n.º 2
0
        public void HandleTagEvent(Uri baseUri, Tag tag)
        {
            //  Look for any JavaScript includes
            if (tag.Name.ToLower() == "script")
            {
                Spider.Attribute sourceFileAttribute = tag.Attributes["SRC"];
                if (sourceFileAttribute != null && sourceFileAttribute.Value != null)
                {
                    //  Found an included JavaScript file.  Check to see if this matches an AJAX framewor
                    string message = "Found a JavaScript file reference: " + sourceFileAttribute.Value;
                    Log(message);

                    _listener.JavaScriptEvent(new Uri(baseUri, sourceFileAttribute.Value));

                    Framework ajaxFramework = FrameworkDetection.Instance.ProcessJavaScriptFileEvent(sourceFileAttribute.Value, string.Empty);
                    if (ajaxFramework != null)
                    {
                        Log("Found evidence of an AJAX framework: " + ajaxFramework);
                        _listener.FoundFrameworkEvent(ajaxFramework);
                    }

                    System.Console.WriteLine(message);
                }
                else
                {
                    //  Found a JavaScript block.  Check to see if there is an XMLHTTPRequest reference in there.
                    //  TODO - Implement me!
                }
            }

            if (tag.Name.ToLower() == "add")
            {
                //  Found an Atlas web service reference
                string webServiceJs = tag.Attributes["SRC"].Value;
                Log("Found an Atlas WebService JavaScript reference: " + webServiceJs);
                //  TODO - do this in a safe manner
                string webService = webServiceJs.Substring(0, webServiceJs.Length - 3);
                Uri webServiceUri = new Uri(baseUri, webService);
                Log("Found an Atlas WebService: " + webServiceUri.AbsoluteUri);

                _listener.FoundWebServiceCollectionEvent(webServiceUri);

                string wsdl = webServiceUri.AbsoluteUri + "?wsdl";
                Log("Atlas WebService WSDL located at: " + wsdl);
            }
        }