Logo Search packages:      
Sourcecode: rapple version File versions  Download package

static void rpl_mod_link_start ( void *  data,
const char *  el,
const char **  attr 
) [static]

Scan the input document for elements that have attribtues pointing to resources and check that the resources exist if they are local.

Parameters:
data user defined data (in this case the relative path of the parsed file)
el the name of the element being handled.
attr the key/value pairs for the attributes of the element.

Definition at line 147 of file mod_link.c.

References rpl_mod_link_report_error(), and rpl_mod_link_resolve().

Referenced by rpl_mod_link_process().

{
      int i=0;
      rpl_str_t rdp = (rpl_str_t)data;

      if((strcmp(el, "a") == 0) || (strcmp(el, "A") == 0) || (strcmp(el, "link") == 0) || (strcmp(el, "LINK") == 0))
      {
            /* process elements with "href" attributes */
            for(i=0; attr[i]; i+= 2)
            {
                  if((strcmp(attr[i],"href")==0) || (strcmp(attr[i],"HREF")==0))
                  {
                        if(rpl_mod_link_resolve(attr[i+1], rdp) < 0)
                              rpl_mod_link_report_error(el, "href", attr[i+1]);
                  }
            }
      } else if((strcmp(el, "img") == 0) || (strcmp(el, "IMG") == 0)) {
            /* process elements with "src" attributes */
            for(i=0; attr[i]; i+= 2)
            {
                  if((strcmp(attr[i],"src")==0) || (strcmp(attr[i],"SRC")==0))
                  {
                        if(rpl_mod_link_resolve(attr[i+1], rdp) < 0)
                              rpl_mod_link_report_error(el, "src", attr[i+1]);
                  }
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index