コード例 #1
0
ファイル: Document.cs プロジェクト: Alister742/ParseKit
        public Document(Tokenizer tokenizer = null, ITreeBuilder tb = null,  bool enableScripting = true, Encoding encoding = null, string contentType = "application/xml", string url = "about:blank")
            : base(null)
        {
            EnableScripting = enableScripting;

            Encoding = encoding ?? Encoding.UTF8;
            this.contentType = contentType;
            URL = url;

            documentElement = new Element("document", this);
            documentElement.parentNode = this;

            /* dom tree constructors classes */

            TreeBuilder = tb;
            //TreeBuilder = new DomTreeBuilder(this);
            this.tokenizer = tokenizer;

            //INIT HERE THE START VARIABLES, like: document, window
            JS = new JavascriptContext();
        }
コード例 #2
0
ファイル: Document.cs プロジェクト: Alister742/ParseKit
        public Element createElement(string localName)
        {
            if (localName.ToLower().Contains("http"))
            {

            }
            Element e = new Element(localName.ToLower(), this, "http://www.w3.org/1999/xhtml");

            return e;
        }
コード例 #3
0
ファイル: Document.cs プロジェクト: Alister742/ParseKit
        public Element createElementNS(string nspace, string qualifiedName)
        {
            if (qualifiedName.ToLower().Contains("http"))
            {

            }
            nspace = nspace == string.Empty ? null : nspace;

            string prefix = null;
            if (qualifiedName.Contains(':'))
            {
                string[] temp = qualifiedName.Split(new char[] { ':' }, 2);
                prefix = temp[0];
            }

            Element e = new Element(qualifiedName.ToLower(), this, nspace, prefix);

            return e;
        }
コード例 #4
0
ファイル: NodeList.cs プロジェクト: Alister742/ParseKit
 internal int IndexOf(Element element)
 {
     int index = 0;
     foreach (var item in this)
     {
         if (element == item)
         {
             return index;
         }
         index++;
     }
     return -1;
 }