Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1

    Default checking if the OPEN TAG has a CLOSE TAG



    hi guyz... i just want your idea of how to detect if the tag has the close tag... im talking about HTML...

    vbscript, asp, javascript, css, etc... are accepted... any codes

    or just give me a link

    how? pls

    thanks


    yeah! bling bling men...abz'

  2. #2

    Default Re: checking if the OPEN TAG has a CLOSE TAG

    Try kuno read ani http://tidy.sourceforge.net/

  3. #3

    Default Re: checking if the OPEN TAG has a CLOSE TAG

    madala raman basin ni og stack bai...
    steps:

    collect tags...
    while open ang tag imo i store sa stack...
    kong maka kita nakag closing tag..
    imo tong i pop sa stack.. nya i compare kong parihas ba sila..

  4. #4

    Default Re: checking if the OPEN TAG has a CLOSE TAG

    as of now bai ako lang man gud gi loop then gamit ko ug VBSCRIPT

    then nag-counter ko kung pila kabouk ang open ug close

    ang problema ani kay dili nako ma-trace kung asa dapit ang walay close tag...


    yeah! bling bling men...abz'

  5. #5

    Default Re: checking if the OPEN TAG has a CLOSE TAG

    madala ra og stack bai.. "last in first out"..

    kong naa kai content nga..

    Code:
    ex:
    <tag1><tag2><tag3> some content</tag3></tag2></tag1>
    i push nimo ang mga tag nga "open" na iyang ma agi-an..

    <tag1>
    <tag2>
    <tag3> <<-- current pointer

    then
    kong kita na sya og closing tag </>
    imo to i pop...

    </tag3> POP [<tag3>] <-- compare dayon kong same bana sila og tagname... kong dili gali flag dayon og error..
    </tag2> POP [<tag2>] <-- compare
    </tag1> POP [<tag1>] <-- compare


    kong naai subra nabilin sa stack meaning naai kulang nga tag...
    kong missmatch ang tagnames... then dili balance ang tag..

    for self terminating tags <tagname />
    imo lang na i ignore.. di nimo i process..

    wa ko kabaw sa code kai di ko kamao og vbscript hehe. pro ang concept parihas ra basin..

  6. #6

    Default Re: checking if the OPEN TAG has a CLOSE TAG

    ok bai try lang nako... hehe... libog pa gamay unsaon ni nako pag-codes...


    yeah! bling bling men...abz'

  7. #7

    Default Re: checking if the OPEN TAG has a CLOSE TAG

    i have written a simple html document obfuscater.

    https://www.istorya.net/forums/index....315#msg2452315

  8. #8

    Default Re: checking if the OPEN TAG has a CLOSE TAG


    bro, naa koi code using c# to check if balance ba ang mga tags using stack... i convert nalang ang uban fuctions/method nga available sa imong language gamiton..
    like indexof == instr for VB etc..
    hope this helps

    Code:
        public void CheckTags(string sContent)
        {
          List<string> sStack = new List<string>();
          int iPos1 = 0;
          int iPos2 = 0;
          bool bChecking= true;
    
          do
          {
            iPos1 = sContent.IndexOf("<",iPos2);
            if (iPos1 > -1)
            {
              iPos2 = sContent.IndexOf(">", iPos1);
              if (iPos2 > -1)
              {
                string sTagName = sContent.Substring(iPos1, (iPos2 - iPos1) + 1);
    
                //check if tag is not end tag
                if (sTagName.StartsWith("</"))
                {
                  if (sStack.Count > 0)
                  {
                    string sTagFromStack = sStack[sStack.Count - 1];
                    sStack.RemoveAt(sStack.Count - 1); // remove the tag from out stack
    
                    // strip tags to get its tagname
                    // this may used additional stripping method if tag contains attributes like
                    // <tag1 attribute="val">
                    sTagFromStack = sTagFromStack.Replace("<", ""); 
                    sTagFromStack = sTagFromStack.Replace(">", "");
    
                    sTagName = sTagName.Replace("<", "");
                    sTagName = sTagName.Replace("/", "");
                    sTagName = sTagName.Replace(">", "");
    
                    if (sTagFromStack.ToUpper() != sTagName.ToUpper())
                    {
                      MessageBox.Show("EndTag: " + sTagName + " not equal to: " + sTagFromStack);
                    }
                  }
                }
                else if (!sTagName.EndsWith("/>") && !sTagName.StartsWith("<!"))
                {
                  //Store open tags to our risizable array
                  sStack.Add(sTagName);
                }
              }
            }
    
            if (iPos1 == -1 || iPos2 == -1)
              bChecking = false;
    
          } while (bChecking);
    
    
          if (sStack.Count > 0)
          {
            MessageBox.Show("DOM NOT Balance!");
          }
        }

  9. #9

    Default Re: checking if the OPEN TAG has a CLOSE TAG

    thanks bro.... i will try to study this...

    thank you very much


    yeah! bling bling men...abz'

  10. #10

    Default Re: checking if the OPEN TAG has a CLOSE TAG

    or maybe you can download an html parsing tool.

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. What to do if the guy you're with is GAY?
    By razorblde in forum "Love is..."
    Replies: 243
    Last Post: 05-23-2019, 03:24 PM
  2. Only for the Open-minded, if you’re not one of them…..
    By cowboy_ben88 in forum Music & Radio
    Replies: 27
    Last Post: 08-02-2013, 02:57 AM
  3. Check if Tags are closed... how?
    By kibotizer in forum Websites & Multimedia
    Replies: 9
    Last Post: 01-23-2011, 08:41 PM
  4. Replies: 467
    Last Post: 11-16-2010, 08:04 PM
  5. If your bf/gf is very close to the opposite s*x?
    By blaise in forum Relationships (Old)
    Replies: 33
    Last Post: 05-17-2010, 02:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top