/
XML Metacard Transformer

XML Metacard Transformer

Description

The XML Metacard Transformer is responsible for translating a Metacard into an XML formatted document. The metacard element that is generated is an extension of gml:AbstractFeatureType which makes the output of this transformer GML 3.1.1 compatible. 

Usage

Using the REST Endpoint for example, request a Metacard with the transform option set to the XML shortname.

http://localhost:8181/services/catalog/ac0c6917d5ee45bfb3c2bf8cd2ebaa67?transform=xml

Example Output

The schema file for the XML Metacard format, metacard.xsd, is attached to this page.

<ns3:metacard ns1:id="ac0c6917d5ee45bfb3c2bf8cd2ebaa67" xmlns:ns1="http://www.opengis.net/gml" xmlns:ns3="urn:catalog:metacard">
   <ns3:type>ddf.metacard</ns3:type>
   <ns3:source>ddf</ns3:source>
   <ns3:dateTime name="modified">
      <ns3:value>2013-01-29T17:09:19.980-07:00</ns3:value>
   </ns3:dateTime>
   <ns3:stringxml name="metadata">
      <ns3:value>
         <ddms:Resource xmlns:ddms="http://metadata.dod.mil/mdr/ns/DDMS/2.0/" xmlns:ICISM="urn:us:gov:ic:ism:v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ddms:identifier ddms:qualifier="http://example.test#URI" ddms:value="http://example.test.html"/>
            <ddms:title ICISM:classification="U" ICISM:ownerProducer="USA">Example Title</ddms:title>
            <ddms:description ICISM:classification="U" ICISM:ownerProducer="USA">Example description.</ddms:description>
            <ddms:dates ddms:posted="2013-01-29"/>
            <ddms:rights ddms:copyright="true" ddms:intellectualProperty="true" ddms:privacyAct="false"/>
            <ddms:creator ICISM:classification="U" ICISM:ownerProducer="USA">
               <ddms:Person>
                  <ddms:name>John Doe</ddms:name>
                  <ddms:surname>Doe</ddms:surname>
               </ddms:Person>
            </ddms:creator>
            <ddms:subjectCoverage>
               <ddms:Subject>
                  <ddms:category ddms:code="nitf" ddms:label="nitf" ddms:qualifier="SubjectCoverageQualifier"/>
                  <ddms:keyword ddms:value="schematypesearch"/>
               </ddms:Subject>
            </ddms:subjectCoverage>
            <ddms:temporalCoverage>
               <ddms:TimePeriod>
                  <ddms:start>2013-01-29</ddms:start>
                  <ddms:end>2013-01-29</ddms:end>
               </ddms:TimePeriod>
            </ddms:temporalCoverage>
            <ddms:security ICISM:classification="U" ICISM:ownerProducer="USA"/>
         </ddms:Resource>
      </ns3:value>
   </ns3:stringxml>
   <ns3:string name="resource-size">
      <ns3:value>N/A</ns3:value>
   </ns3:string>
   <ns3:geometry name="location">
      <ns3:value>
         <ns1:Point>
            <ns1:pos>2.0 1.0</ns1:pos>
         </ns1:Point>
      </ns3:value>
   </ns3:geometry>
   <ns3:dateTime name="created">
      <ns3:value>2013-01-29T17:09:19.980-07:00</ns3:value>
   </ns3:dateTime>
   <ns3:string name="resource-uri">
      <ns3:value>http://example.com</ns3:value>
   </ns3:string>
   <ns3:string name="metadata-content-type-version">
      <ns3:value>v2.0</ns3:value>
   </ns3:string>
   <ns3:string name="title">
      <ns3:value>Example Title</ns3:value>
   </ns3:string>
   <ns3:string name="metadata-content-type">
      <ns3:value>Resource</ns3:value>
   </ns3:string>
   <ns3:dateTime name="effective">
      <ns3:value>2013-01-29T17:09:19.980-07:00</ns3:value>
   </ns3:dateTime>
</ns3:metacard>                

Installation and Uninstallation

This transformer comes installed out of the box and is running on start up. To uninstall or install manually, use the catalog-transformer-xml feature using the Web Console or System Console.

Configuration

None

Implementation Details

Metacard to XML Mappings

Metacard VariablesXML Element
id

metacard/@gml:id

metacardTypemetacard/type
sourceIdmetacard/source
all other attributes

metacard/<AttributeType>[name='<AttributeName>']/value

For instance, the value for the Metacard Attribute named "title" would be found at

metacard/string[@name='title']/value 

AttributeTypes 

XML Adapted Attributes
boolean
base64Binary
dateTime
double
float
geometry
int
long
object
short
string
stringxml

Known Issues

None