src/chxj_chtml10.c
static char *
s_chtml10_start_option_tag(void *pdoc, Node *child)
{
  chtml10_t   *chtml10;
  Doc         *doc;
  request_rec *r;
  Attr        *attr;
  char        *selected;
  char        *value;

  chtml10   = GET_CHTML10(pdoc);
  doc       = chtml10->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);
    switch(*nm) {
    case 's':
    case 'S':
      if (strcasecmp(nm, "selected") == 0) {
        /*--------------------------------------------------------------------*/
        /* CHTML 1.0 version 2.0                                              */
        /*--------------------------------------------------------------------*/
        selected = apr_pstrdup(doc->buf.pool, val);
      }
      break;

    case 'v':
    case 'V':
      if (strcasecmp(nm, "value") == 0) {
        /*--------------------------------------------------------------------*/
        /* CHTML 1.0 version 2.0                                              */
        /*--------------------------------------------------------------------*/
        value = apr_pstrdup(doc->buf.pool, val);
      }
      break;

    default:
      break;
    }
  }

  if (value && *value != 0) {
    W_L(" value=\"");
    W_V(value);
    W_L("\"");
  }

  if (selected) {
    W_L(" selected");
  }

  W_L(">");
  return chtml10->out;
}
/**
 * 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_chtml10_start_option_tag(void *pdoc, Node *child)
{
  chtml10_t   *chtml10;
  Doc         *doc;
  request_rec *r;
  Attr        *attr;
  char        *selected;
  char        *value;
  chtml10   = GET_CHTML10(pdoc);
  doc       = chtml10->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);
    switch(*nm) {
    case 's':
    case 'S':
      if (strcasecmp(nm, "selected") == 0) {
        selected = apr_pstrdup(doc->buf.pool, val);
      }
      break;
    case 'v':
    case 'V':
      if (strcasecmp(nm, "value") == 0) {
        value = apr_pstrdup(doc->buf.pool, val);
      }
      break;
    default:
      break;
    }
  }
  if (value && *value != 0) {
    W_L(" value=\"");
    W_V(value);
    W_L("\"");
  }
  if (selected) {
    W_L(" selected");
  }
  W_L(">");
  return chtml10->out;
}
static char * s_chtml10_start_option_tag ( void * pdoc , Node * child ) { chtml10_t * chtml10 ; Doc * doc ; request_rec * r ; Attr * attr ; char * selected ; char * value ; chtml10 = GET_CHTML10 ( pdoc ) ; doc = chtml10 -> 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 ) ; switch ( * nm ) { case ' ' : case ' ' : if ( strcasecmp ( nm , " " ) == 0 ) { selected = apr_pstrdup ( doc -> buf . pool , val ) ; } break ; case ' ' : case ' ' : if ( strcasecmp ( nm , " " ) == 0 ) { value = apr_pstrdup ( doc -> buf . pool , val ) ; } break ; default : break ; } } if ( value && * value != 0 ) { W_L ( " \" " ) ; W_V ( value ) ; W_L ( " \" " ) ; } if ( selected ) { W_L ( " " ) ; } W_L ( " " ) ; return chtml10 -> 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                                              */ /*--------------------------------------------------------------------*/