Skip navigation links

Package org.apache.sis.xml

Provides methods for marshalling and unmarshalling SIS objects in XML.

See: Description

Package org.apache.sis.xml Description

Provides methods for marshalling and unmarshalling SIS objects in XML. The XML format is compliant with ISO 19139 specification for metadata, and compliant with GML for referencing objects.

The main class in this package is XML, which provides property keys that can be used for configuring (un)marshallers and convenience static methods. For example the following code:

XML.marshal(Citations.OGC, System.out);
will produce a string like below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gmd:CI_Citation xmlns:gmd="http://www.isotc211.org/2005/gmd"
                 xmlns:gco="http://www.isotc211.org/2005/gco">
  <gmd:title>
    <gco:CharacterString>Open Geospatial Consortium</gco:CharacterString>
  </gmd:title>
  ... much more XML below this point ...
</gmd:CI_Citation>
Customizing the XML
In order to parse and format ISO 19139 compliant documents, SIS needs its own Marshaller and Unmarshaller instances (which are actually wrappers around standard instances). Those instances are created and cached by Marshaller­Pool, which is used internally by the above-cited XML class. However developers can instantiate their own Marshaller­Pool in order to get more control on the marshalling and unmarshalling processes, including the namespace URLs and the errors handling.

The most common namespace URLs are defined in the Namespaces class. The parsing of some objects like URL and UUID, together with the behavior in case of parsing error, can be specified by the Value­Converter class.

Since:
0.3

Defined in the sis-utility module

Skip navigation links

Copyright © 2010–2016 The Apache Software Foundation. All rights reserved.