Dap:Attribute Extension Example 2

From OPeNDAP Documentation

1 Example 2

Here we use a transform that maps arbitary XML into a subset of the DAP Attribute space.

Xml elements with xml attributes or child elements map to dap:Attribute container with namespace or prefix attributes.

Xml elements without xml attributes or child elements map to dap:Attribute of type String with namespace or prefix attributes.

The mapping requires extending the dap:Attribute model to include:

  1. A "namespace" attribute.
  2. A "prefix" attribute.
  3. A new type called xmlAttributeNode

Although this requires fewer changes to the dap:Attribute model it forces any software attempting to extract the original XML to understand the implicit semantics of the encoding.

For example, when the extracting software encounters this:

                 <dap:Attribute name="LowerCorner" namespace="http://www.opengis.net/ows/1.1" type="String">
                    <dap:value>-97.8839 21.736</dap:value>
                 </dap:Attribute>

It must "know" that this is a special dap:Attribute that represents an xml element with simple text content:

              <LowerCorner xmlns="http://www.opengis.net/ows/1.1" >-97.8839 21.736</LowerCorner>

And that this:

       <dap:Attribute name="LowerCorner" namespace="http://www.opengis.net/ows/1.1" type="String">
           <dap:Attribute name="crs" type="xmlAttributeNode" namespace="http://www.opengis.net/gml/3.2">
               <dap:value>urn:ogc:def:crs:EPSG::4326</dap:value>
           </dap:Attribute>
           <dap:Attribute name="textNode" type="String">
               <dap:value>-97.8839 21.736</dap:value>
           </dap:Attribute>
      </dap:Attribute>

Represents an xml element with an xml attribute called crs (in the gml namespace) and plain text content:

       <LowerCorner xmlns="http://www.opengis.net/ows/1.1" 
                    xmlns:gml="http://www.opengis.net/gml/3.2" 
                    gml:crs="urn:ogc:def:crs:EPSG::4326" >-97.8839 21.736</LowerCorner>

I think that's much less useful than example 1's explicit tagging, but more in line with the current DAP data model (which is namespace ignorant)



1.1 Source XML

<?xml version="1.0" encoding="UTF-8"?>
<CoverageDescriptions xmlns="http://www.opengis.net/wcs/1.1" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:owcs="http://www.opengis.net/wcs/1.1/ows" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:schemaLocation="http://www.opengis.net/wcs/1.1  http://schemas.opengis.net/wcs/1.1.0/wcsDescribeCoverage.xsd  http://www.opengis.net/ows/1.1  http://schemas.opengis.net/ows/1.1.0/owsAll.xsd  http://www.opengis.net/wcs/1.1/ows http://schemas.opengis.net/wcs/1.1.0/owsDataIdentification.xsd http://www.opengis.net/gml/3.2  http://schemas.opengis.net/gml/3.2.1/gml.xsd">
    <CoverageDescription>
        <ows:Title>Near-Real Time Surface Ocean Velocity</ows:Title>
        <ows:Abstract>CoverageDescription generated by OPeNDAP WCS UseCase 2.0</ows:Abstract>
        <Identifier>coverage/200803061600_HFRadar_USEGC_6km_rtv_SIO.nc</Identifier>
        <Domain>
            <SpatialDomain>
                <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::4326">
                    <ows:LowerCorner>-97.8839 21.736</ows:LowerCorner>
                    <ows:UpperCorner>-57.2312 46.4944</ows:UpperCorner>
                </ows:BoundingBox>
            </SpatialDomain>
            <TemporalDomain>
                <gml:timePosition>2008-03-27T16:00:00.000Z</gml:timePosition>
            </TemporalDomain>
        </Domain>
        <Range>
            <Field>
                <ows:Title>surface_eastward_sea_water_velocity</ows:Title>
                <ows:Abstract>Eastward component of a 2D sea surface velocity vector.</ows:Abstract>
                <Identifier>u</Identifier>
                <Definition>
                    <ows:AnyValue/>
                </Definition>
                <NullValue>-32768</NullValue>
                <owcs:InterpolationMethods>
                    <owcs:DefaultMethod>nearest</owcs:DefaultMethod>
                </owcs:InterpolationMethods>
            </Field>
            <Field>
                <ows:Title>surface_northward_sea_water_velocity</ows:Title>
                <ows:Abstract>Northward component of a 2D sea surface velocity vector.</ows:Abstract>
                <Identifier>v</Identifier>
                <Definition>
                    <ows:AnyValue/>
                </Definition>
                <NullValue>-32768</NullValue>
                <owcs:InterpolationMethods>
                    <owcs:DefaultMethod>nearest</owcs:DefaultMethod>
                </owcs:InterpolationMethods>
            </Field>
            <Field>
                <ows:Title>longitudinal dilution of precision</ows:Title>
                <ows:Abstract>The longitudinal dilution of precision (DOPx) represents the\\012contribution of the radars' configuration geometry to\\012uncertainty in the eastward velocity estimate (u). DOPx is a\\012direct multiplier of the standard error in obtaining the\\012standard deviation for the eastward velocity estimate from the\\012least squares best fit. DOPx and DOPy are commonly used to\\012obtain the geometric dilution of precision\\012(GDOP = sqrt(DOPx^2 + DOPy^2)), a useful metric for filtering\\012errant velocities due to poor geometry.</ows:Abstract>
                <Identifier>DOPx</Identifier>
                <Definition>
                    <ows:AnyValue/>
                </Definition>
                <NullValue>-32768</NullValue>
                <owcs:InterpolationMethods>
                    <owcs:DefaultMethod>nearest</owcs:DefaultMethod>
                </owcs:InterpolationMethods>
            </Field>
            <Field>
                <ows:Title>latitudinal dilution of precision</ows:Title>
                <ows:Abstract>The latitudinal dilution of precision (DOPy) represents the\\012contribution of the radars' configuration geometry to\\012uncertainty in the northward velocity estimate (v). DOPy is a\\012direct multiplier of the standard error in obtaining the\\012standard deviation for the northward velocity estimate from the\\012least squares best fit. DOPx and DOPy are commonly used to\\012obtain the geometric dilution of precision\\012(GDOP = sqrt(DOPx^2 + DOPy^2)), a useful metric for filtering\\012errant velocities due to poor geometry.</ows:Abstract>
                <Identifier>DOPy</Identifier>
                <Definition>
                    <ows:AnyValue/>
                </Definition>
                <NullValue>-32768</NullValue>
                <owcs:InterpolationMethods>
                    <owcs:DefaultMethod>nearest</owcs:DefaultMethod>
                </owcs:InterpolationMethods>
            </Field>
            <Field>
                <ows:Title>Contributing radar site latitudes</ows:Title>
                <ows:Abstract>Contributing radar site latitudes</ows:Abstract>
                <Identifier>site_lat</Identifier>
                <Definition>
                    <ows:AnyValue/>
                </Definition>
                <NullValue>-32768</NullValue>
                <owcs:InterpolationMethods>
                    <owcs:DefaultMethod>nearest</owcs:DefaultMethod>
                </owcs:InterpolationMethods>
            </Field>
            <Field>
                <ows:Title>Contributing radar site longitudes</ows:Title>
                <ows:Abstract>Contributing radar site longitudes.</ows:Abstract>
                <Identifier>site_lon</Identifier>
                <Definition>
                    <ows:AnyValue/>
                </Definition>
                <NullValue>-32768</NullValue>
                <owcs:InterpolationMethods>
                    <owcs:DefaultMethod>nearest</owcs:DefaultMethod>
                </owcs:InterpolationMethods>
            </Field>
            <Field>
                <ows:Title>Contributing radar site code.</ows:Title>
                <ows:Abstract>Contributing radar site code.</ows:Abstract>
                <Identifier>site_code</Identifier>
                <Definition>
                    <ows:AnyValue/>
                </Definition>
                <NullValue>-32768</NullValue>
                <owcs:InterpolationMethods>
                    <owcs:DefaultMethod>nearest</owcs:DefaultMethod>
                </owcs:InterpolationMethods>
            </Field>
            <Field>
                <ows:Title>Contributing radar site network affiliation code.</ows:Title>
                <ows:Abstract>Contributing radar site network affiliation code.</ows:Abstract>
                <Identifier>site_netCode</Identifier>
                <Definition>
                    <ows:AnyValue/>
                </Definition>
                <NullValue>-32768</NullValue>
                <owcs:InterpolationMethods>
                    <owcs:DefaultMethod>nearest</owcs:DefaultMethod>
                </owcs:InterpolationMethods>
            </Field>
            <Field>
                <ows:Title>RTV processing parameters</ows:Title>
                <ows:Abstract>Contributing radar site network affiliation code.</ows:Abstract>
                <Identifier>procParams</Identifier>
                <Definition>
                    <ows:AnyValue/>
                </Definition>
                <NullValue>-32768</NullValue>
                <owcs:InterpolationMethods>
                    <owcs:DefaultMethod>nearest</owcs:DefaultMethod>
                </owcs:InterpolationMethods>
            </Field>
        </Range>
        <SupportedCRS>urn:ogc:def:crs:EPSG::4326</SupportedCRS>
        <SupportedFormat>netcdf-cf1.0</SupportedFormat>
        <SupportedFormat>dap2.0</SupportedFormat>
    </CoverageDescription>
</CoverageDescriptions>

1.2 Transform ( xml -xslt-> dap)

    <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:dap="http://xml.opendap.org/ns/DAP2"
            >
        <xsl:output method='xml' version='1.0' encoding='UTF-8' indent='yes'/>

        <xsl:strip-space elements="*" />


        <xsl:template match="/">
            <dap:Dataset>
                <xsl:apply-templates/>
            </dap:Dataset>

        </xsl:template>
        <xsl:template match="*">
            <!-- Create a dap:Attribute element to wrap this XML element -->
            <xsl:element name="dap:Attribute">

                <!-- The name of the dap:Attribute is the non-prefixed QName of the source XML element -->
                <xsl:attribute name="name">
                    <xsl:value-of select="local-name()"/>
                </xsl:attribute>

                <!-- Add the namespace of the source XML element as an attribute -->
                <xsl:attribute name="namespace">
                    <xsl:value-of select="namespace-uri()"/>
                </xsl:attribute>

                <!--  Map it to a namespaced dap:Attribute -->

                <xsl:choose>
                    <!--  If it has child elements or xml attributes it's going into an Attribute Container. -->
                    <xsl:when test="* | @*">
                        <xsl:attribute name="type">Container</xsl:attribute>

                        <!-- Make special Attributes for each of the xml elements attributes. -->
                        <xsl:for-each select="@*">
                            <xsl:element name="dap:Attribute">
                                <xsl:attribute name="name">
                                    <xsl:value-of select="local-name()"/>
                                </xsl:attribute>
                                <xsl:attribute name="type">xmlAttributeNode</xsl:attribute>
                                <xsl:attribute name="namespace">
                                    <xsl:value-of select="namespace-uri()"/>
                                </xsl:attribute>
                                <xsl:element name="dap:value">
                                    <xsl:value-of select="."/>
                                </xsl:element>
                            </xsl:element>
                        </xsl:for-each>

                        <!--
                           - And it's text value has to be wrapped in another dap:Attribute because dap:Attribute
                           - elements may not have a type of Container AND have values
                          -->
                        <xsl:if test="text()">
                            <xsl:element name="dap:Attribute">
                                <xsl:attribute name="name">textNode</xsl:attribute>
                                <xsl:attribute name="type">String</xsl:attribute>
                                <xsl:element name="dap:value">
                                    <xsl:copy-of select="text()"/>
                                </xsl:element>
                            </xsl:element>
                        </xsl:if>
                    </xsl:when>

                    <xsl:otherwise>
                        <!--
                           - IT looks like an element with only text (or empty content) so we
                           - can make the dap:Attribute of type String.
                          -->
                        <xsl:attribute name="type">String</xsl:attribute>
                                <xsl:element name="dap:value">
                                    <xsl:copy-of select="text()"/>
                            </xsl:element>

                    </xsl:otherwise>
                </xsl:choose>

                <xsl:apply-templates/>


            </xsl:element>
        </xsl:template>

        <xsl:template name="text">
            <xsl:copy-of select="text()"/>
        </xsl:template>

        <xsl:template  match="@*|text()" />


    </xsl:stylesheet>

1.3 Result

<?xml version="1.0" encoding="UTF-8"?>
<dap:Dataset xmlns:dap="http://xml.opendap.org/ns/DAP2">
   <dap:Attribute name="CoverageDescriptions" namespace="http://www.opengis.net/wcs/1.1"
                  type="Container">
      <dap:Attribute name="CoverageDescription" namespace="http://www.opengis.net/wcs/1.1"
                     type="Container">
         <dap:Attribute name="Title" namespace="http://www.opengis.net/ows/1.1" type="String">
            <dap:value>Near-Real Time Surface Ocean Velocity</dap:value>
         </dap:Attribute>
         <dap:Attribute name="Abstract" namespace="http://www.opengis.net/ows/1.1" type="String">
            <dap:value>CoverageDescription generated by OPeNDAP WCS UseCase 2.0</dap:value>
         </dap:Attribute>
         <dap:Attribute name="Identifier" namespace="http://www.opengis.net/wcs/1.1" type="String">
            <dap:value>coverage/200803061600_HFRadar_USEGC_6km_rtv_SIO.nc</dap:value>
         </dap:Attribute>
         <dap:Attribute name="Domain" namespace="http://www.opengis.net/wcs/1.1" type="Container">
            <dap:Attribute name="SpatialDomain" namespace="http://www.opengis.net/wcs/1.1"
                           type="Container">
               <dap:Attribute name="BoundingBox" namespace="http://www.opengis.net/ows/1.1" type="Container">
                  <dap:Attribute name="crs" type="xmlAttributeNode" namespace="http://www.opengis.net/gml/3.2">
                     <dap:value>urn:ogc:def:crs:EPSG::4326</dap:value>
                  </dap:Attribute>
                  <dap:Attribute name="LowerCorner" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value>-97.8839 21.736</dap:value>
                  </dap:Attribute>
                  <dap:Attribute name="UpperCorner" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value>-57.2312 46.4944</dap:value>
                  </dap:Attribute>
               </dap:Attribute>
            </dap:Attribute>
            <dap:Attribute name="TemporalDomain" namespace="http://www.opengis.net/wcs/1.1"
                           type="Container">
               <dap:Attribute name="timePosition" namespace="http://www.opengis.net/gml/3.2" type="String">
                  <dap:value>2008-03-27T16:00:00.000Z</dap:value>
               </dap:Attribute>
            </dap:Attribute>
         </dap:Attribute>
         <dap:Attribute name="Range" namespace="http://www.opengis.net/wcs/1.1" type="Container">
            <dap:Attribute name="Field" namespace="http://www.opengis.net/wcs/1.1" type="Container">
               <dap:Attribute name="Title" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>surface_eastward_sea_water_velocity</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Abstract" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Eastward component of a 2D sea surface velocity vector.</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Identifier" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>u</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Definition" namespace="http://www.opengis.net/wcs/1.1" type="Container">
                  <dap:Attribute name="AnyValue" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value/>
                  </dap:Attribute>
               </dap:Attribute>
               <dap:Attribute name="NullValue" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>-32768</dap:value>
               </dap:Attribute>
               <dap:Attribute name="InterpolationMethods" namespace="http://www.opengis.net/wcs/1.1/ows"
                              type="Container">
                  <dap:Attribute name="DefaultMethod" namespace="http://www.opengis.net/wcs/1.1/ows"
                                 type="String">
                     <dap:value>nearest</dap:value>
                  </dap:Attribute>
               </dap:Attribute>
            </dap:Attribute>
            <dap:Attribute name="Field" namespace="http://www.opengis.net/wcs/1.1" type="Container">
               <dap:Attribute name="Title" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>surface_northward_sea_water_velocity</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Abstract" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Northward component of a 2D sea surface velocity vector.</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Identifier" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>v</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Definition" namespace="http://www.opengis.net/wcs/1.1" type="Container">
                  <dap:Attribute name="AnyValue" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value/>
                  </dap:Attribute>
               </dap:Attribute>
               <dap:Attribute name="NullValue" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>-32768</dap:value>
               </dap:Attribute>
               <dap:Attribute name="InterpolationMethods" namespace="http://www.opengis.net/wcs/1.1/ows"
                              type="Container">
                  <dap:Attribute name="DefaultMethod" namespace="http://www.opengis.net/wcs/1.1/ows"
                                 type="String">
                     <dap:value>nearest</dap:value>
                  </dap:Attribute>
               </dap:Attribute>
            </dap:Attribute>
            <dap:Attribute name="Field" namespace="http://www.opengis.net/wcs/1.1" type="Container">
               <dap:Attribute name="Title" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>longitudinal dilution of precision</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Abstract" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>The longitudinal dilution of precision (DOPx) represents the\\012contribution of the radars' configuration geometry to\\012uncertainty in the eastward velocity estimate (u). DOPx is a\\012direct multiplier of the standard error in obtaining the\\012standard deviation for the eastward velocity estimate from the\\012least squares best fit. DOPx and DOPy are commonly used to\\012obtain the geometric dilution of precision\\012(GDOP = sqrt(DOPx^2 + DOPy^2)), a useful metric for filtering\\012errant velocities due to poor geometry.</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Identifier" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>DOPx</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Definition" namespace="http://www.opengis.net/wcs/1.1" type="Container">
                  <dap:Attribute name="AnyValue" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value/>
                  </dap:Attribute>
               </dap:Attribute>
               <dap:Attribute name="NullValue" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>-32768</dap:value>
               </dap:Attribute>
               <dap:Attribute name="InterpolationMethods" namespace="http://www.opengis.net/wcs/1.1/ows"
                              type="Container">
                  <dap:Attribute name="DefaultMethod" namespace="http://www.opengis.net/wcs/1.1/ows"
                                 type="String">
                     <dap:value>nearest</dap:value>
                  </dap:Attribute>
               </dap:Attribute>
            </dap:Attribute>
            <dap:Attribute name="Field" namespace="http://www.opengis.net/wcs/1.1" type="Container">
               <dap:Attribute name="Title" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>latitudinal dilution of precision</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Abstract" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>The latitudinal dilution of precision (DOPy) represents the\\012contribution of the radars' configuration geometry to\\012uncertainty in the northward velocity estimate (v). DOPy is a\\012direct multiplier of the standard error in obtaining the\\012standard deviation for the northward velocity estimate from the\\012least squares best fit. DOPx and DOPy are commonly used to\\012obtain the geometric dilution of precision\\012(GDOP = sqrt(DOPx^2 + DOPy^2)), a useful metric for filtering\\012errant velocities due to poor geometry.</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Identifier" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>DOPy</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Definition" namespace="http://www.opengis.net/wcs/1.1" type="Container">
                  <dap:Attribute name="AnyValue" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value/>
                  </dap:Attribute>
               </dap:Attribute>
               <dap:Attribute name="NullValue" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>-32768</dap:value>
               </dap:Attribute>
               <dap:Attribute name="InterpolationMethods" namespace="http://www.opengis.net/wcs/1.1/ows"
                              type="Container">
                  <dap:Attribute name="DefaultMethod" namespace="http://www.opengis.net/wcs/1.1/ows"
                                 type="String">
                     <dap:value>nearest</dap:value>
                  </dap:Attribute>
               </dap:Attribute>
            </dap:Attribute>
            <dap:Attribute name="Field" namespace="http://www.opengis.net/wcs/1.1" type="Container">
               <dap:Attribute name="Title" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Contributing radar site latitudes</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Abstract" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Contributing radar site latitudes</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Identifier" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>site_lat</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Definition" namespace="http://www.opengis.net/wcs/1.1" type="Container">
                  <dap:Attribute name="AnyValue" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value/>
                  </dap:Attribute>
               </dap:Attribute>
               <dap:Attribute name="NullValue" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>-32768</dap:value>
               </dap:Attribute>
               <dap:Attribute name="InterpolationMethods" namespace="http://www.opengis.net/wcs/1.1/ows"
                              type="Container">
                  <dap:Attribute name="DefaultMethod" namespace="http://www.opengis.net/wcs/1.1/ows"
                                 type="String">
                     <dap:value>nearest</dap:value>
                  </dap:Attribute>
               </dap:Attribute>
            </dap:Attribute>
            <dap:Attribute name="Field" namespace="http://www.opengis.net/wcs/1.1" type="Container">
               <dap:Attribute name="Title" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Contributing radar site longitudes</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Abstract" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Contributing radar site longitudes.</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Identifier" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>site_lon</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Definition" namespace="http://www.opengis.net/wcs/1.1" type="Container">
                  <dap:Attribute name="AnyValue" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value/>
                  </dap:Attribute>
               </dap:Attribute>
               <dap:Attribute name="NullValue" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>-32768</dap:value>
               </dap:Attribute>
               <dap:Attribute name="InterpolationMethods" namespace="http://www.opengis.net/wcs/1.1/ows"
                              type="Container">
                  <dap:Attribute name="DefaultMethod" namespace="http://www.opengis.net/wcs/1.1/ows"
                                 type="String">
                     <dap:value>nearest</dap:value>
                  </dap:Attribute>
               </dap:Attribute>
            </dap:Attribute>
            <dap:Attribute name="Field" namespace="http://www.opengis.net/wcs/1.1" type="Container">
               <dap:Attribute name="Title" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Contributing radar site code.</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Abstract" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Contributing radar site code.</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Identifier" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>site_code</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Definition" namespace="http://www.opengis.net/wcs/1.1" type="Container">
                  <dap:Attribute name="AnyValue" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value/>
                  </dap:Attribute>
               </dap:Attribute>
               <dap:Attribute name="NullValue" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>-32768</dap:value>
               </dap:Attribute>
               <dap:Attribute name="InterpolationMethods" namespace="http://www.opengis.net/wcs/1.1/ows"
                              type="Container">
                  <dap:Attribute name="DefaultMethod" namespace="http://www.opengis.net/wcs/1.1/ows"
                                 type="String">
                     <dap:value>nearest</dap:value>
                  </dap:Attribute>
               </dap:Attribute>
            </dap:Attribute>
            <dap:Attribute name="Field" namespace="http://www.opengis.net/wcs/1.1" type="Container">
               <dap:Attribute name="Title" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Contributing radar site network affiliation code.</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Abstract" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Contributing radar site network affiliation code.</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Identifier" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>site_netCode</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Definition" namespace="http://www.opengis.net/wcs/1.1" type="Container">
                  <dap:Attribute name="AnyValue" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value/>
                  </dap:Attribute>
               </dap:Attribute>
               <dap:Attribute name="NullValue" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>-32768</dap:value>
               </dap:Attribute>
               <dap:Attribute name="InterpolationMethods" namespace="http://www.opengis.net/wcs/1.1/ows"
                              type="Container">
                  <dap:Attribute name="DefaultMethod" namespace="http://www.opengis.net/wcs/1.1/ows"
                                 type="String">
                     <dap:value>nearest</dap:value>
                  </dap:Attribute>
               </dap:Attribute>
            </dap:Attribute>
            <dap:Attribute name="Field" namespace="http://www.opengis.net/wcs/1.1" type="Container">
               <dap:Attribute name="Title" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>RTV processing parameters</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Abstract" namespace="http://www.opengis.net/ows/1.1" type="String">
                  <dap:value>Contributing radar site network affiliation code.</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Identifier" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>procParams</dap:value>
               </dap:Attribute>
               <dap:Attribute name="Definition" namespace="http://www.opengis.net/wcs/1.1" type="Container">
                  <dap:Attribute name="AnyValue" namespace="http://www.opengis.net/ows/1.1" type="String">
                     <dap:value/>
                  </dap:Attribute>
               </dap:Attribute>
               <dap:Attribute name="NullValue" namespace="http://www.opengis.net/wcs/1.1" type="String">
                  <dap:value>-32768</dap:value>
               </dap:Attribute>
               <dap:Attribute name="InterpolationMethods" namespace="http://www.opengis.net/wcs/1.1/ows"
                              type="Container">
                  <dap:Attribute name="DefaultMethod" namespace="http://www.opengis.net/wcs/1.1/ows"
                                 type="String">
                     <dap:value>nearest</dap:value>
                  </dap:Attribute>
               </dap:Attribute>
            </dap:Attribute>
         </dap:Attribute>
         <dap:Attribute name="SupportedCRS" namespace="http://www.opengis.net/wcs/1.1" type="String">
            <dap:value>urn:ogc:def:crs:EPSG::4326</dap:value>
         </dap:Attribute>
         <dap:Attribute name="SupportedFormat" namespace="http://www.opengis.net/wcs/1.1" type="String">
            <dap:value>netcdf-cf1.0</dap:value>
         </dap:Attribute>
         <dap:Attribute name="SupportedFormat" namespace="http://www.opengis.net/wcs/1.1" type="String">
            <dap:value>dap2.0</dap:value>
         </dap:Attribute>
      </dap:Attribute>
   </dap:Attribute>
</dap:Dataset>

1.4 Transform Back (dap -xslt-> xml)

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:dap="http://xml.opendap.org/ns/DAP2"
                xmlns:wcs="http://www.opengis.net/wcs/1.1"
                xmlns:ows="http://www.opengis.net/ows/1.1"
                xmlns:owcs="http://www.opengis.net/wcs/1.1/ows"
                xmlns:gml="http://www.opengis.net/gml/3.2"
                xmlns:xlink="http://www.w3.org/1999/xlink"
        >
    <xsl:output method='xml' version='1.0' encoding='UTF-8' indent='yes'/>


    <xsl:template match="dap:Attribute">
        <xsl:copy>
            <xsl:call-template name="copyTextAndAttributes"/>
            <xsl:apply-templates />
        </xsl:copy>
    </xsl:template>

    <!--
       - xmlElementNode
      -->
    <xsl:template match="dap:Attribute[@type!='xmlAttributeNode' and (boolean(@namespace) or boolean(@prefix))]">
        <xsl:call-template name="xmlElement"/>
    </xsl:template>

    <xsl:template match="dap:Attribute[@type='xmlAttributeNode']" />


    <!--
       - xmlAttributeNode
      -->
    <xsl:template match="dap:Attribute[@type='xmlAttributeNode']" mode="xmlAttributeMode">
            <xsl:choose>
                <xsl:when test="@prefix">
                    <xsl:attribute name="{@prefix}:{@name}">
                        <xsl:value-of select="normalize-space(dap:value)" />
                    </xsl:attribute>
                </xsl:when>
                <xsl:when test="@namespace">
                    <xsl:attribute name="{@name}" namespace="{@namespace}">
                        <xsl:value-of select="normalize-space(dap:value)" />
                    </xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:attribute name="{@name}">
                        <xsl:value-of select="normalize-space(dap:value)" />
                    </xsl:attribute>
                </xsl:otherwise>
            </xsl:choose>

    </xsl:template>

    <!--
       - xmlTextNode
      -->
    <xsl:template name="xmlTextNode">
        <xsl:choose>
            <xsl:when test="@type='Container'">
                <xsl:if test="dap:Attribute[@type=String]">
                    <xsl:value-of select="dap:Attribute[@type=String]/dap:value"/>
                </xsl:if>

            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="dap:value"/>
            </xsl:otherwise>

        </xsl:choose>
    </xsl:template>


    <!--
       - supress regular text and attributes.
      -->
    <xsl:template  match="@*|text()" />
    <xsl:template  match="@*|text()" mode="xmlAttributeMode"/>


    <xsl:template name="xmlElement">
        <xsl:choose>
            <xsl:when test="@prefix">
                <xsl:choose>
                    <xsl:when test="@namespace">
                        <xsl:element name="{@prefix}:{@name}" namespace="{@namespace}">
                            <xsl:apply-templates select="." mode="xmlAttributeMode"/>
                            <xsl:call-template name="xmlTextNode"/>
                            <xsl:apply-templates />
                        </xsl:element>
                    </xsl:when>
                    <xsl:otherwise >
                        <xsl:element name="{@prefix}:{@name}">
                            <xsl:apply-templates select="." mode="xmlAttributeMode"/>
                            <xsl:call-template name="xmlTextNode"/>
                            <xsl:apply-templates />
                        </xsl:element>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:when>
            <xsl:when test="@namespace" >
                <xsl:choose>
                    <xsl:when test="@namespace">
                        <xsl:element name="{@name}" namespace="{@namespace}">
                            <xsl:apply-templates select="." mode="xmlAttributeMode"/>
                            <xsl:call-template name="xmlTextNode"/>
                            <xsl:apply-templates />
                        </xsl:element>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:element name="{@name}">
                            <xsl:apply-templates select="." mode="xmlAttributeMode"/>
                            <xsl:call-template name="xmlTextNode"/>
                            <xsl:apply-templates />
                        </xsl:element>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:when>
            <xsl:otherwise >
                <BONK />
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template name="copyTextAndAttributes" ><xsl:copy-of select="text()|@*" /></xsl:template>

</xsl:stylesheet>

1.5 Result

<?xml version="1.0" encoding="UTF-8"?>
<CoverageDescriptions xmlns="http://www.opengis.net/wcs/1.1" xmlns:gml="http://www.opengis.net/gml/3.2"
                      gml:crs="urn:ogc:def:crs:EPSG::4326">
   <CoverageDescription gml:crs="urn:ogc:def:crs:EPSG::4326">
      <Title xmlns="http://www.opengis.net/ows/1.1">Near-Real Time Surface Ocean Velocity</Title>
      <Abstract xmlns="http://www.opengis.net/ows/1.1">CoverageDescription generated by OPeNDAP WCS UseCase 2.0</Abstract>
      <Identifier>coverage/200803061600_HFRadar_USEGC_6km_rtv_SIO.nc</Identifier>
      <Domain gml:crs="urn:ogc:def:crs:EPSG::4326">
         <SpatialDomain gml:crs="urn:ogc:def:crs:EPSG::4326">
            <BoundingBox xmlns="http://www.opengis.net/ows/1.1" gml:crs="urn:ogc:def:crs:EPSG::4326">
               <LowerCorner>-97.8839 21.736</LowerCorner>
               <UpperCorner>-57.2312 46.4944</UpperCorner>
            </BoundingBox>
         </SpatialDomain>
         <TemporalDomain>
            <timePosition xmlns="http://www.opengis.net/gml/3.2">2008-03-27T16:00:00.000Z</timePosition>
         </TemporalDomain>
      </Domain>
      <Range>
         <Field>
            <Title xmlns="http://www.opengis.net/ows/1.1">surface_eastward_sea_water_velocity</Title>
            <Abstract xmlns="http://www.opengis.net/ows/1.1">Eastward component of a 2D sea surface velocity vector.</Abstract>
            <Identifier>u</Identifier>
            <Definition>
               <AnyValue xmlns="http://www.opengis.net/ows/1.1"/>
            </Definition>
            <NullValue>-32768</NullValue>
            <InterpolationMethods xmlns="http://www.opengis.net/wcs/1.1/ows">
               <DefaultMethod>nearest</DefaultMethod>
            </InterpolationMethods>
         </Field>
         <Field>
            <Title xmlns="http://www.opengis.net/ows/1.1">surface_northward_sea_water_velocity</Title>
            <Abstract xmlns="http://www.opengis.net/ows/1.1">Northward component of a 2D sea surface velocity vector.</Abstract>
            <Identifier>v</Identifier>
            <Definition>
               <AnyValue xmlns="http://www.opengis.net/ows/1.1"/>
            </Definition>
            <NullValue>-32768</NullValue>
            <InterpolationMethods xmlns="http://www.opengis.net/wcs/1.1/ows">
               <DefaultMethod>nearest</DefaultMethod>
            </InterpolationMethods>
         </Field>
         <Field>
            <Title xmlns="http://www.opengis.net/ows/1.1">longitudinal dilution of precision</Title>
            <Abstract xmlns="http://www.opengis.net/ows/1.1">The longitudinal dilution of precision (DOPx) represents the\\012contribution of the radars' configuration geometry to\\012uncertainty in the eastward velocity estimate (u). DOPx is a\\012direct multiplier of the standard error in obtaining the\\012standard deviation for the eastward velocity estimate from the\\012least squares best fit. DOPx and DOPy are commonly used to\\012obtain the geometric dilution of precision\\012(GDOP = sqrt(DOPx^2 + DOPy^2)), a useful metric for filtering\\012errant velocities due to poor geometry.</Abstract>
            <Identifier>DOPx</Identifier>
            <Definition>
               <AnyValue xmlns="http://www.opengis.net/ows/1.1"/>
            </Definition>
            <NullValue>-32768</NullValue>
            <InterpolationMethods xmlns="http://www.opengis.net/wcs/1.1/ows">
               <DefaultMethod>nearest</DefaultMethod>
            </InterpolationMethods>
         </Field>
         <Field>
            <Title xmlns="http://www.opengis.net/ows/1.1">latitudinal dilution of precision</Title>
            <Abstract xmlns="http://www.opengis.net/ows/1.1">The latitudinal dilution of precision (DOPy) represents the\\012contribution of the radars' configuration geometry to\\012uncertainty in the northward velocity estimate (v). DOPy is a\\012direct multiplier of the standard error in obtaining the\\012standard deviation for the northward velocity estimate from the\\012least squares best fit. DOPx and DOPy are commonly used to\\012obtain the geometric dilution of precision\\012(GDOP = sqrt(DOPx^2 + DOPy^2)), a useful metric for filtering\\012errant velocities due to poor geometry.</Abstract>
            <Identifier>DOPy</Identifier>
            <Definition>
               <AnyValue xmlns="http://www.opengis.net/ows/1.1"/>
            </Definition>
            <NullValue>-32768</NullValue>
            <InterpolationMethods xmlns="http://www.opengis.net/wcs/1.1/ows">
               <DefaultMethod>nearest</DefaultMethod>
            </InterpolationMethods>
         </Field>
         <Field>
            <Title xmlns="http://www.opengis.net/ows/1.1">Contributing radar site latitudes</Title>
            <Abstract xmlns="http://www.opengis.net/ows/1.1">Contributing radar site latitudes</Abstract>
            <Identifier>site_lat</Identifier>
            <Definition>
               <AnyValue xmlns="http://www.opengis.net/ows/1.1"/>
            </Definition>
            <NullValue>-32768</NullValue>
            <InterpolationMethods xmlns="http://www.opengis.net/wcs/1.1/ows">
               <DefaultMethod>nearest</DefaultMethod>
            </InterpolationMethods>
         </Field>
         <Field>
            <Title xmlns="http://www.opengis.net/ows/1.1">Contributing radar site longitudes</Title>
            <Abstract xmlns="http://www.opengis.net/ows/1.1">Contributing radar site longitudes.</Abstract>
            <Identifier>site_lon</Identifier>
            <Definition>
               <AnyValue xmlns="http://www.opengis.net/ows/1.1"/>
            </Definition>
            <NullValue>-32768</NullValue>
            <InterpolationMethods xmlns="http://www.opengis.net/wcs/1.1/ows">
               <DefaultMethod>nearest</DefaultMethod>
            </InterpolationMethods>
         </Field>
         <Field>
            <Title xmlns="http://www.opengis.net/ows/1.1">Contributing radar site code.</Title>
            <Abstract xmlns="http://www.opengis.net/ows/1.1">Contributing radar site code.</Abstract>
            <Identifier>site_code</Identifier>
            <Definition>
               <AnyValue xmlns="http://www.opengis.net/ows/1.1"/>
            </Definition>
            <NullValue>-32768</NullValue>
            <InterpolationMethods xmlns="http://www.opengis.net/wcs/1.1/ows">
               <DefaultMethod>nearest</DefaultMethod>
            </InterpolationMethods>
         </Field>
         <Field>
            <Title xmlns="http://www.opengis.net/ows/1.1">Contributing radar site network affiliation code.</Title>
            <Abstract xmlns="http://www.opengis.net/ows/1.1">Contributing radar site network affiliation code.</Abstract>
            <Identifier>site_netCode</Identifier>
            <Definition>
               <AnyValue xmlns="http://www.opengis.net/ows/1.1"/>
            </Definition>
            <NullValue>-32768</NullValue>
            <InterpolationMethods xmlns="http://www.opengis.net/wcs/1.1/ows">
               <DefaultMethod>nearest</DefaultMethod>
            </InterpolationMethods>
         </Field>
         <Field>
            <Title xmlns="http://www.opengis.net/ows/1.1">RTV processing parameters</Title>
            <Abstract xmlns="http://www.opengis.net/ows/1.1">Contributing radar site network affiliation code.</Abstract>
            <Identifier>procParams</Identifier>
            <Definition>
               <AnyValue xmlns="http://www.opengis.net/ows/1.1"/>
            </Definition>
            <NullValue>-32768</NullValue>
            <InterpolationMethods xmlns="http://www.opengis.net/wcs/1.1/ows">
               <DefaultMethod>nearest</DefaultMethod>
            </InterpolationMethods>
         </Field>
      </Range>
      <SupportedCRS>urn:ogc:def:crs:EPSG::4326</SupportedCRS>
      <SupportedFormat>netcdf-cf1.0</SupportedFormat>
      <SupportedFormat>dap2.0</SupportedFormat>
   </CoverageDescription>
</CoverageDescriptions>