示例#1
0
            /// <summary>
            /// This method gets called when a start tag is encountered.
            /// </summary>
            /// <param name="tag">the name of the tag that is encountered</param>
            /// <param name="lname"></param>
            /// <param name="n"></param>
            /// <param name="attrs">the list of attributes</param>
            public override void StartElement(String tag, String lname, String n, Hashtable attrs)
            {
                String name  = (string)attrs[NAME];
                String alias = (string)attrs[ALIAS];
                String value = (string)attrs[VALUE];

                if (name != null)
                {
                    if (TAG.Equals(lname))
                    {
                        currentPeer = new XmlPeer(name, alias);
                    }
                    else if (ATTRIBUTE.Equals(lname))
                    {
                        if (alias != null)
                        {
                            currentPeer.AddAlias(name, alias);
                        }
                        if (value != null)
                        {
                            currentPeer.AddValue(name, value);
                        }
                    }
                }
                value = (string)attrs[CONTENT];
                if (value != null)
                {
                    currentPeer.Content = value;
                }
            }
示例#2
0
 /// <summary>
 /// This method gets called when an end tag is encountered.
 /// </summary>
 /// <param name="uri"></param>
 /// <param name="lname"></param>
 /// <param name="name">the name of the tag that ends</param>
 public override void EndElement(String uri, String lname, String name)
 {
     if (myTags.ContainsKey(name))
     {
         XmlPeer peer = (XmlPeer)myTags[name];
         HandleEndingTags(peer.Tag);
     }
     else
     {
         HandleEndingTags(name);
     }
 }
示例#3
0
 /// <summary>
 /// This method gets called when a start tag is encountered.
 /// </summary>
 /// <param name="uri"></param>
 /// <param name="lname"></param>
 /// <param name="name">the name of the tag that is encountered</param>
 /// <param name="attrs">the list of attributes</param>
 public override void StartElement(String uri, String lname, String name, Hashtable attrs)
 {
     if (myTags.ContainsKey(name))
     {
         XmlPeer peer = (XmlPeer)myTags[name];
         HandleStartingTags(peer.Tag, peer.GetAttributes(attrs));
     }
     else
     {
         itextProperties attributes = new itextProperties();
         if (attrs != null)
         {
             foreach (string key in attrs.Keys)
             {
                 attributes.Add(key, (string)attrs[key]);
             }
         }
         HandleStartingTags(name, attributes);
     }
 }