src/chxj_chtml50.c
/**
 * It is a handler who processes the OPTION tag.
 *
 * @param pdoc  [i/o] The pointer to the CHTML structure at the output
 *                     destination is specified.
 * @param node   [i]   The OPTION tag node is specified.
 * @return The conversion result is returned.
 */
It is a handler who processes the OPTION tag.
@param pdoc  [i/o] The pointer to the CHTML structure at the output
destination is specified.
@param node   [i]   The OPTION tag node is specified.
@return The conversion result is returned.
It is a handler who processes the OPTION tag . @param pdoc [ i / o ] The pointer to the CHTML structure at the output destination is specified . @param node [ i ] The OPTION tag node is specified . @return The conversion result is returned .
static char *
s_chtml50_start_option_tag(void *pdoc, Node *child)
{
  Attr        *attr;
  chtml50_t   *chtml50;
  Doc         *doc;
  request_rec *r;
  char        *selected;
  char        *value;
  chtml50    = GET_CHTML50(pdoc);
  doc        = chtml50->doc;
  r          = doc->r;
  selected   = NULL;
  value      = NULL;
  W_L("<option");
  for (attr = qs_get_attr(doc,child);
       attr;
       attr = qs_get_next_attr(doc,attr)) {
    char *nm  = qs_get_attr_name(doc,attr);
    char *val = qs_get_attr_value(doc,attr);
    if (STRCASEEQ('s','S',"selected", nm)) {
      selected = apr_pstrdup(doc->buf.pool, val);
    }
    else if (STRCASEEQ('v','V',"value", nm)) {
      value = apr_pstrdup(doc->buf.pool, val);
    }
  }
  if (value && *value) {
    W_L(" value=\"");
    W_V(value);
    W_L("\"");
  }
  if (selected) {
    W_L(" selected");
  }
  W_L(">");
  return chtml50->out;
}
static char * s_chtml50_start_option_tag ( void * pdoc , Node * child ) { Attr * attr ; chtml50_t * chtml50 ; Doc * doc ; request_rec * r ; char * selected ; char * value ; chtml50 = GET_CHTML50 ( pdoc ) ; doc = chtml50 -> doc ; r = doc -> r ; selected = NULL ; value = NULL ; W_L ( " " ) ; for ( attr = qs_get_attr ( doc , child ) ; attr ; attr = qs_get_next_attr ( doc , attr ) ) { char * nm = qs_get_attr_name ( doc , attr ) ; char * val = qs_get_attr_value ( doc , attr ) ; if ( STRCASEEQ ( ' ' , ' ' , " " , nm ) ) { selected = apr_pstrdup ( doc -> buf . pool , val ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , nm ) ) { value = apr_pstrdup ( doc -> buf . pool , val ) ; } } if ( value && * value ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } if ( selected ) { W_L ( " " ) ; } W_L ( " " ) ; return chtml50 -> out ; }
It is a handler who processes the OPTION tag.
It is a handler who processes the OPTION tag .
/*----------------------------------------------------------------------*/ /* CHTML 1.0 version 2.0                                                */ /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* CHTML 1.0 version 2.0                                                */ /*----------------------------------------------------------------------*/