; ; IDL-OPENDAP interface. ; Copyright (c) 2006 OPeNDAP, Inc. ; Author: Patrick West UCAR/HAO ; ; Based on IDL-DODS Written by Daniel J. Carr - Research Systems, Inc. ; ; This is free software; you can redistribute it and/or ; modify it under the terms of the GNU Lesser General Public ; License as published by the Free Software Foundation; either ; version 2.1 of the License, or (at your option) any later version. ; ; This library is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ; Lesser General Public License for more details. ; ; You should have received a copy of the GNU Lesser General Public ; License along with this library; if not, write to the Free Software ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ; ; You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. FUNCTION opendap_handle_node, opendap_data, node, get_data, debug ;{ stat = 0ul OPENDAP_NODE_INFO, node, node_name, node_type, num_subnodes, $ has_content, has_attrs, content OPENDAP_FIX_NAME, node_name IF( debug EQ 1UL ) THEN BEGIN ;{ print,'node_name = ',node_name print,'node_type = ',node_type print,'num_subnodes = ',num_subnodes print,'has_content = ',has_content print,'has_attrs = ',has_attrs ENDIF ;} IF( has_attrs EQ 1ul ) THEN BEGIN ;{ stat = OPENDAP_HANDLE_ATTRIBUTES( opendap_data, node, debug ) ENDIF ELSE BEGIN ;} ;{ IF( has_content EQ 1ul ) THEN BEGIN ;{ stat = OPENDAP_HANDLE_CONTENT( opendap_data, node, content, $ node_type, has_content, get_data, $ debug ) ENDIF ELSE BEGIN ;} ;{ IF( num_subnodes GT 0ul ) THEN BEGIN ;{ OPENDAP_GET_SUBNODE, node, 0ul, subnode, subnode_name OPENDAP_FIX_NAME, subnode_name stat = OPENDAP_HANDLE_NODE( opendap_sub_data, subnode, $ get_data, debug ) opendap_data = CREATE_STRUCT( subnode_name, opendap_sub_data ) FOR i_num_subnodes = 1ul, num_subnodes-1 DO BEGIN ;{ OPENDAP_GET_SUBNODE, node, i_num_subnodes, subnode, $ subnode_name OPENDAP_FIX_NAME, subnode_name stat = OPENDAP_HANDLE_NODE( opendap_sub_data, subnode, $ get_data, debug ) opendap_data = CREATE_STRUCT( opendap_data, subnode_name, $ opendap_sub_data ) ENDFOR ;} ENDIF ELSE BEGIN ;} ;{ stat = OPENDAP_HANDLE_CONTENT( opendap_data, node, content, $ node_type, has_content, $ get_data, debug ) ENDELSE ;} ENDELSE ;} ENDELSE ;} RETURN, stat ;} END