src/chxj_tag_util.c
/**
 * The value of tag that maintains the SELECTED attribute is acquired. 
 *
 * @param doc    [i]  The pointer to the Doc structure to be scanned is 
 *                    specified. 
 * @param node   [i]  The SELECT tag node is specified.
 * @param pool   [i] To use POOL.
 * @return The value of tag that maintains the SELECTED attribute is 
 *         returned. NULL is returned when not found. 
 */
The value of tag that maintains the SELECTED attribute is acquired.
@param doc    [i]  The pointer to the Doc structure to be scanned is
specified.
@param node   [i]  The SELECT tag node is specified.
@param pool   [i] To use POOL.
@return The value of tag that maintains the SELECTED attribute is
returned. NULL is returned when not found.
The value of tag that maintains the SELECTED attribute is acquired . @param doc [ i ] The pointer to the Doc structure to be scanned is specified . @param node [ i ] The SELECT tag node is specified . @param pool [ i ] To use POOL . @return The value of tag that maintains the SELECTED attribute is returned . NULL is returned when not found .
char *
qs_get_selected_value(Doc *doc, Node *node, apr_pool_t *pool)
{
  Node *child;
  char *result    = NULL;
  for (child = qs_get_child_node(doc,node); 
       child != NULL; 
       child = qs_get_next_node(doc,child)) {
    char *name = qs_get_node_name(doc,child);
    if (STRCASEEQ('o','O',"option",name)) {
      Attr *attr;
      for (attr = qs_get_attr(doc,child); 
           attr; 
           attr = qs_get_next_attr(doc,attr)) {
        char *name2  = qs_get_attr_name(doc,attr);
        if (STRCASEEQ('s','S',"selected",name2)) {
          return qs_get_value_attr(doc, child, doc->buf.pool);
        }
      }
    }
    if ((result = qs_get_selected_value(doc, child, pool)) != NULL) {
      return result;
    }
  }
  return NULL;
}
char * qs_get_selected_value ( Doc * doc , Node * node , apr_pool_t * pool ) { Node * child ; char * result = NULL ; for ( child = qs_get_child_node ( doc , node ) ; child != NULL ; child = qs_get_next_node ( doc , child ) ) { char * name = qs_get_node_name ( doc , child ) ; if ( STRCASEEQ ( ' ' , ' ' , " " , name ) ) { Attr * attr ; for ( attr = qs_get_attr ( doc , child ) ; attr ; attr = qs_get_next_attr ( doc , attr ) ) { char * name2 = qs_get_attr_name ( doc , attr ) ; if ( STRCASEEQ ( ' ' , ' ' , " " , name2 ) ) { return qs_get_value_attr ( doc , child , doc -> buf . pool ) ; } } } if ( ( result = qs_get_selected_value ( doc , child , pool ) ) != NULL ) { return result ; } } return NULL ; }
The value of tag that maintains the SELECTED attribute is acquired.
The value of tag that maintains the SELECTED attribute is acquired .
/*------------------------------------------------------------------------*/ /* <OPTION> tag                                                           */ /*------------------------------------------------------------------------*/ /*------------------------------------------------------------------*/ /* SELECTED Value Found                                             */ /*------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* not found                                                                */ /*--------------------------------------------------------------------------*/