Back button
package samples;


import java.io.File;
import java.io.IOException;
import java.io.StringReader;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Locale;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.sax.SAXSource;
import javax.xml.validation.Validator;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import mikado.Cdi19139;
import mikado.Conf;
import mikado.Csr19139;
import mikado.automatic.generator.Csr19139Generator;
import mikado.automatic.generator.XmlGenerator;
import mikado.language.Language;
import mikado.xml.ISOException;
import mikado.xml.editors.CitRespParty;
import mikado.xml.editors.CitRespPartyComparator;
import mikado.xml.editors.Keyword;
import mikado.xml.editors.MdHrLvNameFinder;
import mikado.xml.editors.RpOrgNameRpCntInfoRoleEditor;
import mikado.xml.vocabulary.EdmerpSimpleListHandler;
import mikado.xml.vocabulary.EdmerpUpdater;
import mikado.xml.vocabulary.EdmoUpdater;
import mikado.xml.vocabulary.ListUpdater;
import mikado.xml.vocabulary.Version;
import mikado.xml.vocabulary.VocabularyUpdater;
import mikado.xml19139.MetadataCsrIso19139;
import mikado.xml19139.fragments.GmdCI_ResponsibleParty;
import mikado.xml19139.fragments.GmdcitedResponsibleParty;
import mikado.xml19139.fragments.GmdgeographicElement4gmdEX_GeographicBoundingBoxes;
import mikado.xml19139.fragments.GmdgeographicElement4gmdEX_GeographicDescription;
import mikado.xml19139.fragments.Gmdkeyword4instrument;
import mikado.xml19139.fragments.Gmdkeyword4parameter;
import mikado.xml19139.fragments.Gmdkeyword4project;
import mikado.xml19139.fragments.Gmdkeyword4sdnSDN_MarsdenCode;
import mikado.xml19139.fragments.Gmdkeyword4sdnSDN_WaterBodyCode;
import mikado.xml19139.fragments.GmdpointOfContact4gmdindividualName;
import mikado.xml19139.fragments.GmdresourceConstraints;
import mikado.xml19139.fragments.Gmiobjective4moorings;
import mikado.xml19139.fragments.Gmiobjective4samples;
import mikado.xml19139.fragments.SdnadditionalDocumentation;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import sdn.internal.Element;
import sdn.vocabulary.implementations.Collection;
import static sdn.vocabulary.implementations.Collection.SDN;
import sdn.vocabulary.implementations.CollectionFactory;
import sdn.vocabulary.interfaces.ICollection;
import sdn.vocabulary.interfaces.IElement;
import sdn.vocabulary.interfaces.VocabularyException;





/**
 *
 * @author mlarour
 */
public class WriteCsrSample
{
   private static String getLabel(String reference,String key) throws VocabularyException
   {
      ICollection  iCollection = CollectionFactory.getInstance().getCollection(false,reference);
      return iCollection.getElementFromKey(key).getLabel();
   }   
   
   private static CitRespParty getEdmo(ArrayList edmos,String key) throws VocabularyException
   {
      for(CitRespParty edmo : edmos)
      {
         if(Element.getKey(edmo.getRpOrgName().getSDNIdent4rpOrgName().getValue()).compareTo(key) == 0)
         {
            CitRespParty citRespParty = new CitRespParty(edmo);
            citRespParty.getRpOrgName().getSDNIdent4rpOrgName().setValue(key);
            return citRespParty;
         }
      }
      throw new VocabularyException("EDMO "+key+" is not found");
   }
   
   private static Gmdkeyword4project getEdmerp(ArrayList edmerps,String key) throws VocabularyException
   {
      for(Gmdkeyword4project edmerp : edmerps)
      {
         if(Element.getKey(edmerp.getSdnSDN_EDMERPCode().getCodeListValue().getValue()).compareTo(key) == 0)
         {
            Gmdkeyword4project gmdkeyword4project = new Gmdkeyword4project(edmerp);
            gmdkeyword4project.getSdnSDN_EDMERPCode().getCodeListValue().setValue(key);
            return gmdkeyword4project;
         }
      }
      throw new VocabularyException("EDMERP "+key+" is not found");
   }
   
   /** Sample code to show how to build BODC list of key label for HMI
    * 
    * @param references list of BODC list references
    * @throws VocabularyException 
    */
   private static void populateBODC(String ... references) throws VocabularyException
   {
      for(String reference : references)
      {
         ICollection  iCollection = CollectionFactory.getInstance().getCollection(false,reference);
         System.out.println("+------------------+");
         System.out.println("| HMI LIST FOR "+reference+" |");
         System.out.println("+------------------+");
         for(IElement element : iCollection.getElements())
         {
            System.out.println("   ["+element.getKey()+"] ["+element.getLabel()+"]");
         }
      }
   }
   /** Sample code to show how to build EDMO list of key label for HMI
    * 
    * @throws VocabularyException 
    */
   private static void populateEDMO(ArrayList edmos)
   {
      System.out.println("+-------------------+");
      System.out.println("| HMI LIST FOR EDMO |");
      System.out.println("+-------------------+");
      for(CitRespParty edmo : edmos)
      {
         System.out.println("   ["+
                            edmo.getRpOrgName().getSDNIdent4rpOrgName().getValue()+
                            "] ["+
                            edmo.getRpOrgName().getContent()+"]");
      }
   }
   
   /** Sample code to show how to build EDMERP list of key label for HMI
    * 
    * @throws VocabularyException 
    */
   private static void populateEDMERP(ArrayList edmerps)
   {
      System.out.println("+---------------------+");
      System.out.println("| HMI LIST FOR EDMERP |");
      System.out.println("+---------------------+");      
      for(Gmdkeyword4project edmerp : edmerps)
      {
         System.out.println("   ["+
                            edmerp.getSdnSDN_EDMERPCode().getCodeListValue().getValue()+
                            "] ["+
                            edmerp.getSdnSDN_EDMERPCode().getContent()+"]");
      }
   }
   
   private static ArrayList loadEDMERP(String country) throws ParserConfigurationException, SAXException, IOException, XPathExpressionException, ISOException
   {
      ArrayList gmdkeyword4projects = new ArrayList<>();
      String reference = "EDMERP";
      int version = -1;
      
      Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(ListUpdater.getCurrentLocalFileName(SDN, reference, version));
      XPath xpath = XPathFactory.newInstance().newXPath();
      Node root = (Node) xpath.evaluate(ListUpdater.getXpath(SDN, reference, version), document, XPathConstants.NODE);
      if(root == null)
      {
          throw new ISOException("vocabulary "+ListUpdater.getListName(SDN, reference, version)+" ERROR");
      }
      int nbChilds = root.getChildNodes().getLength();
      String nodeName = null;
      for(int i=0;i < nbChilds;i++)
      {
         nodeName = root.getChildNodes().item(i).getNodeName();
         if(!nodeName.startsWith("#"))
         {
            if(nodeName.compareTo(Keyword.keyword) == 0)
            {
               Keyword  keyword = new Keyword();                     
               keyword.set(root.getChildNodes().item(i));             
               if(country == null ||
                  country.length() == 0 ||
                  EdmerpSimpleListHandler.getCountryFromContent(keyword.getContent()).compareTo(country) == 0)
               {
                  Gmdkeyword4project gmdkeyword4project = new Gmdkeyword4project();
                  Cdi19139.initGmdkeyword4project(gmdkeyword4project); // common to CDI and CSR
                  gmdkeyword4project.getSdnSDN_EDMERPCode().getCodeListValue().setValue(keyword.getSDNIdent4keyword().getValue());
                  gmdkeyword4project.getSdnSDN_EDMERPCode().setContent(keyword.getContent());
                  gmdkeyword4projects.add(gmdkeyword4project);
               }                                                           
            }
         }
      }
      return gmdkeyword4projects;
   }
   
   
   /** Getter for EDMO informations
    * 
    * @param country contry filter ("FR","EN ...)
    * @return
    * @throws VocabularyException
    * @throws ParserConfigurationException
    * @throws SAXException
    * @throws IOException
    * @throws ISOException
    * @throws XPathExpressionException 
    */
   private static ArrayList loadEDMO(String country) throws VocabularyException, ParserConfigurationException, SAXException, IOException, ISOException, XPathExpressionException
   {
      ArrayList citRespPartys = new ArrayList<>();
      CitRespPartyComparator citRespPartyComparator = new CitRespPartyComparator(CitRespPartyComparator.TYPE.LABEL);
      String reference = "EDMO";
      int version = -1;
      Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(ListUpdater.getCurrentLocalFileName(Collection.SDN, reference, version));
      XPath xpath = XPathFactory.newInstance().newXPath();
      Node root = (Node) xpath.evaluate(ListUpdater.getXpath(SDN, reference, version), document, XPathConstants.NODE);
      if(root == null)
      {
          throw new ISOException("vocabulary "+ListUpdater.getListName(SDN, reference, version)+" ERROR");
      }
      int nbChilds = root.getChildNodes().getLength();
      String nodeName = null;
      for(int i=0;i < nbChilds;i++)
      {
         nodeName = root.getChildNodes().item(i).getNodeName();
         if(!nodeName.startsWith("#"))
         {
            if(nodeName.compareTo(CitRespParty.citRespParty) == 0)
            {
               CitRespParty  citRespParty = new CitRespParty();
               citRespParty.set(root.getChildNodes().item(i));                                                                    
               if(country == null ||
                  country.length() == 0 ||
                  country.compareTo(citRespParty.
                                         getRpCntInfo().
                                         getCntAddress().
                                         getCountry().
                                         getContent()) == 0)
               {
                  citRespPartys.add(citRespParty);
               }
            }
         }
      }
      Collections.sort(citRespPartys,citRespPartyComparator);
      return citRespPartys;      
   }
   
   /** Java main method, Builds the CSR sample file
    * 
    * @param args the command line arguments
    */
   public static void main(String[] args)
   {      
      try
      {
         String key;
         String label;
         SimpleDateFormat sysdateFormat = new SimpleDateFormat("yyyy-MM-dd");
         // +------------------------+
         // | INITIALIZE ENVIRONMENT |
         // +------------------------+                           
         Language.newInstance("LOCAL_DIRECTORY/languages/English.xml",Locale.US);
         Conf.newInstance("LOCAL_DIRECTORY/conf");
         MdHrLvNameFinder.newInstance(Collection.SDN,"L23",-1);        
         CollectionFactory.newInstance(new File("LOCAL_DIRECTORY/lists"));
         VocabularyUpdater.setHomeList("LOCAL_DIRECTORY/lists");
                  
         // +---------------------------------------------+
         // | UPDATE VOCABULARIES USED IN CSR (FROM BODC) |
         // +---------------------------------------------+
         String vocabList[] = {"L21","C38","C32","C17","L06","C19","P02","L05","L08","C77","L18"};
         CollectionFactory.getInstance().loadCollections(true, vocabList);
         
         // +--------------------------------------+
         // | UPDATE EDMO USED IN CSR (FROM MARIS) |
         // +--------------------------------------+
         long now  = System.currentTimeMillis();
         long last = CollectionFactory.getInstance().getLocalDirectory().toPath().resolve("SDN.EDMO...xml").toFile().lastModified();
         if(now-last >= 86400000) // one day old ore more
         {
            EdmoUpdater edmoUpdater = new EdmoUpdater();
            Version edmoVersion = new Version();
            edmoVersion.setTitle(edmoUpdater.getTitle(Collection.SDN, "EDMO"));
            edmoUpdater.download(Collection.SDN, "EDMO", edmoVersion, edmoVersion);
         }
         
         // +----------------------------------------+
         // | UPDATE EDMERP USED IN CSR (FROM MARIS) |
         // +----------------------------------------+
         now  = System.currentTimeMillis();
         last = CollectionFactory.getInstance().getLocalDirectory().toPath().resolve("SDN.EDMERP...xml").toFile().lastModified();
         if(now-last >= 86400000) // one day old ore more
         {
            EdmerpUpdater edmerpUpdater = new EdmerpUpdater();
            Version edmerpVersion = new Version();
            edmerpVersion.setTitle(edmerpUpdater.getTitle(Collection.SDN, "EDMERP"));
            edmerpUpdater.download(Collection.SDN, "EDMERP", edmerpVersion, edmerpVersion);
         }
         
         // +------------------------------------+
         // | LAOD EDMO AND EDMERP LIST IN ARRAY |
         // +------------------------------------+
         // loadEDMO(null) for full EDMO list
         ArrayList edmos = loadEDMO(getLabel("C32","FR"));
         // loadEDMERP(null) for full EDMERP list
         ArrayList edmerps = loadEDMERP(getLabel("C32","FR"));
         
         // +--------------+
         // | POPULATE HMI |
         // +--------------+
         populateBODC(vocabList);
         populateEDMO(edmos);
         populateEDMERP(edmerps);
         
         // +-------------------------+
         // | BUILD XML CSR IN MEMORY |
         // +-------------------------+
         MetadataCsrIso19139 csr = new MetadataCsrIso19139();
         Csr19139.initMetadata(csr);
         Csr19139.useAsLibrary(csr);
         
         
         // +---------------+
         // | CURRENT DATE  |
         // +---------------+                          
         csr.getGmddateStamp().getGcoDate().setContent(sysdateFormat.format(new Date()));         
         
         // +------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC :$=[FI351994800010] (CSR identifier) MAIN QUERY / MANDATORY |
         // +------------------------------------------------------------------------------+                 
         csr.getGmdfileIdentifier().
             getGcoCharacterString().
             setContent(Csr19139.URNSDNCSRLOCAL+"FI351994800010");
         
         // +----------------------------------------------------------------+
         // | MIKADO AUTOMATIC var01=[486] Collate Center SINGLE / MANDATORY |
         // +----------------------------------------------------------------+
         // KEY in EDMO List
         key = "486";
         GmdCI_ResponsibleParty gcirp = RpOrgNameRpCntInfoRoleEditor.getGmdCI_ResponsibleParty(getEdmo(edmos, key));
         // set role here
         Cdi19139.initGmdCI_ResponsibleParty(gcirp, XmlGenerator.POINTOFCONTACT);
         csr.getGmdcontact().
             setGmdCI_ResponsibleParty(gcirp);
         
         // +------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var02=[CITHER 2 LEG 1] Cruise Name SINGLE / MANDATORY |
         // +------------------------------------------------------------------------+
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdcitation().
             getGmdCI_Citation4gmdcitation().
             getGmdtitle().
             getGcoCharacterString().
             setContent("CITHER 2 LEG 1");
         
         // +----------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var03=[FI351994800010] Cruise id SINGLE / MANDATORY |
         // +----------------------------------------------------------------------+
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdcitation().
             getGmdCI_Citation4gmdcitation().
             getGmdalternateTitle().
             getGcoCharacterString().
             setContent("FI351994800010");
         
         // +----------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var04=[1996-11-04] Revision date SINGLE / MANDATORY |
         // +----------------------------------------------------------------------+
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdcitation().
             getGmdCI_Citation4gmdcitation().
             getGmddate4gmdCI_Date().
             getGmdCI_Date().
             getGmddate().
             getGcoDate().
             setContent("1996-11-04");
         
         // +--------------------------------------------------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var08=[This series comprises a set of datasets acquired during the cruise.] abstract SINGLE / MANDATORY |
         // +--------------------------------------------------------------------------------------------------------------------------+
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdabstract().
             getGcoCharacterString4editor().
             setContent("This is an example provided to describe SeaDataNet XML V1 for CSR. The included information is provided only to illustrate the XML structure and all possibilities. ");
         
         // +---------------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var09=[FI351994800010.gml] Track chart - File Name SINGLE / OPTIONAL |
         // +---------------------------------------------------------------------------------------+
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdgraphicOverview().
             getGmdMD_BrowseGraphic().
             getGmdfileName().
             getGcoCharacterString4gmdfileName().
             setContent("FI351994800010.gml");
         
         // +------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var11=[GML] Track chart - File Type SINGLE / OPTIONAL |
         // +------------------------------------------------------------------------+
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdgraphicOverview().
             getGmdMD_BrowseGraphic().
             getGmdfileType().
             getGcoCharacterString4gmdfileType().
             setContent("GML");
         
         // +---------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var12=[BSH176] Port of departure SINGLE / OPTIONAL |
         // +---------------------------------------------------------------------+
         // KEY in C38 List
         key = "BSH176";
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4departure_place().
             getGmdMD_Keywords4sdnSDN_PortCode().
             getGmdkeyword4sdnSDN_PortCode().
             getSdnSDN_PortCode().
             getCodeListValue().
             setValue(key);         
         // LABEL in C38 List
         label = getLabel("C38", key);
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4departure_place().
             getGmdMD_Keywords4sdnSDN_PortCode().
             getGmdkeyword4sdnSDN_PortCode().
             getSdnSDN_PortCode().
             setContent(label);
         
         // +------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var13=[BSH185] Port of return SINGLE / OPTIONAL |
         // +------------------------------------------------------------------+
         // KEY in C38 List
         key = "BSH185";
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4arrival_place().
             getGmdMD_Keywords4sdnSDN_PortCode().
             getGmdkeyword4sdnSDN_PortCode().
             getSdnSDN_PortCode().
             getCodeListValue().
             setValue(key);
         // LABEL in C38 List
         label = getLabel("C38", key);
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4arrival_place().
             getGmdMD_Keywords4sdnSDN_PortCode().
             getGmdkeyword4sdnSDN_PortCode().
             getSdnSDN_PortCode().
             setContent(label);
         
         // +--------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var14=[BR] country of departure SINGLE / OPTIONAL |
         // +--------------------------------------------------------------------+
         // KEY in C32 List
         key = "BR";
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4departure_country().
             getGmdMD_Keywords4sdnSDN_CountryCode().
             getGmdkeyword4sdnSDN_CountryCode().
             getSdnSDN_CountryCode().
             getCodeListValue4sdnSDN_CountryCode().
             setValue(key);
         // LABEL in C32 List
         label = getLabel("C32", key);
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4departure_country().
             getGmdMD_Keywords4sdnSDN_CountryCode().
             getGmdkeyword4sdnSDN_CountryCode().
             getSdnSDN_CountryCode().
             setContent(label);
         
         // +-----------------------------------------------------------------+
         // | MIKADO AUTOMATIC var15=[BR] country of return SINGLE / OPTIONAL |
         // +-----------------------------------------------------------------+
         // KEY in C32 List
         key = "BR";
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4arrival_country().
             getGmdMD_Keywords4sdnSDN_CountryCode().
             getGmdkeyword4sdnSDN_CountryCode().
             getSdnSDN_CountryCode().
             getCodeListValue4sdnSDN_CountryCode().
             setValue("BR");
         // LABEL in C32 List
         label = getLabel("C32", key);
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4arrival_country().
             getGmdMD_Keywords4sdnSDN_CountryCode().
             getGmdkeyword4sdnSDN_CountryCode().
             getSdnSDN_CountryCode().
             setContent(label);
                  
         // +--------------------------------------------------------------+
         // | MIKADO AUTOMATIC var16=[3230] Ship - code SINGLE / MANDATORY |
         // +--------------------------------------------------------------+
         // KEY in C17 List
         key = "3230";         
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4platform().
             getGmdMD_Keywords4sdnSDN_PlatformCode().
             getGmdkeyword4sdnSDN_PlatformCode().
             getSdnSDN_PlatformCode().
             getCodeListValue().
             setValue(key);
         // LABEL in C17 List
         label = getLabel("C17", key);
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4platform().
             getGmdMD_Keywords4sdnSDN_PlatformCode().
             getGmdkeyword4sdnSDN_PlatformCode().
             getSdnSDN_PlatformCode().
             setContent(label);
         
         // +----------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var17=[31] Ship - platform class SINGLE / MANDATORY |
         // +----------------------------------------------------------------------+
         // KEY in L06 List
         key = "31";
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4platform_class().
             getGmdMD_Keywords4platform_class().
             getGmdkeyword4platform_class().
             getSdnSDN_PlatformCategoryCode().
             getCodeListValue().
             setValue(key);
         // LABEL in L06 List
         label = getLabel("L06", key);
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4platform_class().
             getGmdMD_Keywords4platform_class().
             getGmdkeyword4platform_class().
             getSdnSDN_PlatformCategoryCode().
             setContent(label);
         
         // +-------------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var24=[1994-01-04T00:00:00] Cruise - start date SINGLE / MANDATORY |
         // +-------------------------------------------------------------------------------------+
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdextent4gmdEX_GeographicDescription().
             getGmdEX_Extent4gmdEX_GeographicDescription().
             getGmdtemporalElement().
             getGmdEX_TemporalExtent().
             getGmdextent4gmlTimePeriod().
             getGmlTimePeriod().
             getGmlbeginPosition().
             setContent("1994-01-04T00:00:00");
         
         // +-----------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var25=[1994-02-13T00:00:00] Cruise - end date SINGLE / MANDATORY |
         // +-----------------------------------------------------------------------------------+
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdextent4gmdEX_GeographicDescription().
             getGmdEX_Extent4gmdEX_GeographicDescription().
             getGmdtemporalElement().
             getGmdEX_TemporalExtent().
             getGmdextent4gmlTimePeriod().
             getGmlTimePeriod().
             getGmlendPosition().
             setContent("1994-02-13T00:00:00");
         
         // +-------------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var05=[Laurent MEMERY] Chief scientist - name MULTIPLE / MANDATORY |
         // | MIKADO AUTOMATIC var06=[1046] Chief scientist - laboratory MULTIPLE / MANDATORY     |
         // | MIKADO AUTOMATIC var05=[Michel ARHAN] Chief scientist - name MULTIPLE / MANDATORY   |
         // | MIKADO AUTOMATIC var06=[487] Chief scientist - laboratory MULTIPLE / MANDATORY      |
         // +-------------------------------------------------------------------------------------+
         // create point of contact
         GmdpointOfContact4gmdindividualName gocn = new GmdpointOfContact4gmdindividualName();         
         key = "1046";
         // 1) set laboratory
         gocn.setGmdCI_ResponsibleParty4gmdindividualName(RpOrgNameRpCntInfoRoleEditor.getGmdCI_ResponsibleParty4gmdindividualName(getEdmo(edmos, key)));
         // 2) set Chief scientist
         gocn.getGmdCI_ResponsibleParty4gmdindividualName().
              getGmdindividualName().
              getGcoCharacterString4gmdindividualName().
              setContent("Laurent MEMERY");         
         // 3) set role
         Cdi19139.initGmdCI_ResponsibleParty4gmdindividualName(gocn.getGmdCI_ResponsibleParty4gmdindividualName(),XmlGenerator.POINTOFCONTACT);
         // add point of contact
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdpointOfContact4gmdindividualNames().
             add(gocn);
         
         // create point of contact
         gocn = new GmdpointOfContact4gmdindividualName();         
         key = "487";
         // 1) set laboratory
         gocn.setGmdCI_ResponsibleParty4gmdindividualName(RpOrgNameRpCntInfoRoleEditor.getGmdCI_ResponsibleParty4gmdindividualName(getEdmo(edmos, key)));
         // 2) set Chief scientist
         gocn.getGmdCI_ResponsibleParty4gmdindividualName().
              getGmdindividualName().
              getGcoCharacterString4gmdindividualName().
              setContent("Michel ARHAN");         
         // 3) set role
         Cdi19139.initGmdCI_ResponsibleParty4gmdindividualName(gocn.getGmdCI_ResponsibleParty4gmdindividualName(),XmlGenerator.POINTOFCONTACT);
         // add point of contact
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdpointOfContact4gmdindividualNames().
             add(gocn);
         
         
         // +---------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var07=[494] Originator - laboratory MULTIPLE / MANDATORY |
         // | MIKADO AUTOMATIC var07=[487] Originator - laboratory MULTIPLE / MANDATORY |
         // +---------------------------------------------------------------------------+
         // create originator
         GmdcitedResponsibleParty grp = new GmdcitedResponsibleParty();
         key = "494";         
         gcirp = RpOrgNameRpCntInfoRoleEditor.getGmdCI_ResponsibleParty(getEdmo(edmos, key));
         // set role here
         Cdi19139.initGmdCI_ResponsibleParty(gcirp, XmlGenerator.ORIGINATOR);
         grp.setGmdCI_ResponsibleParty(gcirp);
         // add originator         
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdcitation().
             getGmdCI_Citation4gmdcitation().
             getGmdcitedResponsiblePartys().
             add(grp);

         
         // create originator
         grp = new GmdcitedResponsibleParty();
         key = "487";         
         gcirp = RpOrgNameRpCntInfoRoleEditor.getGmdCI_ResponsibleParty(getEdmo(edmos, key));
         // set role here
         Cdi19139.initGmdCI_ResponsibleParty(gcirp, XmlGenerator.ORIGINATOR);
         grp.setGmdCI_ResponsibleParty(gcirp);
         // add originator         
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdcitation().
             getGmdCI_Citation4gmdcitation().
             getGmdcitedResponsiblePartys().
             add(grp);
                  
         // +-----------------------------------------------------------+
         // | MIKADO AUTOMATIC var18=[9582] Project MULTIPLE / OPTIONAL |
         // +-----------------------------------------------------------+
         // KEY in EDMERP List
         key="9582";   
         // add project
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4project().
             getGmdMD_Keywords4project().
             getGmdkeyword4projects().
             add(getEdmerp(edmerps, key));         
         
         // +---------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var19=[4] General ocean areas MULTIPLE / MANDATORY |
         // +---------------------------------------------------------------------+
         // create General ocean areas
         Gmdkeyword4sdnSDN_WaterBodyCode gsdnwbc = new Gmdkeyword4sdnSDN_WaterBodyCode();
         Csr19139.initGmdkeyword4sdnSDN_WaterBodyCode(gsdnwbc);
         // KEY in C19 List
         key="4"; 
         gsdnwbc.getSdnSDN_WaterBodyCode().getCodeListValue().setValue(key);
         // LABEL in C19 List
         label = getLabel("C19", key);
         gsdnwbc.getSdnSDN_WaterBodyCode().setContent(label);
         
         // add General ocean areas
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4place().
             getGmdMD_Keywords4sdnSDN_WaterBodyCode().
             getGmdkeyword4sdnSDN_WaterBodyCodes().
             add(gsdnwbc);
                                    
         // +--------------------------------------------------------------------------------+
         // |MIKADO AUTOMATIC var20=  [4] Geographic coverage - marsden MULTIPLE / OPTIONAL  |
         // |MIKADO AUTOMATIC var20=  [5] Geographic coverage - marsden MULTIPLE / OPTIONAL  |
         // |MIKADO AUTOMATIC var20=[304] Geographic coverage - marsden MULTIPLE / OPTIONAL  |
         // |MIKADO AUTOMATIC var20=[303] Geographic coverage - marsden MULTIPLE / OPTIONAL  |
         // |MIKADO AUTOMATIC var20=[302] Geographic coverage - marsden MULTIPLE / OPTIONAL  |
         // |MIKADO AUTOMATIC var20=[339] Geographic coverage - marsden MULTIPLE / OPTIONAL  |
         // |MIKADO AUTOMATIC var20=[338] Geographic coverage - marsden MULTIPLE / OPTIONAL  |
         // |MIKADO AUTOMATIC var20=[374] Geographic coverage - marsden MULTIPLE / OPTIONAL  |
         // |MIKADO AUTOMATIC var20=[375] Geographic coverage - marsden MULTIPLE / OPTIONAL  |
         // |MIKADO AUTOMATIC var20=[376] Geographic coverage - marsden MULTIPLE / OPTIONAL  |         
         // +--------------------------------------------------------------------------------+
         Gmdkeyword4sdnSDN_MarsdenCode gsdnmc;
         
         // add marsden 4
         key="4";
         gsdnmc = new Gmdkeyword4sdnSDN_MarsdenCode();
         Csr19139.initGmdkeyword4sdnSDN_MarsdenCode(gsdnmc);
         gsdnmc.getSdnSDN_MarsdenCode().getCodeListValue().setValue(key);
         gsdnmc.getSdnSDN_MarsdenCode().setContent(key);                  
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4marsden_square().
             getGmdMD_Keywords4sdnSDN_MarsdenCode().
             getGmdkeyword4sdnSDN_MarsdenCodes().
             add(gsdnmc);
         
         // add marsden 5
         key="5";
         gsdnmc = new Gmdkeyword4sdnSDN_MarsdenCode();
         Csr19139.initGmdkeyword4sdnSDN_MarsdenCode(gsdnmc);
         gsdnmc.getSdnSDN_MarsdenCode().getCodeListValue().setValue(key);         
         gsdnmc.getSdnSDN_MarsdenCode().setContent(key);                  
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4marsden_square().
             getGmdMD_Keywords4sdnSDN_MarsdenCode().
             getGmdkeyword4sdnSDN_MarsdenCodes().
             add(gsdnmc);
         
         // add marsden 304
         key="304";
         gsdnmc = new Gmdkeyword4sdnSDN_MarsdenCode();
         Csr19139.initGmdkeyword4sdnSDN_MarsdenCode(gsdnmc);
         gsdnmc.getSdnSDN_MarsdenCode().getCodeListValue().setValue(key);         
         gsdnmc.getSdnSDN_MarsdenCode().setContent(key);                  
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4marsden_square().
             getGmdMD_Keywords4sdnSDN_MarsdenCode().
             getGmdkeyword4sdnSDN_MarsdenCodes().
             add(gsdnmc);
         
         // add marsden 304
         key="303";
         gsdnmc = new Gmdkeyword4sdnSDN_MarsdenCode();
         Csr19139.initGmdkeyword4sdnSDN_MarsdenCode(gsdnmc);
         gsdnmc.getSdnSDN_MarsdenCode().getCodeListValue().setValue(key);         
         gsdnmc.getSdnSDN_MarsdenCode().setContent(key);                  
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4marsden_square().
             getGmdMD_Keywords4sdnSDN_MarsdenCode().
             getGmdkeyword4sdnSDN_MarsdenCodes().
             add(gsdnmc);
         
         // add marsden 302
         key="302";
         gsdnmc = new Gmdkeyword4sdnSDN_MarsdenCode();
         Csr19139.initGmdkeyword4sdnSDN_MarsdenCode(gsdnmc);
         gsdnmc.getSdnSDN_MarsdenCode().getCodeListValue().setValue(key);         
         gsdnmc.getSdnSDN_MarsdenCode().setContent(key);                  
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4marsden_square().
             getGmdMD_Keywords4sdnSDN_MarsdenCode().
             getGmdkeyword4sdnSDN_MarsdenCodes().
             add(gsdnmc);
         
         // add marsden 339
         key="339";
         gsdnmc = new Gmdkeyword4sdnSDN_MarsdenCode();
         Csr19139.initGmdkeyword4sdnSDN_MarsdenCode(gsdnmc);
         gsdnmc.getSdnSDN_MarsdenCode().getCodeListValue().setValue(key);         
         gsdnmc.getSdnSDN_MarsdenCode().setContent(key);                  
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4marsden_square().
             getGmdMD_Keywords4sdnSDN_MarsdenCode().
             getGmdkeyword4sdnSDN_MarsdenCodes().
             add(gsdnmc);
         
         // add marsden 338
         key="338";
         gsdnmc = new Gmdkeyword4sdnSDN_MarsdenCode();
         Csr19139.initGmdkeyword4sdnSDN_MarsdenCode(gsdnmc);
         gsdnmc.getSdnSDN_MarsdenCode().getCodeListValue().setValue(key);         
         gsdnmc.getSdnSDN_MarsdenCode().setContent(key);                  
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4marsden_square().
             getGmdMD_Keywords4sdnSDN_MarsdenCode().
             getGmdkeyword4sdnSDN_MarsdenCodes().
             add(gsdnmc);
         
         // add marsden 374
         key="374";
         gsdnmc = new Gmdkeyword4sdnSDN_MarsdenCode();
         Csr19139.initGmdkeyword4sdnSDN_MarsdenCode(gsdnmc);
         gsdnmc.getSdnSDN_MarsdenCode().getCodeListValue().setValue(key);         
         gsdnmc.getSdnSDN_MarsdenCode().setContent(key);                  
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4marsden_square().
             getGmdMD_Keywords4sdnSDN_MarsdenCode().
             getGmdkeyword4sdnSDN_MarsdenCodes().
             add(gsdnmc);
         
         // add marsden 375
         key="375";
         gsdnmc = new Gmdkeyword4sdnSDN_MarsdenCode();
         Csr19139.initGmdkeyword4sdnSDN_MarsdenCode(gsdnmc);
         gsdnmc.getSdnSDN_MarsdenCode().getCodeListValue().setValue(key);         
         gsdnmc.getSdnSDN_MarsdenCode().setContent(key);                  
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4marsden_square().
             getGmdMD_Keywords4sdnSDN_MarsdenCode().
             getGmdkeyword4sdnSDN_MarsdenCodes().
             add(gsdnmc);

         // add marsden 376
         key="376";
         gsdnmc = new Gmdkeyword4sdnSDN_MarsdenCode();
         Csr19139.initGmdkeyword4sdnSDN_MarsdenCode(gsdnmc);
         gsdnmc.getSdnSDN_MarsdenCode().getCodeListValue().setValue(key);         
         gsdnmc.getSdnSDN_MarsdenCode().setContent(key);                  
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4marsden_square().
             getGmdMD_Keywords4sdnSDN_MarsdenCode().
             getGmdkeyword4sdnSDN_MarsdenCodes().
             add(gsdnmc);
         
         // +--------------------------------------------------------------+
         // | MIKADO AUTOMATIC var21=[TEMP] Parameters MULTIPLE / OPTIONAL |
         // | MIKADO AUTOMATIC var21=[PSAL] Parameters MULTIPLE / OPTIONAL |
         // | MIKADO AUTOMATIC var21=[TSED] Parameters MULTIPLE / OPTIONAL |
         // +--------------------------------------------------------------+
         Gmdkeyword4parameter gmdkeyword4parameter;
         
         // create parameter
         // KEY in P02 List
         key="TEMP";
         gmdkeyword4parameter = new Gmdkeyword4parameter();
         Cdi19139.initGmdkeyword4parameter(gmdkeyword4parameter); // common to CDI and CSR
         gmdkeyword4parameter.getSdnSDN_ParameterDiscoveryCode().getCodeListValue().setValue(key);
         // LABEL in P02 List
         label = getLabel("P02", key);
         gmdkeyword4parameter.getSdnSDN_ParameterDiscoveryCode().setContent(label);
         // add parameter
         csr.getGmdidentificationInfo4csr().
                                    getSdnSDN_DataIdentification4csr().
                                    getGmddescriptiveKeywords4parameter().
                                    getGmdMD_Keywords4parameter().
                                    getGmdkeyword4parameters().
                                    add(gmdkeyword4parameter);
         
         // create parameter
         // KEY in P02 List
         key="PSAL";
         gmdkeyword4parameter = new Gmdkeyword4parameter();
         Cdi19139.initGmdkeyword4parameter(gmdkeyword4parameter); // common to CDI and CSR
         gmdkeyword4parameter.getSdnSDN_ParameterDiscoveryCode().getCodeListValue().setValue(key);
         // LABEL in P02 List
         label = getLabel("P02", key);
         gmdkeyword4parameter.getSdnSDN_ParameterDiscoveryCode().setContent(label);
         // add parameter
         csr.getGmdidentificationInfo4csr().
                                    getSdnSDN_DataIdentification4csr().
                                    getGmddescriptiveKeywords4parameter().
                                    getGmdMD_Keywords4parameter().
                                    getGmdkeyword4parameters().
                                    add(gmdkeyword4parameter);
         
         // create parameter
         // KEY in P02 List
         key="TSED";
         gmdkeyword4parameter = new Gmdkeyword4parameter();
         Cdi19139.initGmdkeyword4parameter(gmdkeyword4parameter); // common to CDI and CSR
         gmdkeyword4parameter.getSdnSDN_ParameterDiscoveryCode().getCodeListValue().setValue(key);
         // LABEL in P02 List
         label = getLabel("P02", key);
         gmdkeyword4parameter.getSdnSDN_ParameterDiscoveryCode().setContent(label);
         // add parameter
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4parameter().
             getGmdMD_Keywords4parameter().
             getGmdkeyword4parameters().
             add(gmdkeyword4parameter);
         
         // +--------------------------------------------------------------+
         // | MIKADO AUTOMATIC var22=[130] Instruments MULTIPLE / OPTIONAL |
         // | MIKADO AUTOMATIC var22=[30] Instruments MULTIPLE / OPTIONAL  |
         // +--------------------------------------------------------------+
         Gmdkeyword4instrument gmdkeyword4instrument;
         // create instrument
         // KEY in L05 List
         key="130";
         gmdkeyword4instrument = new Gmdkeyword4instrument();
         Cdi19139.initGmdkeyword4instrument(gmdkeyword4instrument); // common to CDI and CSR
         gmdkeyword4instrument.getSdnSDN_DeviceCategoryCode().getCodeListValue().setValue(key);
         // LABEL in P02 List
         label = getLabel("L05", key);
         gmdkeyword4instrument.getSdnSDN_DeviceCategoryCode().setContent(label);
         // add parameter
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4instrument().
             getGmdMD_Keywords4instrument().
             getGmdkeyword4instruments().
             add(gmdkeyword4instrument);
         
         // create instrument
         // KEY in L05 List
         key="30";
         gmdkeyword4instrument = new Gmdkeyword4instrument();
         Cdi19139.initGmdkeyword4instrument(gmdkeyword4instrument); // common to CDI and CSR
         gmdkeyword4instrument.getSdnSDN_DeviceCategoryCode().getCodeListValue().setValue(key);
         // LABEL in L05 List
         label = getLabel("L05", key);
         gmdkeyword4instrument.getSdnSDN_DeviceCategoryCode().setContent(label);
         // add parameter
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmddescriptiveKeywords4instrument().
             getGmdMD_Keywords4instrument().
             getGmdkeyword4instruments().
             add(gmdkeyword4instrument);
         
         // +---------------------------------------------------------------+
         // | MIKADO AUTOMATIC var23=[UN] Availability MULTIPLE / MANDATORY |
         // | MIKADO AUTOMATIC var23=[LS] Availability MULTIPLE / MANDATORY |
         // +---------------------------------------------------------------+
         GmdresourceConstraints gmdresourceConstraints;
         // create constraint
         // KEY in L08 List
         key="UN";         
         gmdresourceConstraints = new GmdresourceConstraints();
         Cdi19139.initGmdresourceConstraints(gmdresourceConstraints);
         gmdresourceConstraints.getGmdMD_LegalConstraints().
                                getGmdotherConstraints().
                                getGmxAnchor().
                                getXlinkhref().
                                setValue(XmlGenerator.URN_RESOLVER+Element.getUnversionedKey("L08",key));
         // LABEL in L08 List
         label = getLabel("L08", key);
         gmdresourceConstraints.getGmdMD_LegalConstraints().
                                       getGmdotherConstraints().
                                       getGmxAnchor().                                       
                                       setContent(label);
         // add constraint
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdresourceConstraintss().
             add(gmdresourceConstraints);
         
         // create constraint
         // KEY in L08 List
         key="LS";         
         gmdresourceConstraints = new GmdresourceConstraints();
         Cdi19139.initGmdresourceConstraints(gmdresourceConstraints);
         gmdresourceConstraints.getGmdMD_LegalConstraints().
                                getGmdotherConstraints().
                                getGmxAnchor().
                                getXlinkhref().
                                setValue(XmlGenerator.URN_RESOLVER+Element.getUnversionedKey("L08",key));
         // LABEL in L08 List
         label = getLabel("L08", key);
         gmdresourceConstraints.getGmdMD_LegalConstraints().
                                       getGmdotherConstraints().
                                       getGmxAnchor().                                       
                                       setContent(label);
         // add constraint
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdresourceConstraintss().
             add(gmdresourceConstraints);
         
         
         // +------------------------------------------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var26=[South Atlantic Ocean, Brasil ] Specific geographic areas MULTIPLE / OPTIONAL             |
         // | MIKADO AUTOMATIC var26=[South Atlantic Ocean, Inter-tropical Area] Specific geographic areas MULTIPLE / OPTIONAL |
         // +------------------------------------------------------------------------------------------------------------------+
         GmdgeographicElement4gmdEX_GeographicDescription geexgd;
         // create area
         geexgd = new GmdgeographicElement4gmdEX_GeographicDescription();
         geexgd.getGmdEX_GeographicDescription().
                getGmdgeographicIdentifier().
                getGmdMD_Identifier().
                getGmdcode().
                getGcoCharacterString().
                setContent("South Atlantic Ocean, Brasil");
         // add area
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdextent4gmdEX_GeographicDescription().
             getGmdEX_Extent4gmdEX_GeographicDescription().
             getGmdgeographicElement4gmdEX_GeographicDescriptions().
             add(geexgd);
         
         // create area
         geexgd = new GmdgeographicElement4gmdEX_GeographicDescription();
         geexgd.getGmdEX_GeographicDescription().
                getGmdgeographicIdentifier().
                getGmdMD_Identifier().
                getGmdcode().
                getGcoCharacterString().
                setContent("South Atlantic Ocean, Inter-tropical Area");
         // add area
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdextent4gmdEX_GeographicDescription().
             getGmdEX_Extent4gmdEX_GeographicDescription().
             getGmdgeographicElement4gmdEX_GeographicDescriptions().
             add(geexgd);
         
         // +------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var27=[-50] West longitude MULTIPLE / MANDATORY |
         // | MIKADO AUTOMATIC var28=[-40] East longitude MULTIPLE / MANDATORY |
         // | MIKADO AUTOMATIC var29=[-25] South latitude MULTIPLE / MANDATORY |
         // | MIKADO AUTOMATIC var30=[10] North latitude MULTIPLE / MANDATORY  |
         // +------------------------------------------------------------------+
         GmdgeographicElement4gmdEX_GeographicBoundingBoxes geexgbb;
         // create box
         geexgbb = new GmdgeographicElement4gmdEX_GeographicBoundingBoxes();
         geexgbb.getGmdEX_GeographicBoundingBox().
                 getGmdwestBoundLongitude().
                 getGcoDecimal4gmdwestBoundLongitude().
                 setContent("-50");
         geexgbb.getGmdEX_GeographicBoundingBox().
                 getGmdeastBoundLongitude().
                 getGcoDecimal4gmdeastBoundLongitude().
                 setContent("-40");
         geexgbb.getGmdEX_GeographicBoundingBox().
                 getGmdsouthBoundLatitude().
                 getGcoDecimal4gmdsouthBoundLatitude().
                 setContent("-25");
         geexgbb.getGmdEX_GeographicBoundingBox().
                 getGmdnorthBoundLatitude().
                 getGcoDecimal4gmdnorthBoundLatitude().
                 setContent("10");         
         // add box
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getGmdextent4gmdEX_GeographicDescription().
             getGmdEX_Extent4gmdEX_GeographicDescription().
             getGmdgeographicElement4gmdEX_GeographicBoundingBoxess().
             add(geexgbb);
         
         // +------------------------------------------------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var31=[D01] Mooring - data type MULTIPLE / OPTIONAL                                                   |
         // | MIKADO AUTOMATIC var32=[1996-11-04T00:00:00] Mooring - reference date MULTIPLE / OPTIONAL                              |
         // | MIKADO AUTOMATIC var33=[Herlé MERCIER] Mooring - principal investigator - name MULTIPLE / OPTIONAL                     |
         // | MIKADO AUTOMATIC var34=[487] Mooring - principal investigator - laboratory MULTIPLE / OPTIONAL                         |
         // | MIKADO AUTOMATIC var35=[Mooring on the Atlantic ... meters] Mooring - description MULTIPLE / OPTIONAL                  |
         // | MIKADO AUTOMATIC var36=[-38,-20] Mooring - coordinates MULTIPLE / OPTIONAL                                             |
         // |                                                                                                                        |
         // | MIKADO AUTOMATIC var31=[H72] Mooring - data type MULTIPLE / OPTIONAL                                                   |
         // | MIKADO AUTOMATIC var32=[1996-11-04T00:00:00] Mooring - reference date MULTIPLE / OPTIONAL                              |
         // | MIKADO AUTOMATIC var33=[Herlé MERCIER] Mooring - principal investigator - name MULTIPLE / OPTIONAL                     |
         // | MIKADO AUTOMATIC var34=[487] Mooring - principal investigator - laboratory MULTIPLE / OPTIONAL                         |
         // | MIKADO AUTOMATIC var35=[Mooring on the Atlantic Ridge, ... thermistor chain] Mooring - description MULTIPLE / OPTIONAL |
         // | MIKADO AUTOMATIC var36=[-38,-20] Mooring - coordinates MULTIPLE / OPTIONAL                                             |
         // +------------------------------------------------------------------------------------------------------------------------+
         Gmiobjective4moorings gmiobjective4moorings;
         // create mooring
         gmiobjective4moorings = new Gmiobjective4moorings();
         Csr19139.initGmiobjective4moorings(gmiobjective4moorings);

         // KEY in C77 List (var31=[D01])
         key="D01";
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmisensingInstrument().
                                  getGmiMI_Instrument().
                                  getGmitype4gmiMI_SensorTypeCode().
                                  getSdnSDN_DataCategoryCode().
                                  getCodeListValue().
                                  setValue(key);
         // LABEL in C77 List (var31=[D01])
         label = getLabel("C77", key);         
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmisensingInstrument().
                                  getGmiMI_Instrument().
                                  getGmitype4gmiMI_SensorTypeCode().
                                  getSdnSDN_DataCategoryCode().
                                  setContent(label);
         // var32=[1996-11-04T00:00:00]
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmiobjectiveOccurrence().
                                  getGmiMI_Event4id().
                                  getGmitime().
                                  getGcoDateTime().
                                  setContent("1996-11-04T00:00:00");
         
         // 1) set laboratory var34=[487]
         key = "487";
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                          getGmisensingInstrument().
                                          getGmiMI_Instrument().
                                          getGmimountedOn().
                                          getGmiMI_Platform().
                                          getGmisponsor().
                                          setGmdCI_ResponsibleParty4gmdindividualName(RpOrgNameRpCntInfoRoleEditor.getGmdCI_ResponsibleParty4gmdindividualName(getEdmo(edmos, key)));         
         
         // 2) set principal investigator var33=[Herlé MERCIER]
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmisensingInstrument().
                                  getGmiMI_Instrument().
                                  getGmimountedOn().
                                  getGmiMI_Platform().
                                  getGmisponsor().
                                  getGmdCI_ResponsibleParty4gmdindividualName().
                                  getGmdindividualName().
                                  getGcoCharacterString4gmdindividualName().
                                  setContent("Herlé MERCIER");
         
         // 3) set role
         Cdi19139.initGmdCI_ResponsibleParty4gmdindividualName(gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                                                                     getGmisensingInstrument().
                                                                                     getGmiMI_Instrument().
                                                                                     getGmimountedOn().
                                                                                     getGmiMI_Platform().
                                                                                     getGmisponsor().
                                                                                     getGmdCI_ResponsibleParty4gmdindividualName(),
                                                                                     XmlGenerator.PRINCIPALINVESTIGATOR);
         // var35=[Mooring on the Atlantic ... meters]
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmifunction().
                                  getGcoCharacterString4gmifunction().
                                  setContent("Mooring on the Atlantic Ridge, Romanche Canyon, current meters");
         // var36=[-38,-20]
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmiextent().
                                  getGmdEX_Extent4gmdEX_GeographicBoundingBox().
                                  getGmdgeographicElement4gmdEX_GeographicBoundingBox().
                                  getGmdEX_GeographicBoundingBox().       
                                  getGmdwestBoundLongitude().
                                  getGcoDecimal4gmdwestBoundLongitude().
                                  setContent("-38");
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmiextent().
                                  getGmdEX_Extent4gmdEX_GeographicBoundingBox().
                                  getGmdgeographicElement4gmdEX_GeographicBoundingBox().
                                  getGmdEX_GeographicBoundingBox().
                                  getGmdnorthBoundLatitude().
                                  getGcoDecimal4gmdnorthBoundLatitude().
                                  setContent("-20");
         // add mooring
         csr.getGmiacquisitionInformation().
             getGmiMI_AcquisitionInformation().
             getGmiobjective4mooringss().add(gmiobjective4moorings);
         
         
         // create mooring
         gmiobjective4moorings = new Gmiobjective4moorings();
         Csr19139.initGmiobjective4moorings(gmiobjective4moorings);
         // KEY in C77 List (var31=[D01])
         key="H72";
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmisensingInstrument().
                                  getGmiMI_Instrument().
                                  getGmitype4gmiMI_SensorTypeCode().
                                  getSdnSDN_DataCategoryCode().
                                  getCodeListValue().
                                  setValue(key);
         // LABEL in C77 List (var31=[D01])
         label = getLabel("C77", key);         
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmisensingInstrument().
                                  getGmiMI_Instrument().
                                  getGmitype4gmiMI_SensorTypeCode().
                                  getSdnSDN_DataCategoryCode().
                                  setContent(label);
         // var32=[1996-11-04T00:00:00]
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmiobjectiveOccurrence().
                                  getGmiMI_Event4id().
                                  getGmitime().
                                  getGcoDateTime().
                                  setContent("1996-11-04T00:00:00");
         
         // 1) set laboratory var34=[487]
         key = "487";
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                          getGmisensingInstrument().
                                          getGmiMI_Instrument().
                                          getGmimountedOn().
                                          getGmiMI_Platform().
                                          getGmisponsor().
                                          setGmdCI_ResponsibleParty4gmdindividualName(RpOrgNameRpCntInfoRoleEditor.getGmdCI_ResponsibleParty4gmdindividualName(getEdmo(edmos, key)));         
         
         // 2) set principal investigator var33=[Herlé MERCIER]
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmisensingInstrument().
                                  getGmiMI_Instrument().
                                  getGmimountedOn().
                                  getGmiMI_Platform().
                                  getGmisponsor().
                                  getGmdCI_ResponsibleParty4gmdindividualName().
                                  getGmdindividualName().
                                  getGcoCharacterString4gmdindividualName().
                                  setContent("Herlé MERCIER");
         // 3) set role
         Cdi19139.initGmdCI_ResponsibleParty4gmdindividualName(gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                                                                     getGmisensingInstrument().
                                                                                     getGmiMI_Instrument().
                                                                                     getGmimountedOn().
                                                                                     getGmiMI_Platform().
                                                                                     getGmisponsor().
                                                                                     getGmdCI_ResponsibleParty4gmdindividualName(),
                                                                                     XmlGenerator.PRINCIPALINVESTIGATOR);
         
         // var35=[Mooring on the Atlantic Ridge, ... thermistor chain]
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmifunction().
                                  getGcoCharacterString4gmifunction().
                                  setContent("Mooring on the Atlantic Ridge, Romanche Canyon, thermistor chain");
         // var36=[-38,-20]
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmiextent().
                                  getGmdEX_Extent4gmdEX_GeographicBoundingBox().
                                  getGmdgeographicElement4gmdEX_GeographicBoundingBox().
                                  getGmdEX_GeographicBoundingBox().       
                                  getGmdwestBoundLongitude().
                                  getGcoDecimal4gmdwestBoundLongitude().
                                  setContent("-38");
         gmiobjective4moorings.getSdnSDN_Objective4moorings().
                                  getGmiextent().
                                  getGmdEX_Extent4gmdEX_GeographicBoundingBox().
                                  getGmdgeographicElement4gmdEX_GeographicBoundingBox().
                                  getGmdEX_GeographicBoundingBox().
                                  getGmdnorthBoundLatitude().
                                  getGcoDecimal4gmdnorthBoundLatitude().
                                  setContent("-20");
         // add mooring
         csr.getGmiacquisitionInformation().
             getGmiMI_AcquisitionInformation().
             getGmiobjective4mooringss().add(gmiobjective4moorings);
         // +------------------------------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var37=[H10] Samples - data type MULTIPLE / OPTIONAL                                 |
         // | MIKADO AUTOMATIC var38=[1996-11-04T00:00:00] Samples - reference date MULTIPLE / OPTIONAL            |
         // | MIKADO AUTOMATIC var39=[Laurent MEMERY] Samples - principal investigator - name MULTIPLE / OPTIONAL  |
         // | MIKADO AUTOMATIC var40=[1046] Samples - principal investigator - laboratory MULTIPLE / OPTIONAL      |
         // | MIKADO AUTOMATIC var41=[Neil Brown CTD casts, up to 6000m] Samples - description MULTIPLE / OPTIONAL |
         // | MIKADO AUTOMATIC var42=[CSRU001] Samples - Units MULTIPLE / OPTIONAL                                 |
         // | MIKADO AUTOMATIC var43=[44] Samples - No MULTIPLE / OPTIONAL                                         |
         // |                                                                                                      |
         // | MIKADO AUTOMATIC var37=[H09] Samples - data type MULTIPLE / OPTIONAL                                 |
         // | MIKADO AUTOMATIC var38=[1996-11-04T00:00:00] Samples - reference date MULTIPLE / OPTIONAL            |
         // | MIKADO AUTOMATIC var39=[Michel ARHAN] Samples - principal investigator - name MULTIPLE / OPTIONAL    |
         // | MIKADO AUTOMATIC var40=[487] Samples - principal investigator - laboratory MULTIPLE / OPTIONAL       |
         // | MIKADO AUTOMATIC var41=[Water bottle ... of 64 bottles] Samples - description MULTIPLE / OPTIONAL    |
         // | MIKADO AUTOMATIC var42=[CSRU001] Samples - Units MULTIPLE / OPTIONAL                                 |
         // | MIKADO AUTOMATIC var43=[40] Samples - No MULTIPLE / OPTIONAL                                         |
         // |                                                                                                      |
         // | ... G74 ... B90 ... B18                                                                              |
         // +------------------------------------------------------------------------------------------------------+
         Gmiobjective4samples gmiobjective4samples;
         
         // create sample H10
         gmiobjective4samples = new Gmiobjective4samples();
         Csr19139.initGmiobjective4samples(gmiobjective4samples);
         
         // KEY in C77 List (var37=[H10]])
         key="H10";
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmisensingInstrument().
                              getGmiMI_Instrument().
                              getGmitype4gmiMI_SensorTypeCode().
                              getSdnSDN_DataCategoryCode().
                              getCodeListValue().
                              setValue(key);
         // LABEL in C77 List (var37=[H10])
         label = getLabel("C77", key);
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmisensingInstrument().
                              getGmiMI_Instrument().
                              getGmitype4gmiMI_SensorTypeCode().
                              getSdnSDN_DataCategoryCode().
                              setContent(label);
         
         // var38=[1996-11-04T00:00:00]
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmiobjectiveOccurrence().
                              getGmiMI_Event4id().
                              getGmitime().
                              getGcoDateTime().
                              setContent("1996-11-04T00:00:00");
         
         // 1) set laboratory var40=[1046]
         key = "1046";
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmisensingInstrument().
                              getGmiMI_Instrument().
                              getGmimountedOn().
                              getGmiMI_Platform().
                              getGmisponsor().
                              setGmdCI_ResponsibleParty4gmdindividualName(RpOrgNameRpCntInfoRoleEditor.getGmdCI_ResponsibleParty4gmdindividualName(getEdmo(edmos, key)));
         
         // 2) set principal investigator var39=[Laurent MEMERY]
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmisensingInstrument().
                              getGmiMI_Instrument().
                              getGmimountedOn().
                              getGmiMI_Platform().
                              getGmisponsor().
                              getGmdCI_ResponsibleParty4gmdindividualName().
                              getGmdindividualName().
                              getGcoCharacterString4gmdindividualName().
                              setContent("Laurent MEMERY");
         // 3) set role
         Cdi19139.initGmdCI_ResponsibleParty4gmdindividualName(gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmisensingInstrument().
                              getGmiMI_Instrument().
                              getGmimountedOn().
                              getGmiMI_Platform().
                              getGmisponsor().
                              getGmdCI_ResponsibleParty4gmdindividualName(),                              
                              XmlGenerator.PRINCIPALINVESTIGATOR);
         
         // var41=[Neil Brown CTD casts, up to 6000m]
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmifunction().
                              getGcoCharacterString4gmifunction().
                              setContent("Neil Brown CTD casts, up to 6000m");
         // KEY in L18 List (var42=[CSRU001])
         key="CSRU001";         
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getSdnSDN_SamplingActivity().
                              getSdnunit().
                              getSdnSDN_CSRUnitCode().
                              getCodeListValue4sdnSDN_CSRUnitCode().
                              setValue(key);
         // LABEL in L18 List (var42=[CSRU001]])
         label = getLabel("L18", key);
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getSdnSDN_SamplingActivity().
                              getSdnunit().
                              getSdnSDN_CSRUnitCode().
                              setContent(label);
         // var43=[44]
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getSdnSDN_SamplingActivity().
                              getSdnquantity().
                              setContent("44");         
         // add sample H10
         csr.getGmiacquisitionInformation().
             getGmiMI_AcquisitionInformation().
             getGmiobjective4sampless().
             add(gmiobjective4samples);
         
         // create sample H09
         gmiobjective4samples = new Gmiobjective4samples();
         Csr19139.initGmiobjective4samples(gmiobjective4samples);
         
         // KEY in C77 List (var37=[H09]])
         key="H09";
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmisensingInstrument().
                              getGmiMI_Instrument().
                              getGmitype4gmiMI_SensorTypeCode().
                              getSdnSDN_DataCategoryCode().
                              getCodeListValue().
                              setValue(key);
         // LABEL in C77 List (var37=[H09])
         label = getLabel("C77", key);
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmisensingInstrument().
                              getGmiMI_Instrument().
                              getGmitype4gmiMI_SensorTypeCode().
                              getSdnSDN_DataCategoryCode().
                              setContent(label);
         
         // var38=[1996-11-04T00:00:00]
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmiobjectiveOccurrence().
                              getGmiMI_Event4id().
                              getGmitime().
                              getGcoDateTime().
                              setContent("1996-11-04T00:00:00");
         
         // 1) set laboratory var40=[487]
         key = "487";
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmisensingInstrument().
                              getGmiMI_Instrument().
                              getGmimountedOn().
                              getGmiMI_Platform().
                              getGmisponsor().
                              setGmdCI_ResponsibleParty4gmdindividualName(RpOrgNameRpCntInfoRoleEditor.getGmdCI_ResponsibleParty4gmdindividualName(getEdmo(edmos, key)));
         
         // 2) set principal investigator var39=[Michel ARHAN]
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmisensingInstrument().
                              getGmiMI_Instrument().
                              getGmimountedOn().
                              getGmiMI_Platform().
                              getGmisponsor().
                              getGmdCI_ResponsibleParty4gmdindividualName().
                              getGmdindividualName().
                              getGcoCharacterString4gmdindividualName().
                              setContent("Michel ARHAN");
         
         // 3) set role
         Cdi19139.initGmdCI_ResponsibleParty4gmdindividualName(gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmisensingInstrument().
                              getGmiMI_Instrument().
                              getGmimountedOn().
                              getGmiMI_Platform().
                              getGmisponsor().
                              getGmdCI_ResponsibleParty4gmdindividualName(),                              
                              XmlGenerator.PRINCIPALINVESTIGATOR);
         
         // var41=[Water bottle ... of 64 bottles]
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getGmifunction().
                              getGcoCharacterString4gmifunction().
                              setContent("Water bottle sampling, rosette of 64 bottles");
         // KEY in L18 List (var42=[CSRU001])
         key="CSRU001";         
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getSdnSDN_SamplingActivity().
                              getSdnunit().
                              getSdnSDN_CSRUnitCode().
                              getCodeListValue4sdnSDN_CSRUnitCode().
                              setValue(key);
         // LABEL in L18 List (var42=[CSRU001]])
         label = getLabel("L18", key);
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getSdnSDN_SamplingActivity().
                              getSdnunit().
                              getSdnSDN_CSRUnitCode().
                              setContent(label);
         // var43=[40]
         gmiobjective4samples.getSdnSDN_Objective4samples().
                              getSdnSDN_SamplingActivity().
                              getSdnquantity().
                              setContent("40");         
         // add sample H09
         csr.getGmiacquisitionInformation().
             getGmiMI_AcquisitionInformation().
             getGmiobjective4sampless().
             add(gmiobjective4samples);                                                                                          
         
         // create and add ... G74 ... B90 ... B18
         
         // +---------------------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var60=[This is line 1] (Curves-description) MULTIPLE / OPTIONAL            |
         // | MIKADO AUTOMATIC var62=[line1] (Curves-name) MULTIPLE / OPTIONAL                            |
         // | MIKADO AUTOMATIC var63=[-68.548849 ... 59.400296] (Curves-coordinates) MULTIPLE / OPTIONAL  |
         // | MIKADO AUTOMATIC var60=[This is line 2] (Curves-description) MULTIPLE / OPTIONAL            |
         // | MIKADO AUTOMATIC var62=[line2] (Curves-name) MULTIPLE / OPTIONAL                            |
         // | MIKADO AUTOMATIC var63=[112.963503 ... 5.916728] (Curves-coordinates) MULTIPLE / OPTIONAL   |
         // | MIKADO AUTOMATIC var60=[This is line 3] (Curves-description) MULTIPLE / OPTIONAL            |
         // | MIKADO AUTOMATIC var62=[line3] (Curves-name) MULTIPLE / OPTIONAL                            |
         // | MIKADO AUTOMATIC var63=[-76.816333 ... -57.079131] (Curves-coordinates) MULTIPLE / OPTIONAL |
         // +---------------------------------------------------------------------------------------------+         
         Csr19139Generator.addLineString(csr.getGmdidentificationInfo4csr().
                                             getSdnSDN_DataIdentification4csr().
                                             getGmdextent4gmdEX_GeographicDescription().
                                             getGmdEX_Extent4gmdEX_GeographicDescription().
                                             getGmdgeographicElement4curve().
                                             getGmdEX_BoundingPolygon4curve().
                                             getGmdpolygon4curve().
                                             getGmlMultiCurve(),
                                             1,
                                             "This is line 1",
                                             "line1",
                                             "-68.548849 73.889864 -61.408617 72.824456 -58.026401 68.136664 -56.523193 62.38344 -49.007153 59.400296");
         Csr19139Generator.addLineString(csr.getGmdidentificationInfo4csr().
                                             getSdnSDN_DataIdentification4csr().
                                             getGmdextent4gmdEX_GeographicDescription().
                                             getGmdEX_Extent4gmdEX_GeographicDescription().
                                             getGmdgeographicElement4curve().
                                             getGmdEX_BoundingPolygon4curve().
                                             getGmdpolygon4curve().
                                             getGmlMultiCurve(),
                                             2,
                                             "This is line 2",
                                             "line2",
                                             "112.963503 17.636232 114.842479 14.866168 114.842479 11.030688 111.084463 8.473704 106.574831 5.916728");
         Csr19139Generator.addLineString(csr.getGmdidentificationInfo4csr().
                                             getSdnSDN_DataIdentification4csr().
                                             getGmdextent4gmdEX_GeographicDescription().
                                             getGmdEX_Extent4gmdEX_GeographicDescription().
                                             getGmdgeographicElement4curve().
                                             getGmdEX_BoundingPolygon4curve().
                                             getGmdpolygon4curve().
                                             getGmlMultiCurve(),
                                             3,
                                             "This is line 3",
                                             "line3",
                                             "-76.816333 -36.777203 -77.192141 -43.722611 -80.198605 -47.195299 -78.319565 -50.400867 -74.561741 -54.674947 -70.052045 -57.079131");
         
         // +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
         // | MIKADO AUTOMATIC var50=[http://seadatanet.maris2.nl/isocodelists/sdncodelists/publications-Codelists.xml#SDN_PUBCode_151] (Documentation URL) {NEW} MULTIPLE / OPTIONAL |
         // +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
         SdnadditionalDocumentation sdnadditionalDocumentation;
         sdnadditionalDocumentation= new SdnadditionalDocumentation();
         sdnadditionalDocumentation.getXlinkhref().setValue("http://seadatanet.maris2.nl/isocodelists/sdncodelists/publications-Codelists.xml#SDN_PUBCode_151");
         csr.getGmdidentificationInfo4csr().
             getSdnSDN_DataIdentification4csr().
             getSdnadditionalDocumentations().
             add(sdnadditionalDocumentation);
         
         
         // +---------------------------+
         // | PRINT XML CSR FROM MEMORY |
         // +---------------------------+
         StringBuffer xmlCsr = Csr19139.getCleanXml(csr);
         System.out.println();
         System.out.println("=====================");
         System.out.println("XML BUILD FROM MEMORY");
         System.out.println("=====================");
         System.out.println(xmlCsr.toString());
         
         // +--------------------------+
         // | VALIDATE CSR FROM MEMORY |
         // +--------------------------+         
         Validator validator = Conf.getInstance().getValidator(Csr19139Generator.XSD);           
         validator.validate(new SAXSource(new InputSource(new StringReader(xmlCsr.toString()))));
         System.out.println("+--------------+");
         System.out.println("| CSR IS VALID |");
         System.out.println("+--------------+");

      }      
      catch(Exception e)
      {
         e.printStackTrace();
      }
   }
}