opendap/src/main/java/opendap/dap/parsers/DDSXMLParser.java
private BaseType buildArrayTemplate(Element template, String indent)
            throws DASException, NoSuchTypeException, BadSemanticsException {

        BaseType bt = null;

        if (_Debug) showXMLElement(template, indent + "...:");

        // Get all of the Attribute elements (tagged <Attribute>)
        Iterator attrElements = template.getChildren("Attribute", opendapNameSpace).iterator();

        if (attrElements.hasNext())
            throw new BadSemanticsException("Array Template Variables MAY NOT have Attributes");

        // Build the appropriate BaseType from the tag.
        bt = newBaseType(template);

        if (_Debug) System.out.println("Got template: " + bt.getTypeName() + "   " + bt.getClearName());

        // Now we need to make sure this particular BaseType
        // derived element isn't some special type that needs
        // additional parsing:

        // Is it a container?
        if (bt instanceof DConstructor) {

            // Up date the parsers state, (cache my parent)
            DConstructor myParentDC = parentDC;
            parentDC = (DConstructor) bt;
            try {
            // Grids are special containers, handle them
            if (bt instanceof DGrid) {
                parseGrid(template, indent);
            } else {
                // Otherwise, recurse on the children
              for (Element child : template.getChildren()) {
                parseBase(child, indent + "    ");
              }
            }
            } finally {
            // restore my parent
            parentDC = myParentDC;
            }

        }

        return (bt);
    }
private BaseType buildArrayTemplate(Element template, String indent)
            throws DASException, NoSuchTypeException, BadSemanticsException {

        BaseType bt = null;

        if (_Debug) showXMLElement(template, indent + "...:");

        // Get all of the Attribute elements (tagged <Attribute>)
        Iterator attrElements = template.getChildren("Attribute", opendapNameSpace).iterator();

        if (attrElements.hasNext())
            throw new BadSemanticsException("Array Template Variables MAY NOT have Attributes");

        // Build the appropriate BaseType from the tag.
        bt = newBaseType(template);

        if (_Debug) System.out.println("Got template: " + bt.getTypeName() + "   " + bt.getClearName());

        // Now we need to make sure this particular BaseType
        // derived element isn't some special type that needs
        // additional parsing:

        // Is it a container?
        if (bt instanceof DConstructor) {

            // Up date the parsers state, (cache my parent)
            DConstructor myParentDC = parentDC;
            parentDC = (DConstructor) bt;
            try {
            // Grids are special containers, handle them
            if (bt instanceof DGrid) {
                parseGrid(template, indent);
            } else {
                // Otherwise, recurse on the children
              for (Element child : template.getChildren()) {
                parseBase(child, indent + "    ");
              }
            }
            } finally {
            // restore my parent
            parentDC = myParentDC;
            }

        }

        return (bt);
    }
private BaseType buildArrayTemplate ( Element template , String indent ) throws DASException , NoSuchTypeException , BadSemanticsException { BaseType bt = null ; if ( _Debug ) showXMLElement ( template , indent + "...:" ) ; // Get all of the Attribute elements (tagged <Attribute>)
 Iterator attrElements = template . getChildren ( "Attribute" , opendapNameSpace ) . iterator ( ) ; if ( attrElements . hasNext ( ) ) throw new BadSemanticsException ( "Array Template Variables MAY NOT have Attributes" ) ; // Build the appropriate BaseType from the tag.
 bt = newBaseType ( template ) ; if ( _Debug ) System . out . println ( "Got template: " + bt . getTypeName ( ) + "   " + bt . getClearName ( ) ) ; // Now we need to make sure this particular BaseType
 // derived element isn't some special type that needs
 // additional parsing:
 // Is it a container?
 if ( bt instanceof DConstructor ) { // Up date the parsers state, (cache my parent)
 DConstructor myParentDC = parentDC ; parentDC = ( DConstructor ) bt ; try { // Grids are special containers, handle them
 if ( bt instanceof DGrid ) { parseGrid ( template , indent ) ; } else { // Otherwise, recurse on the children
 for ( Element child : template . getChildren ( ) ) { parseBase ( child , indent + "    " ) ; } } } finally { // restore my parent
 parentDC = myParentDC ; } } return ( bt ) ; }
Builds the template variable for an array. The logic here has a lot
in common with the logic in parseBase. I considered trying to
refactor the code so that the two methods could utilize the same logic,
but I bagged it. Cie' la vie.
<p/>
Arrays of arrays are not allowed this rule should is enforced
through the schema validation process.
Builds the template variable for an array . The logic here has a lot in common with the logic in parseBase . I considered trying to refactor the code so that the two methods could utilize the same logic but I bagged it . Cie la vie . <p / > Arrays of arrays are not allowed this rule should is enforced through the schema validation process .