opendap/src/main/java/opendap/dap/DDS.java
private void buildDASAttributeTable(BaseType bt, AttributeTable atbl)
            throws DASException
    {

        // Get this BaseType's AttributeTable. Since we are using the AttributeTable
        // interface to build the DAS (which will have a different structure than the
        // table we are getting anyway), we don't need a copy, only the reference.
        AttributeTable tBTAT = bt.getAttributeTable();

        // if the table is empty, then do nothing
        if(tBTAT == null || tBTAT.size() == 0)
            return;

        // Start a new (child) AttributeTable (using the name of the one we are
        // copying) in the (parent) AttributeTable we are working on.
        AttributeTable newAT = atbl.appendContainer(tBTAT.getEncodedName());

        if (_Debug) {
		DAPNode.log.debug("newAT.getName(): " + newAT.getEncodedName());
	    }

        // Get each Attribute in the AttributeTable that we are copying,
        // and then put it's values into our new AttributeTable;
        Enumeration e = tBTAT.getNames();
        while (e.hasMoreElements()) {
            String attrName = (String) e.nextElement();
            Attribute attr = tBTAT.getAttribute(attrName);
            populateAttributeTable(newAT, attr);
        }

        // If this BaseType is a "container" type (aka complex type, aka DConstructor)
        // Then we have to search it's children for Attributes and then  them
        // and put them in our new Attribute Table.
        if (bt instanceof DConstructor) {
            Enumeration v = ((DConstructor) bt).getVariables();

            while (v.hasMoreElements()) {
                BaseType thisBT = (BaseType) v.nextElement();
                buildDASAttributeTable(thisBT, newAT);
            }
        }


    }
private void buildDASAttributeTable(BaseType bt, AttributeTable atbl)
            throws DASException
    {

        // Get this BaseType's AttributeTable. Since we are using the AttributeTable
        // interface to build the DAS (which will have a different structure than the
        // table we are getting anyway), we don't need a copy, only the reference.
        AttributeTable tBTAT = bt.getAttributeTable();

        // if the table is empty, then do nothing
        if(tBTAT == null || tBTAT.size() == 0)
            return;

        // Start a new (child) AttributeTable (using the name of the one we are
        // copying) in the (parent) AttributeTable we are working on.
        AttributeTable newAT = atbl.appendContainer(tBTAT.getEncodedName());

        if (_Debug) {
		DAPNode.log.debug("newAT.getName(): " + newAT.getEncodedName());
	    }

        // Get each Attribute in the AttributeTable that we are copying,
        // and then put it's values into our new AttributeTable;
        Enumeration e = tBTAT.getNames();
        while (e.hasMoreElements()) {
            String attrName = (String) e.nextElement();
            Attribute attr = tBTAT.getAttribute(attrName);
            populateAttributeTable(newAT, attr);
        }

        // If this BaseType is a "container" type (aka complex type, aka DConstructor)
        // Then we have to search it's children for Attributes and then  them
        // and put them in our new Attribute Table.
        if (bt instanceof DConstructor) {
            Enumeration v = ((DConstructor) bt).getVariables();

            while (v.hasMoreElements()) {
                BaseType thisBT = (BaseType) v.nextElement();
                buildDASAttributeTable(thisBT, newAT);
            }
        }


    }
Builds AttributeTables (from BaseType variables) for us in
a DAS created by getDAS()

@param bt
@param atbl
@throws DASException
@see #getDAS()