src/chxj_xhtml_mobile_1_0.c
/**
 * It is a handler who processes the IMG tag.
 *
 * @param pdoc  [i/o] The pointer to the XHTML structure at the output
 *                     destination is specified.
 * @param node   [i]   The IMG tag node is specified.
 * @return The conversion result is returned.
 */
It is a handler who processes the IMG tag.
@param pdoc  [i/o] The pointer to the XHTML structure at the output
destination is specified.
@param node   [i]   The IMG tag node is specified.
@return The conversion result is returned.
It is a handler who processes the IMG tag . @param pdoc [ i / o ] The pointer to the XHTML structure at the output destination is specified . @param node [ i ] The IMG tag node is specified . @return The conversion result is returned .
static char *
s_xhtml_1_0_start_img_tag(void *pdoc, Node *node) 
{
  xhtml_t       *xhtml = GET_XHTML(pdoc);
  Doc           *doc   = xhtml->doc;
  request_rec   *r     = doc->r;
  Attr          *attr;
#ifndef IMG_NOT_CONVERT_FILENAME
  device_table  *spec = xhtml->spec;
#endif
  W_L("<img");
  for (attr = qs_get_attr(doc,node);
       attr;
       attr = qs_get_next_attr(doc,attr)) {
    char *name  = qs_get_attr_name(doc,attr);
    char *value = qs_get_attr_value(doc,attr);
    if (STRCASEEQ('s','S',"src",name)) {
      value = chxj_encoding_parameter(r, value);
#ifdef IMG_NOT_CONVERT_FILENAME
      W_L(" src=\"");
      W_V(value);
      W_L("\"");
#else
      W_L(" src=\"");
      {
        char *vv = chxj_img_conv(r,spec,value);
        W_V(vv);
      }
      W_L("\"");
#endif
    }
    else 
    if (STRCASEEQ('a','A',"align",name)) {
      if (value) {
        if (STRCASEEQ('t','T',"top",   value) ||
            STRCASEEQ('m','M',"middle",value) ||
            STRCASEEQ('b','B',"bottom",value) ||
            STRCASEEQ('l','L',"left",  value) ||
            STRCASEEQ('r','R',"right", value)) {
          W_L(" align=\"");
          W_V(value);
          W_L("\"");
        }
        else if (STRCASEEQ('c','C',"center",  value)) {
          W_L(" align=\"");
          W_L("middle");
          W_L("\"");
        }
      }
    }
    else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
      W_L(" alt=\"");
      W_V(value);
      W_L("\"");
    }
    else if (STRCASEEQ('w','W',"width",name) && value && *value) {
      W_L(" width=\"");
      W_V(value);
      W_L("\"");
    }
    else if (STRCASEEQ('h','H',"height",name) && value && *value) {
      W_L(" height=\"");
      W_V(value);
      W_L("\"");
    }
    else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
      W_L(" hspace=\"");
      W_V(value);
      W_L("\"");
    }
    else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
      W_L(" vspace=\"");
      W_V(value);
      W_L("\"");
    }
  }
  W_L(" />");
  return xhtml->out;
}
static char * s_xhtml_1_0_start_img_tag ( void * pdoc , Node * node ) { xhtml_t * xhtml = GET_XHTML ( pdoc ) ; Doc * doc = xhtml -> doc ; request_rec * r = doc -> r ; Attr * attr ; #ifndef IMG_NOT_CONVERT_FILENAME device_table * spec = xhtml -> spec ; #endif W_L ( " " ) ; for ( attr = qs_get_attr ( doc , node ) ; attr ; attr = qs_get_next_attr ( doc , attr ) ) { char * name = qs_get_attr_name ( doc , attr ) ; char * value = qs_get_attr_value ( doc , attr ) ; if ( STRCASEEQ ( ' ' , ' ' , " " , name ) ) { value = chxj_encoding_parameter ( r , value ) ; #ifdef IMG_NOT_CONVERT_FILENAME W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; #else W_L ( " \" " ) ; { char * vv = chxj_img_conv ( r , spec , value ) ; W_V ( vv ) ; } W_L ( " \" " ) ; #endif } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) ) { if ( value ) { if ( STRCASEEQ ( ' ' , ' ' , " " , value ) || STRCASEEQ ( ' ' , ' ' , " " , value ) || STRCASEEQ ( ' ' , ' ' , " " , value ) || STRCASEEQ ( ' ' , ' ' , " " , value ) || STRCASEEQ ( ' ' , ' ' , " " , value ) ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , value ) ) { W_L ( " \" " ) ; W_L ( " " ) ; W_L ( " \" " ) ; } } } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } } W_L ( " " ) ; return xhtml -> out ; }
It is a handler who processes the IMG tag.
It is a handler who processes the IMG tag .
/*--------------------------------------------------------------------------*/ /* Get Attributes                                                           */ /*--------------------------------------------------------------------------*/