Package org.apache.sis.xml

Provides methods for marshalling and unmarshalling SIS objects in XML. The XML format is compliant with ISO 19115-3 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"?>
<cit:CI_Citation xmlns:gmd=""
    <gco:CharacterString>Open Geospatial Consortium</gco:CharacterString>
  ... much more XML below this point ...
Customizing the XML
In order to parse and format ISO 19115-3 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.


Defined in the sis-metadata module