src/chxj_tag_util.c
/**
 * The value of child TEXT of tag that maintains the SELECTED attribute is 
 * returned. 
 *
 * @param Doc  [i] The pointer to the Doc structure to be scanned is 
 *                 specified. 
 * @param node [i] The tag node to be scanned is specified.
 * @param pool [i] To use POOL.
 * @reutrn  The value of child TEXT of tag that maintains the SELECTED 
 *          attribute is returned. NULL is returned when not found. 
 */
The value of child TEXT of tag that maintains the SELECTED attribute is
returned.

@param Doc  [i] The pointer to the Doc structure to be scanned is
specified.
@param node [i] The tag node to be scanned is specified.
@param pool [i] To use POOL.
@reutrn  The value of child TEXT of tag that maintains the SELECTED
attribute is returned. NULL is returned when not found.
The value of child TEXT of tag that maintains the SELECTED attribute is returned . @param Doc [ i ] The pointer to the Doc structure to be scanned is specified . @param node [ i ] The tag node to be scanned is specified . @param pool [ i ] To use POOL . @reutrn The value of child TEXT of tag that maintains the SELECTED attribute is returned . NULL is returned when not found .
char *
qs_get_selected_value_text(Doc *doc, Node *node, apr_pool_t *pool)
{
  Node *child;
  Node *selchild;
  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 != NULL; 
           attr = qs_get_next_attr(doc,attr)) {
        char *name2  = qs_get_attr_name(doc,attr);
        if (STRCASEEQ('s','S',"selected",name2)) {
          selchild = qs_get_child_node(doc, child);
          if (! selchild) {
            return apr_pstrdup(pool, "");
          }
          return qs_get_node_value(doc, selchild);
        }
      }
    }
    if ((result = qs_get_selected_value_text(doc, child, pool)) != NULL) {
      return result;
    }
  }
  return NULL;
}
char * qs_get_selected_value_text ( Doc * doc , Node * node , apr_pool_t * pool ) { Node * child ; Node * selchild ; 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 != NULL ; attr = qs_get_next_attr ( doc , attr ) ) { char * name2 = qs_get_attr_name ( doc , attr ) ; if ( STRCASEEQ ( ' ' , ' ' , " " , name2 ) ) { selchild = qs_get_child_node ( doc , child ) ; if ( ! selchild ) { return apr_pstrdup ( pool , " " ) ; } return qs_get_node_value ( doc , selchild ) ; } } } if ( ( result = qs_get_selected_value_text ( doc , child , pool ) ) != NULL ) { return result ; } } return NULL ; }
The value of child TEXT of tag that maintains the SELECTED attribute is
 returned.
The value of child TEXT of tag that maintains the SELECTED attribute is returned .
/*------------------------------------------------------------------------*/ /* <OPTION> tag                                                           */ /*------------------------------------------------------------------------*/ /*------------------------------------------------------------------*/ /* SELECTED Value Found                                             */ /*------------------------------------------------------------------*/ /* void value */ /*--------------------------------------------------------------------------*/ /* not found                                                                */ /*--------------------------------------------------------------------------*/