[GRASS-SVN] r61499 - in sandbox/krejcmat/src: . metadata templates

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 1 11:47:11 PDT 2014


Author: krejcmat
Date: 2014-08-01 11:47:11 -0700 (Fri, 01 Aug 2014)
New Revision: 61499

Added:
   sandbox/krejcmat/src/mdutil.py
   sandbox/krejcmat/src/metadata/full.xml
Modified:
   sandbox/krejcmat/src/editor3.py
   sandbox/krejcmat/src/g.gui.metadata.py
   sandbox/krejcmat/src/jinjainfo.py
   sandbox/krejcmat/src/mdgrass.py
   sandbox/krejcmat/src/templates/grassGRASSTemplateFinal.xml
   sandbox/krejcmat/src/templates/grassInspireTemplateFinal.xml
Log:
multiple editing, ctrlText validators, add datatypes to templates 

Modified: sandbox/krejcmat/src/editor3.py
===================================================================
--- sandbox/krejcmat/src/editor3.py	2014-08-01 17:47:01 UTC (rev 61498)
+++ sandbox/krejcmat/src/editor3.py	2014-08-01 18:47:11 UTC (rev 61499)
@@ -13,7 +13,7 @@
 
 from lxml import etree as ET
 import contextlib
-from wxPython._core import wxBoxSizer
+#from wxPython._core import wxBoxSizer
 
 import copy
 import re
@@ -21,10 +21,12 @@
 import string
 import logging
 from core.gcmd import RunCommand, GError, GMessage
+from gui_core.widgets import IntegerValidator, NTCValidator,SimpleValidator,\
+                            TimeISOValidator, EmailValidator,EmptyValidator
+
 import sys
-from wx.lib.analogclock.lib_setup.buttontreectrlpanel import EVT_CHANGED
+import mdutil
 
-
 #=========================================================================
 # MD blah blah
 #=========================================================================
@@ -48,14 +50,18 @@
             io1.write(str1)
             io1.close()    
             
+            #mdutil
             try:
                 tree = ET.parse(path)
                 root = tree.getroot()
                 self.md = MD_Metadata(root)
+                
                 return self.md
+                
             except  Exception, e:
                 GError('Error loading xml:\n'+str(e))
-                
+
+                           
     def _removeNonAscii(self,s): 
         s= filter(lambda x: x in string.printable, s)
         return s
@@ -88,14 +94,7 @@
         io=open(jinjaPath,'w')
         io.write(str1)
         io.close()
-        
-        #=======================================================================
-        # jinjaPath=jinjaPath.replace('.xml','A.xml')
-        # xmlN=open(jinjaPath,'w')
-        # xmlN.write(str1)
-        # xmlN.close()
-        #=======================================================================
-        #GMessage('brak')
+
         # generate xml using jinja tempaltes
         head, tail = os.path.split(jinjaPath)
         env = Environment(loader=FileSystemLoader(head))
@@ -246,64 +245,8 @@
             else:
                 mdItems.addMdItem(self.mdItem)
 
-#=========================================================================
-# VALIDATOR
-#=========================================================================
 
 
-class MyValidator(wx.PyValidator):
-
-    def __init__(self, flag=None, pyVar=None):
-        wx.PyValidator.__init__(self)
-        self.flag = flag
-        #self.Bind(wx.EVT_CHAR, self.OnChar)
-
-    def Clone(self):
-        return MyValidator(self.flag)
-
-    def Validate(self, win):
-        tc = self.GetWindow()
-        val = tc.GetValue()
-        textCtrl = self.GetWindow()
-        if self.flag == 'ALPHA_ONLY':
-            for x in val:
-                if x not in string.letters:
-                    textCtrl.SetBackgroundColour("pink")
-                    textCtrl.SetFocus()
-                    textCtrl.Refresh()
-                    return False
-
-        elif self.flag == 'DIGIT_ONLY':
-            for x in val:
-                if x not in string.digits:
-                    textCtrl.SetBackgroundColour("pink")
-                    textCtrl.SetFocus()
-                    textCtrl.Refresh()
-                    return False
-        return True
-
-    def OnChar(self, event):
-        key = event.GetKeyCode()
-
-        if key < wx.WXK_SPACE or key == wx.WXK_DELETE or key > 255:
-            event.Skip()
-            return
-
-        if self.flag == 'ALPHA_ONLY' and chr(key) in string.letters:
-            event.Skip()
-            return
-
-        if self.flag == 'DIGIT_ONLY' and chr(key) in string.digits:
-            event.Skip()
-            return
-
-        if not wx.Validator_IsSilent():
-            wx.Bell()
-
-        # Returning without calling even.Skip eats the event before it
-        # gets to the text control
-        return
-
 #=========================================================================
 # ADD METADATA ITEM (label+ctrlText+button(optional)
 #=========================================================================
@@ -327,19 +270,30 @@
             rmMulti = True
 
         self.tagText = wx.StaticText(parent=parent, id=ID_ANY, label=item.name)
-
-        if item.multiline is True:
-            self.valueCtrl = wx.TextCtrl(parent, id=ID_ANY, size=(0, 55),
-                                         # validator=MyValidator('ALPHA_ONLY'),
-                                         style=wx.VSCROLL |
-                                         wx.TE_MULTILINE  | wx.TE_WORDWRAP |
-                                         wx.TAB_TRAVERSAL | wx.RAISED_BORDER )
+        
+        if chckBox ==False:
+            if item.multiline is True:
+                self.valueCtrl = wx.TextCtrl(parent, id=ID_ANY, size=(0, 55),
+                                             validator=self.validators(item.type),
+                                             style=wx.VSCROLL |
+                                             wx.TE_MULTILINE  | wx.TE_WORDWRAP |
+                                             wx.TAB_TRAVERSAL | wx.RAISED_BORDER )
+            else:
+                self.valueCtrl = wx.TextCtrl(parent, id=wx.ID_ANY,
+                                             validator=self.validators(item.type),
+                                             style=wx.VSCROLL | wx.TE_DONTWRAP |
+                                             wx.TAB_TRAVERSAL | wx.RAISED_BORDER | wx.HSCROLL)
         else:
-            self.valueCtrl = wx.TextCtrl(parent, id=wx.ID_ANY,
-                                         # validator=MyValidator('ALPHA_ONLY'),
-                                         style=wx.VSCROLL | wx.TE_DONTWRAP |
-                                         wx.TAB_TRAVERSAL | wx.RAISED_BORDER | wx.HSCROLL)
-
+            if item.multiline is True:
+                self.valueCtrl = wx.TextCtrl(parent, id=ID_ANY, size=(0, 55),
+                                             style=wx.VSCROLL |
+                                             wx.TE_MULTILINE  | wx.TE_WORDWRAP |
+                                             wx.TAB_TRAVERSAL | wx.RAISED_BORDER )
+            else:
+                self.valueCtrl = wx.TextCtrl(parent, id=wx.ID_ANY,
+                                             style=wx.VSCROLL | wx.TE_DONTWRAP |
+                                             wx.TAB_TRAVERSAL | wx.RAISED_BORDER | wx.HSCROLL)
+                
         self.valueCtrl.Bind(wx.EVT_MOTION, self.onMove)
         self.valueCtrl.SetExtraStyle(wx.WS_EX_VALIDATE_RECURSIVELY)
 
@@ -361,8 +315,26 @@
         
         self.createInfo()
         self.tip = wx.ToolTip(self.infoTip)
+        #
         self._addItemLay(item.multiline, rmMulti,chckBox)
+    
+    def validators(self,validationStyle):
+
+        if validationStyle=='email':
+            return EmailValidator()
         
+        if validationStyle=='integer':
+            return NTCValidator('DIGIT_ONLY') 
+        
+        if validationStyle=='decimal':
+            return NTCValidator('DIGIT_ONLY') 
+        
+        if validationStyle=='date':
+            return TimeISOValidator()
+        
+        #return EmptyValidator()
+        return SimpleValidator('')
+
     def onChangeChckBox(self,evt):
         self.isChecked=self.chckBox.GetValue()
         if self.isChecked:
@@ -388,7 +360,7 @@
         string += '- -'*30 + '\n'    
         if self.mdDescription.statements is not None:     
             string += 'Jinja template info: \n' + self.mdDescription.statements + '\n'
-            
+
         if self.mdDescription.statements1 is not None:     
             string +=  self.mdDescription.statements1 + '\n'   
         string += 'OWSLib info:\n' + self.mdDescription.tag          
@@ -431,10 +403,11 @@
     def setValue(self, value):
         ##print "value ",value
         
-        if value is None:
+        if value is None or value is '':
             self.valueCtrl.SetBackgroundColour((245,204,230))#red
             
             self.valueCtrl.SetValue('')
+            
         elif value=='$NULL':
             self.valueCtrl.SetBackgroundColour((255,255,82))#yellow
             self.valueCtrl.SetValue('')
@@ -444,13 +417,10 @@
             self.isValid=True
             self.valueCtrl.SetValue(value)
             
-    def _removeNonAscii(self,s): 
-        s= filter(lambda x: x in string.printable, s)
-        return s
     
     def getValue(self):
         
-        return self._removeNonAscii(self.valueCtrl.GetValue())
+        return mdutil.replaceXMLReservedChar(self.valueCtrl.GetValue())
 
     def getCtrlID(self):
         return self.valueCtrl.GetId()
@@ -601,7 +571,7 @@
         self._layout()
 
 #----------------------------------------------------------- GUI GENERATOR START
-    def executeStr(self, stri, linfo):
+    def executeStr(self, stri, mdDescrObj):
         #print stri
         exec stri
 
@@ -622,14 +592,14 @@
 
     def generateGUI(self):
         '''
-        @var var:    self.c:        index of lstruct and self.mdDescription
-                    lstruct:        lstruct is self.mdOWSTagStr in list. \
+        @var var:    self.c:        index of tagStringLst and self.mdDescription
+                    tagStringLst:        tagStringLst is self.mdOWSTagStr in list. \
                                     Item=line from jinja template(only lines\
                                     with owslib objects and loops)
-                    linfo:          list of MdDescription() objects inicialized\
+                    mdDescrObj:          list of MdDescription() objects inicialized\
                                     by information from jinja t.
                     markgroup:      markers of created list in GUI notebook
-                    self.max:       length of lstruct and linfo
+                    self.max:       length of tagStringLst and mdDescrObj
                     self.stop:      index self.c is increasing  by function plusC(),\
                                     that care about  not exceeding the index
         '''
@@ -638,20 +608,22 @@
             @note:
             '''
             for c in range(self.max):
-                if '|length' in str(lstruct[c]):
-                    a = lstruct[c]
+                if '|length' in str(tagStringLst[c]):
+                    
+                    a = tagStringLst[c]
                     a = a.replace(
-                        '|length',
-                        ')').replace(
-                        'if ',
-                        'if len(self.')
-                    lstruct[c] = a
+                            '|length',
+                            ')').replace(
+                            'if ',
+                            'if len(self.')
+                            
+                    tagStringLst[c] = a
 
-                if 'zip(' in lstruct[c]:
-                    sta = lstruct[c]
-                    lstruct[c] = sta.replace('md.', 'self.md.')
-                    
-        def chckIfStetementsFORisValid(sta):
+                if 'zip(' in tagStringLst[c]:
+                    sta = tagStringLst[c]
+                    tagStringLst[c] = sta.replace('md.', 'self.md.')
+
+        def chckIfJumpToLoop(sta):
             self.isValidS=False
             staTMP=sta
             if not '\t'in staTMP:
@@ -675,19 +647,18 @@
                 return sta
             else:
                 return tab1+'for n in range(1)'
-            
-            
+
         def inBlock():  # function in def initCreatorMD(self):   !!!
             '''
             @note:
             '''
             ##print 'c--' , self.c
             IFStatements = False
-            statements = lstruct[self.c - 1]
+            statements = tagStringLst[self.c - 1]
             if 'if' in statements.split():
                 IFStatements = True
             loop=statements.replace(' md.', ' self.md.')
-            looptmp=chckIfStetementsFORisValid(loop)    
+            looptmp=chckIfJumpToLoop(loop)    
             str2 = 'numOfSameBox=0\n'
             str2 += looptmp
     
@@ -701,16 +672,16 @@
                 
                 box = True
                 str2 += '\t' + \
-                    'box=MdBox(self.nbPage,linfo[' + str(self.c) + '].inbox)\n'  # add box
+                    'box=MdBox(self.nbPage,mdDescrObj[' + str(self.c) + '].inbox)\n'  # add box
                     
             str1 = str2
             itemCounter=1
             
-            while '\t' in lstruct[self.c] and self.stop is False:
+            while '\t' in tagStringLst[self.c] and self.stop is False:
                 itemCounter+=1
                 
-                if  'for' not in str(lstruct[self.c]).split()\
-                          and 'if' not in str(lstruct[self.c]).split():
+                if  'for' not in str(tagStringLst[self.c]).split()\
+                          and 'if' not in str(tagStringLst[self.c]).split():
                    
                     value = str(self.mdOWSTagStrList[self.c])
                     str1 += '\t' + \
@@ -718,10 +689,10 @@
 
                     if box:
                         str1 += '\t' + \
-                            'it=MdItem(parent=box,item=linfo[' + str(self.c) + '],isFirstNum=numOfSameBox,chckBox=self.templateEditor)\n'
+                            'it=MdItem(parent=box,item=mdDescrObj[' + str(self.c) + '],isFirstNum=numOfSameBox,chckBox=self.templateEditor)\n'
                     else:
                         str1 += '\t' + \
-                            'it=MdItem(parent=self.nbPage,item=linfo[' + str(self.c) + '],isFirstNum=numOfSameBox,chckBox=self.templateEditor)\n'
+                            'it=MdItem(parent=self.nbPage,item=mdDescrObj[' + str(self.c) + '],isFirstNum=numOfSameBox,chckBox=self.templateEditor)\n'
                             
                     if self.isValidS: #if metatdata are loaded to owslib
                         if IFStatements:
@@ -730,9 +701,9 @@
                             str1 += '\t' + 'it.setValue(' + str(value) + ')\n'
                     else:  
                         if IFStatements:
-                            str1 += '\t' + 'it.setValue("$NULL")\n'
+                            str1 += '\t' + 'it.setValue("")\n'
                         else:
-                            str1 += '\t' + 'it.setValue("$NULL")\n'
+                            str1 += '\t' + 'it.setValue("")\n'
                             
                     str1 += '\t' + \
                         'self.mdDescription[' + str(self.c) + '].addMdItem(it)\n'
@@ -741,7 +712,7 @@
 
                     self.plusC()
                 else:  # if statements in statements
-                    statements = lstruct[self.c]
+                    statements = tagStringLst[self.c]
                     str2 = ''
                     keyword = False
                     
@@ -751,13 +722,13 @@
 
                     str2 += '\t' + 'numOfSameItem=0\n'
                     loop2=statements.replace(' md.', ' self.md.') 
-                    looptmp1=chckIfStetementsFORisValid(loop2)
+                    looptmp1=chckIfJumpToLoop(loop2)
                     #print '============'*5
                     str2 += looptmp1 + ':\n'
                     self.plusC()
                     str1 += str2
                     itemCounter+=1
-                    while '\t\t' in lstruct[self.c] and self.stop is False:
+                    while '\t\t' in tagStringLst[self.c] and self.stop is False:
                         itemCounter+=1    
                         value = str(self.mdOWSTagStrList[self.c])
                         # save information about loops
@@ -769,16 +740,16 @@
 
                         if box:
                             str1 += '\t\t' + \
-                                'it=MdItem(parent=box,item=linfo[' + str(self.c) + '],isFirstNum=numOfSameItem,chckBox=self.templateEditor)\n'
+                                'it=MdItem(parent=box,item=mdDescrObj[' + str(self.c) + '],isFirstNum=numOfSameItem,chckBox=self.templateEditor)\n'
                                 
                         else:
                             str1 += '\t\t' + \
-                                'it=MdItem(self.nbPage,linfo[' + str(self.c) + '],isFirstNum=numOfSameItem,chckBox=self.templateEditor)\n'
+                                'it=MdItem(self.nbPage,mdDescrObj[' + str(self.c) + '],isFirstNum=numOfSameItem,chckBox=self.templateEditor)\n'
                                 
                         if self.isValidS:         
                             str1 += '\t\t' + 'it.setValue(' + str(value) + ')\n'    
                         else:
-                            str1 += '\t\t' + 'it.setValue("$NULL")\n'
+                            str1 += '\t\t' + 'it.setValue("")\n'
                             
                         str1 += '\t\t' + 'self.ItemList.append(it)\n'
 
@@ -794,51 +765,51 @@
                         self.plusC()
 
             ##print '-' * 80
-            ##print linfo[self.c].inboxmulti
+            ##print mdDescrObj[self.c].inboxmulti
             if box:
                 str1 += tab + \
-                    'box.addItems(items=self.ItemList,multi=linfo[self.c].inboxmulti,isFirstNum=numOfSameBox)\n'
+                    'box.addItems(items=self.ItemList,multi=mdDescrObj[self.c].inboxmulti,isFirstNum=numOfSameBox)\n'
                 str1 += tab + 'self.nbPage.addItem(box)\n'
             else:
                 str1 += tab + 'self.nbPage.addItem(self.ItemList)\n'
 
-            self.executeStr(str1, linfo)
+            self.executeStr(str1, mdDescrObj)
 
 #--------------------------------------------------------------------- INIT VARS
         self.notebook = wx.Notebook(self)
         markgroup = []  # notebok panel marker
-        lstruct = self.mdOWSTagStrList
-        linfo = self.mdDescription  # from jinja
+        tagStringLst = self.mdOWSTagStrList
+        mdDescrObj = self.mdDescription  # from jinja
         # this valus is the index of self.mdOWSTagStrList and also in
         # self.mdDescription
         self.c = 0
         self.stop = False
-        self.max = len(linfo)
+        self.max = len(mdDescrObj)
         prepareStatements()
         self.notebokDict={}
 # --------------------------------------------- #START of the looop of genereator
         while self.stop is False:  # self.stop is managed by   def plusC(self):
-            group = linfo[self.c].group
+            group = mdDescrObj[self.c].group
 
             if group not in markgroup:  # if group is not created
                 markgroup.append(group)  # mark group
                 self.nbPage = MdNotebookPage(self.notebook)
-                self.notebook.AddPage(self.nbPage, linfo[self.c].group)
-                self.notebokDict[linfo[self.c].group]=self.nbPage
+                self.notebook.AddPage(self.nbPage, mdDescrObj[self.c].group)
+                self.notebokDict[mdDescrObj[self.c].group]=self.nbPage
             else:
-                self.nbPage=self.notebokDict[linfo[self.c].group]
+                self.nbPage=self.notebokDict[mdDescrObj[self.c].group]
 
             # if starting the statements
-            if '\t' in lstruct[self.c]and self.stop is False:
+            if '\t' in tagStringLst[self.c]and self.stop is False:
                 #print '-'*50
                 inBlock()
                 #print '-'*50
             # if just singe item without statements
-            elif 'for' not in str(lstruct[self.c]).split() and 'if' not in str(lstruct[self.c]).split():
+            elif 'for' not in str(tagStringLst[self.c]).split() and 'if' not in str(tagStringLst[self.c]).split():
                 #print '-'*50
 
-                it = MdItem(parent=self.nbPage, item=linfo[self.c],chckBox=self.templateEditor)
-                ##print 'hodnota--', linfo[self.c].tag 
+                it = MdItem(parent=self.nbPage, item=mdDescrObj[self.c],chckBox=self.templateEditor)
+                ##print 'hodnota--', mdDescrObj[self.c].tag 
                 value = 'self.' + \
                     str(self.mdOWSTagStrList[self.c]).replace('\n', '')
                 
@@ -855,7 +826,7 @@
             else:
                 self.plusC()
       
-   
+
 #----------------------------------------------------------- GUI GENERATOR END
 
     def defineTemplate(self):
@@ -974,7 +945,7 @@
 #----------------------------------------- FILL OWSLib BY EDITED METADATA IN GUI
 
     def executeStr1(self, stri, item):
-       #print stri
+        #print stri
         exec stri
 
     def createNewMD(self, evt=None):

Modified: sandbox/krejcmat/src/g.gui.metadata.py
===================================================================
--- sandbox/krejcmat/src/g.gui.metadata.py	2014-08-01 17:47:01 UTC (rev 61498)
+++ sandbox/krejcmat/src/g.gui.metadata.py	2014-08-01 18:47:11 UTC (rev 61499)
@@ -26,249 +26,31 @@
 import os
 import sys
 
-
 import grass.script as grass
 import grass.script.setup as gsetup
 from  lmgr import datacatalog 
 from core.gcmd import RunCommand, GError, GMessage
 import mdgrass
+import mdutil
 
 
-
-
-
-class Toolbar(wx.Panel):
-
-    def __init__(self, parent):
-        wx.Panel.__init__(self, parent, id=wx.ID_ANY)
-        self.jinjaFile = None
-        self.xmlPath = None
-        self.toolbar = wx.ToolBar(self, 1, wx.DefaultPosition, (-1, -1),)
-#-------------------------------------------------------------------- EDIT 
-        self.toolbar.AddSeparator()
-        bitmapEdit = wx.Image(
-            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'edit.png'),
-            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
-        self.bttEdit = BitmapBtnTxt(
-            self.toolbar, -1, bitmapEdit,'edit' )
-        self.toolbar.AddControl(control=self.bttEdit)
-        self.bttEdit.Disable()
-
-#-------------------------------------------------------------------- NEW SESION
-        self.toolbar.AddSeparator()
+class MDHelp(wx.Panel):
+    """
+    class MyHtmlPanel inherits wx.Panel and adds a button and HtmlWindow
+    """
+    def __init__(self, parent ):
+        # default pos is (0, 0) and size is (-1, -1) which fills the frame
+        wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY)
+        self.html1 = wx.html.HtmlWindow(self, id=wx.ID_ANY)
+        try:
+            self.html1.LoadFile('help/help.html')
+            #self.html1.LoadPage('http://inspire-geoportal.ec.europa.eu/EUOSME_GEOPORTAL/userguide/eurlex_en.htm')
+        except:
+            pass
+        self.mainSizer = wx.BoxSizer(wx.VERTICAL)
+        self.SetSizer(self.mainSizer)
+        self.mainSizer.Add(self.html1,proportion=1, flag=wx.EXPAND) 
         
-        bitmapNew = wx.Image(
-            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'create.png'),
-            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
-        self.bttNew = BitmapBtnTxt(
-            self.toolbar, -1,bitmapNew,'session')
-        self.toolbar.AddControl(control=self.bttNew)
-        self.bttNew.Disable()
-#-------------------------------------------------------------------------- SAVE
-        bitmapSave = wx.Image(
-            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'save.png'),
-            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
-        self.bttsave = BitmapBtnTxt(
-            self.toolbar, -1, bitmapSave, "XML")
-        self.bttsave.Disable()
-        self.toolbar.AddControl(control=self.bttsave)
-        self.toolbar.AddSeparator()        
-
-        
-        
-#----------------------------------------------------------------- OPEN TEMPLATE
-        bitmapLoad = wx.Image(
-            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'open.png'),
-            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
-        self.bttLoad = BitmapBtnTxt(
-            self.toolbar, -1, bitmapLoad, "template", size=(100, -1))
-        self.toolbar.AddControl(control=self.bttLoad)
-        self.bttLoad.Disable()
-
-#---------------------------------------------------------------------- OPEN XML
-        bitmapLoadXml = wx.Image(
-            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'open.png'),
-            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
-        self.bttLoadXml = BitmapBtnTxt(
-            self.toolbar, -1, bitmapLoad, "XML")
-        self.toolbar.AddControl(control=self.bttLoadXml)
-        self.bttLoadXml.Disable()     
-
-        self.toolbar.AddSeparator()
-        self.toolbar.AddSeparator()
-        #self.toolbar.SetMargins((500,500))
-#-------------------------------------------------------------------- NEW TEMPLATE
-  
-        bitmapCreateTemplate = wx.Image(
-            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'create.png'),
-            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
-        self.bttCreateTemplate = BitmapBtnTxt(
-            self.toolbar, -1, bitmapCreateTemplate, "template", size=(100, -1))
-        self.toolbar.AddControl(control=self.bttCreateTemplate)
-        #self.bttNewTenplate.Disable()
-        
-#-------------------------------------------------------------------------- SAVE
-        bitmapSaveTemplate = wx.Image(
-            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'save.png'),
-            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
-        self.bttSaveTemplate = BitmapBtnTxt(
-            self.toolbar, -1, bitmapSaveTemplate, "template", size=(100, -1))
-        self.bttSaveTemplate.Disable()
-        self.toolbar.AddControl(control=self.bttSaveTemplate)
-        self.toolbar.AddSeparator()         
-        
-        self.toolbar.AddSeparator()                
-#------------------------------------------------------------------------------ 
-
-        self.toolbar.Realize()
-        self._layout()
-
-        self.bttLoad.Bind(wx.EVT_BUTTON, self.OnOpenTemplate)
-        self.bttsave.Bind(wx.EVT_BUTTON, self.onSaveXML)
-        self.bttLoadXml.Bind(wx.EVT_BUTTON, self.onLoadXml)
-        self.bttNew.Bind(wx.EVT_BUTTON, self.onNewSession)
-        self.bttEdit.Bind(wx.EVT_BUTTON, self.onClickEdit)
-        self.bttCreateTemplate.Bind(wx.EVT_BUTTON, self.onCreateTemplate)
-        self.bttSaveTemplate.Bind(wx.EVT_BUTTON,self.onSaveTemplate)
-        
-    def onSaveTemplate(self,evt=None):
-        dlg = wx.FileDialog(
-                            self,
-                            "Choose a file",
-                            os.getcwd(),
-                            "",
-                            "*.xml",
-                            wx.SAVE)
-        
-        if dlg.ShowModal() == wx.ID_OK:
-            if self.jinjaFile is None:
-                self.jinjaFile = self.GetParent().jinjaPath    
-                 
-            self.GetParent().editor.exportTemlate(
-                                self.jinjaFile,
-                                outPath=dlg.GetDirectory(),
-                                xmlOutName=dlg.GetFilename())
-        
-    def onCreateTemplate(self,evt):
-        print 'a'
-        self.GetParent().templateEditor=True
-        self.onClickEdit()
-        self.bttCreateTemplate.Disable()
-        self.bttSaveTemplate.Enable()
-        
-    def onClickEdit(self, evt=None):
-        if self.GetParent().typePanelLeft.rbGrass:
-            self.GetParent().editMapMetadata()
-        else:
-            self.GetParent().init()
-        
-        self.bttEdit.Disable()
-        
-    def onNewSession(self, evt):
-        self.GetParent().init()
-        if self.GetParent().typePanelLeft.rbGrass is False:
-            self.bttLoad.Enable()
-            self.bttLoadXml.Enable() 
-        self.bttsave.Disable()
-        self.bttCreateTemplate.Enable()
-      
-    
-    def onChangeXmlorTemplate(self, evt=None):
-        #self.GetParent().xmlPath = self.xmlPath
-        #self.GetParent().jinjaPath = self.jinjaFile
-
-        if self.jinjaFile is not None and self.xmlPath is not None:
-            #self.GetParent().init()
-            self.GetParent().hideLeftPanel()
-            self.bttEdit.Enable()
-            self.jinjaFile = None
-            self.xmlPath = None
-            self.bttLoad.Disable()
-            self.bttLoadXml.Disable() 
-               
-    def onLoadXml(self, evt=None):
-        dlg = wx.FileDialog(
-                            self,
-                            "Choose a xml metadata file",
-                            os.getcwd(),
-                            "",
-                            "*.xml",
-                            wx.OPEN)
-        if dlg.ShowModal() == wx.ID_OK:
-            self.xmlPath = dlg.GetPath()
-            #self.onChangeXmlorTemplate()
-            self.GetParent().xmlPath = self.xmlPath
-            self.onChangeXmlorTemplate()
-            dlg.Destroy()
-            
-        else:
-            dlg.Destroy()
-                
-    def onSaveXML(self, evt=None):
-        dlg = wx.FileDialog(
-                            self,
-                            "Choose a file",
-                            os.getcwd(),
-                            "",
-                            "*.xml",
-                            wx.SAVE)
-        
-        if dlg.ShowModal() == wx.ID_OK:
-            if self.jinjaFile is None:
-                self.jinjaFile = self.GetParent().jinjaPath
-                
-            self.GetParent().editor.exportToXml(
-                                self.jinjaFile,
-                                outPath=dlg.GetDirectory(),
-                                xmlOutName=dlg.GetFilename())
-
-    def OnOpenTemplate(self, evt):
-
-        if self.jinjaFile is None:
-            dlg = wx.FileDialog(
-                                self,
-                                "Choose a file",
-                                os.getcwd(),
-                                "",
-                                "*.xml",
-                                wx.OPEN)
-            
-            if dlg.ShowModal() == wx.ID_OK:
-                self.jinjaFile = dlg.GetPath()
-                self.GetParent().jinjaPath = self.jinjaFile
-                self.onChangeXmlorTemplate()
-                dlg.Destroy()
-        else:
-            # if user open another template(re-initialize MainFrame)
-            dlg = wx.FileDialog(
-                                self,
-                                "Choose a file",
-                                os.getcwd(),
-                                "",
-                                "*.xml",
-                                wx.OPEN)
-            
-            if dlg.ShowModal() == wx.ID_OK:
-                self.jinjaFile = dlg.GetPath()
-                self.GetParent().init()
-                #self.onChangeTemplate()
-                
-                dlg.Destroy()
-
-    def _layout(self):
-        self.mainsizer = wx.BoxSizer(wx.HORIZONTAL)
-        self.SetSizer(self.mainsizer)
-        self.mainsizer.Add(self.toolbar)
-
-    def message(self, msg, label):
-        dlg = wx.MessageDialog(
-                                self,
-                                msg,
-                                label,
-                                wx.OK | wx.CANCEL | wx.ICON_INFORMATION)
-        self.msgStatus = dlg.ShowModal()
-        dlg.Destroy()
-
 #===============================================================================
 # NOTEBOOK ON THE RIGHT SIDE-xml browser+validator
 #===============================================================================
@@ -281,38 +63,44 @@
         self.validator = InspireValidator(self.notebook_panel0)
 
         self.buttValidate = wx.Button(
-            self.notebook_panel0,
-            id=wx.ID_ANY,
-            size=(
-                70,
-                50),
-            label='validate')
-        
-        self.buttValidate.Bind(wx.EVT_BUTTON, self.validate)
+                                    self.notebook_panel0,
+                                    id=wx.ID_ANY,
+                                    size=(
+                                        70,
+                                        50),
+                                    label='validate')
+
         self.notebook_panel1 = wx.Panel(self, wx.ID_ANY)
         self.tree = TreeEditor(self.notebook_panel1, path)
+        self.buttRefresh = wx.Button(
+                                    self.notebook_panel1,
+                                    id=wx.ID_ANY,
+                                    size=(
+                                        70,
+                                        50),
+                                    label='refresh') 
 
-        # second panel
-        self.notebook_panel2 = wx.Panel(self, wx.ID_ANY, style=0)
-
         self.AddPage(self.notebook_panel0, "Validator")
         self.AddPage(self.notebook_panel1, "Tree browser")
-        self.AddPage(self.notebook_panel2, "Help")
+        #self.AddPage(self.notebook_panel2, "Help")
 
-        self._layout(path)
+        self.buttValidate.Bind(wx.EVT_BUTTON, self.validate)
+        self.buttRefresh.Bind(wx.EVT_BUTTON, self.refresh)
+        self._layout()
 
     def onActive(self):
         pass
-
+    def refresh(self,evt):
+        pass
+    
     def validate(self, evt):
 
         self.GetParent().GetParent().editor.createNewMD()
         md = self.GetParent().GetParent().editor.md
 
-        # #print md
         self.validator.validate_inspire(md)
 
-    def _layout(self, path):
+    def _layout(self):
         panelSizer0 = wx.BoxSizer(wx.VERTICAL)
         self.notebook_panel0.SetSizer(panelSizer0)
 
@@ -321,18 +109,16 @@
 
         panelSizer1 = wx.BoxSizer(wx.VERTICAL)
         self.notebook_panel1.SetSizer(panelSizer1)
-
-        if path is None:
-            panelSizer1.Add(self.tmpPanel, flag=wx.EXPAND, proportion=1)
-        else:
-            panelSizer1.Add(self.tree, flag=wx.EXPAND, proportion=1)
-
+        panelSizer1.Add(self.tree, flag=wx.EXPAND, proportion=1)
+        panelSizer1.Add(self.buttRefresh)
+        
         panelSizer2 = wx.BoxSizer(wx.VERTICAL)
-        self.notebook_panel2.SetSizer(panelSizer2)
-
+        #self.notebook_panel2.SetSizer(panelSizer2)
+        #panelSizer2.Add(self.notebook_panel2,flag=wx.EXPAND, proportion=1)
 #===============================================================================
 # CONFIGURATION PANEL ON THE LEFT SIDE
 #===============================================================================
+        
 class MdEditConfigPanel(wx.Panel):
     
     def __init__(self, parent):
@@ -363,16 +149,10 @@
         self.mapGrassEdit = self.rbGrass.GetValue()
         if self.mapGrassEdit == False:
             self.comboBoxProfile.Hide()
-            #self.buttEdit.Hide()
         else:
             self.comboBoxProfile.Show()
-            #self.buttEdit.Show()
-            
-        self.GetParent().GetParent().editingStatus(self.mapGrassEdit)
+        self.GetParent().GetParent().editingMode(self.mapGrassEdit)
 
-       # print parent
-    
-  
     def _layout(self):
         self.mainsizer = wx.BoxSizer(wx.VERTICAL)
         self.SetSizer(self.mainsizer)
@@ -397,95 +177,164 @@
         self.second = False
         self.secondAfterChoice = False
         self.templateEditor=False
-        self.init()
-          
-    def refreshConfig(self):
-
-        if self.jinjaPath and self.xmlPath:
-            self.editor = mainEditor(self.splitter, self.jinjaPath, self.xmlPath)
-            
-            self.splitter.AppendWindow(self.editor)
-            self.splitter.AppendWindow(NotebookRight(self.splitter, self.xmlPath))
-            self.toolbar.bttsave.Enable()
-            self.Show()
-            
+        self.sb = self.CreateStatusBar()
+        self.secondMultiEdit=False
+        self.cres=0 #resizeFrame
+        self.initEditor()
+        
     def resizeFrame(self, x1=1, y1=0):
+            self.cres+=1
+            if (self.cres%2==0) and x1==1 and y1==0:
+                x1=-1
             x, y = self.GetSize()
             self.SetSize((x + x1, y + y1)) 
                  
     def hideLeftPanel(self):
             self.toolbar.bttNew.Enable()
-            self.toolbar.bttsave.Enable()
             self.Hsizer.Remove(self.leftPanel)
+            self.Hsizer.Layout()
             self.leftPanel.SetSize((1, 1))
-            # self.Hsizer.Fit()
             self.splitter.Refresh()
-            self.resizeFrame()
             self.splitter.SetSashGravity(0.7)        
-        
-                
-    def editMapMetadata(self):
-        map = self.MdDataCatalogPanelLeft.map
-        maptype = self.MdDataCatalogPanelLeft.mapType      
-        templeteChoice=self.typePanelLeft.comboBoxProfile.GetValue()
-        
-        
-        if map is not None:
-            
+                         
+    def editMapMetadata(self,multipleEditing=False):
+   
+        if not multipleEditing:
             self.hideLeftPanel()
-            mdCreator = mdgrass.GrassMD(map, maptype)                
-            if templeteChoice == 'INSPIRE':
-                mdCreator.createGrassInspireISO()
-                self.jinjaPath = mdCreator.templatePathAbs
-                self.xmlPath = mdCreator.saveXML()
-                self.init()
-                
-            elif templeteChoice == 'GRASS BASIC':
-                mdCreator.createGrassBasicISO()
-                self.jinjaPath = mdCreator.templatePathAbs
-                self.xmlPath = mdCreator.saveXML()
-                self.init()
+            self.ListOfMapTypeDict=self.MdDataCatalogPanelLeft.ListOfMapTypeDict
+        templeteChoice=self.configPanelLeft.comboBoxProfile.GetValue()
+        self.numOfMap=len(self.ListOfMapTypeDict)
+          
+        if  self.numOfMap==1 and multipleEditing is False:
+                mdCreator = mdgrass.GrassMD(self.ListOfMapTypeDict[-1][ self.ListOfMapTypeDict[-1].keys()[0] ],
+                                             self.ListOfMapTypeDict[-1].keys()[0])                
+                if templeteChoice == 'INSPIRE':
+                    mdCreator.createGrassInspireISO()
+                    self.jinjaPath = mdCreator.templatePathAbs
+                    self.xmlPath = mdCreator.saveXML()
+                    self.initEditor()
                     
-            elif templeteChoice == 'Load Custom':   
+                elif templeteChoice == 'GRASS BASIC':
+                    mdCreator.createGrassBasicISO()
+                    self.jinjaPath = mdCreator.templatePathAbs
+                    self.xmlPath = mdCreator.saveXML()
+                    self.initEditor()
+        
+        if templeteChoice == 'Load Custom' and self.numOfMap!=0:   
+            if multipleEditing is False:
                 dlg = wx.FileDialog(
                             self,
-                            "Choose a file",
+                            "Choose a template",
                             os.getcwd(),
                             "",
                             "*.xml",
                             wx.OPEN)
-                    
+                
                 if dlg.ShowModal() == wx.ID_OK:
-                    mdCreator.createGrassInspireISO()
-                    self.jinjaPath = dlg.GetPath()
-                    self.xmlPath = mdCreator.saveXML()
-                    self.init()
-        else:            
-             GMessage('Select map in data catalog...')
-          
-    def editingStatus(self, editStatus):
+                        mdCreator = mdgrass.GrassMD(self.ListOfMapTypeDict[-1][ self.ListOfMapTypeDict[-1].keys()[0] ],
+                                                     self.ListOfMapTypeDict[-1].keys()[0])    
+                        mdCreator.createGrassInspireISO()
+                        self.jinjaPath = dlg.GetPath()
+                        self.xmlPath = mdCreator.saveXML()
+                        
+                        if self.numOfMap>1:
+                            self.ListOfMapTypeDict.pop()
+                            self.initMultipleEditor()
+                        else:
+                            self.ListOfMapTypeDict.pop()
+                            self.initEditor() 
+                else:#do nothing
+                    
+                    self.initEditor() 
+                    return False
+            else:
+                        mdCreator = mdgrass.GrassMD(self.ListOfMapTypeDict[-1][ self.ListOfMapTypeDict[-1].keys()[0] ],
+                                                     self.ListOfMapTypeDict[-1].keys()[0])    
+                        mdCreator.createGrassInspireISO()                
+                        self.xmlPath = mdCreator.saveXML()
+                        self.ListOfMapTypeDict
+                        self.initMultipleEditor()
+                        self.ListOfMapTypeDict.pop()
+                        
+        if self.numOfMap==0 and  multipleEditing is True:
+            multipleEditing=False
+            self.toolbar.onNewSession(None)
+            GMessage('All choosen maps are edited') 
+            
+            self.secondMultiEdit=True
+            self.xmlPath=None
+            self.jinjaPath=None
+                                    
+        elif self.numOfMap==0:            
+             GMessage('Select map in data catalog...') 
+                            
+  
+                  
+        if self.numOfMap>1 and  templeteChoice != 'Load Custom':
+             GMessage('For multiple editing metadata of maps is necessary to define template and use "Load Custom" option. See manual... ')
+             self.toolbar.onNewSession(None)
+        return True
+       
+    def editingMode(self, editStatus):
         self.resizeFrame()
+        self.Layout()
+        
         if editStatus:
             self.MdDataCatalogPanelLeft.Show()
             self.toolbar.bttLoad.Disable()
             self.toolbar.bttLoadXml.Disable()
-            self.toolbar.bttEdit.Enable()
+            #self.toolbar.bttEdit.Enable()
         else:
             self.MdDataCatalogPanelLeft.Hide()
             self.toolbar.bttEdit.Disable()
+            self.toolbar.bttCreateTemplate.Disable()
             self.toolbar.bttLoad.Enable()
             self.toolbar.bttLoadXml.Enable()
+            self.sb.SetStatusText('')
+            self.MdDataCatalogPanelLeft.UnselectAll()
     
-    def init(self):
+    def initMultipleEditor(self):
+           #print 'def initMultipleEditor(self):'
+            if self.firstAfterChoice and not self.secondMultiEdit:
+                   #print 'if self.firstAfterChoice:'
+                    self.firstAfterChoice = False
+                    self.secondAfterChoice = True
+                    self.toolbar.bttsave.SetLabel('next')
+                    self.toolbar.hideMultipleEdit()
+                    self.mainSizer.Layout()
+                    self.editor = mainEditor(
+                                            self.splitter,
+                                            self.jinjaPath,
+                                            self.xmlPath,
+                                            self.templateEditor)
+                    self.ntbRight = NotebookRight(self.splitter, self.xmlPath)
+                    self.splitter.SplitVertically(self.editor, self.ntbRight, sashPosition=0.6)
+                    self.splitter.SetSashGravity(0.9)    
+                    self.resizeFrame()
+                    self.Show()
+                    
+            elif self.secondAfterChoice or self.secondMultiEdit:
+                   #print 'elif self.secondAfterChoice or self.secondMultiEdit:'
+                    if self.secondMultiEdit:
+                        self.toolbar.bttsave.SetLabel('next')
+                        self.toolbar.hideMultipleEdit()
+                        #self.secondMultiEdit= False
+                        #self.second = True
+                    self.second=False
+                    self.secondAfterChoice=True
+                    self.initEditor() 
 
+    def initEditor(self):
+                      
             if self.first:
+               #print 'if self.first:'
                 self.first = False
                 self.firstAfterChoice = True
-                print "first-----"
-                self.toolbar = Toolbar(self)
+               #print "first-----"
+                self.toolbar = MdToolbar(self)
                 
                 self.leftPanel = wx.Panel(self, id=wx.ID_ANY)
-                self.typePanelLeft = MdEditConfigPanel(self.leftPanel)
+                self.configPanelLeft = MdEditConfigPanel(self.leftPanel)
                 self.MdDataCatalogPanelLeft = MdDataCatalog(self.leftPanel)
                 self.splitter = SplitterWindow(
                                                   self,
@@ -494,8 +343,9 @@
                 self._layout()
 
             elif self.firstAfterChoice:
-                if self.jinjaPath and self.xmlPath:
-                    print "firstAfterChoice-----"
+                   #print 'elif self.firstAfterChoice:'
+                #f self.jinjaPath and self.xmlPath:
+                    self.secondMultiEdit=True
                     self.firstAfterChoice = False
                     self.second = True
                     self.editor = mainEditor(
@@ -505,14 +355,12 @@
                                             self.templateEditor)
                     self.ntbRight = NotebookRight(self.splitter, self.xmlPath)
                     self.splitter.SplitVertically(self.editor, self.ntbRight, sashPosition=0.6)
-                    # self.toolbar.bttsave.Enable()
-                    # self._layout()
-                    self.resizeFrame(1, 0)
+                    self.splitter.SetSashGravity(0.9) 
+                    self.resizeFrame()
                     self.Show()
             
             elif self.second:  # if next initializing of editor
-                
-                print "second-----"
+               #print "second-----"
                 self.second = False
                 self.secondAfterChoice = True
                 self.splitter.Hide()
@@ -523,37 +371,38 @@
                 self.resizeFrame()
                 
             elif self.secondAfterChoice:
-                if self.jinjaPath and self.xmlPath:
-                    print 'secondAfterChoice'
+                   #print 'elif self.secondAfterChoice:aa'
+                #if self.jinjaPath and self.xmlPath:
+                   #print 'secondAfterChoice'
                     self.secondAfterChoice = False
                     self.second = True
                     self.splitter.Show()
                     self.toolbar.bttNew.Enable() 
                     self.toolbar.bttsave.Enable()
+                    
                     ntbRightBCK = self.ntbRight     
                     self.ntbRight = NotebookRight(self.splitter, self.xmlPath) 
                     self.splitter.ReplaceWindow(ntbRightBCK, self.ntbRight)                 
                     
                     editorTMP = self.editor
                     self.editor = mainEditor(
-                        self.splitter,  #
-                        self.jinjaPath,
-                        self.xmlPath,
-                        self.templateEditor)
+                                            self.splitter,  #
+                                            self.jinjaPath,
+                                            self.xmlPath,
+                                            self.templateEditor)
                     
                     self.splitter.ReplaceWindow(editorTMP, self.editor)
                     ntbRightBCK.Destroy()
                     editorTMP.Destroy()
                     self.resizeFrame()
                     self.Show()
-                    self.splitter.SetSashGravity(0.6)                
+                    self.splitter.SetSashGravity(0.35)                
             else:
                 GMessage('Select map in data catalog...')
                 
-                
+            #self.toolbar.bttsave.SetLabel('XML')    
     def _layout(self):
         
-        # if state=='first':
             self.mainSizer = wx.BoxSizer(wx.VERTICAL)
             self.SetSizer(self.mainSizer)
                 
@@ -564,7 +413,7 @@
     
             self.leftPanelSizer = wx.BoxSizer(wx.VERTICAL)
             self.leftPanel.SetSizer(self.leftPanelSizer)
-            self.leftPanelSizer.Add(self.typePanelLeft, proportion=0.2, flag=wx.EXPAND)
+            self.leftPanelSizer.Add(self.configPanelLeft, proportion=0.2, flag=wx.EXPAND)
             self.leftPanelSizer.AddSpacer(5, 5, 1, wx.EXPAND)
             self.leftPanelSizer.Add(self.MdDataCatalogPanelLeft, proportion=1, flag=wx.EXPAND)
         
@@ -572,12 +421,10 @@
             self.mainSizer.Add(self.Hsizer, proportion=1, flag=wx.EXPAND)        
         
             self.Hsizer.Add(self.leftPanel, proportion=0.5, flag=wx.EXPAND)
-            x, y = self.GetSize()
-            self.SetSize((x + 1, y))
-        # else:
-            # print '2 lay----'
+            self.Layout()
+            
             self.Hsizer.Add(self.splitter, proportion=1, flag=wx.EXPAND)
-            self.splitter.SetSashGravity(0.6)
+            self.splitter.SetSashGravity(0.35)
             self.splitter.SizeWindows()
             self.resizeFrame(300, 0)
             
@@ -588,11 +435,10 @@
     
         def __init__(self, parent):
             """Test Tree constructor."""
-            super(MdDataCatalog, self).__init__(parent )
-            #===================================================================
-            # style =wx.TR_MULTIPLE|
-            #          ,id=wx.ID_ANY                         wx.TR_HAS_BUTTONS|wx.TR_FULL_ROW_HIGHLIGHT
-            #===================================================================
+            super(MdDataCatalog, self).__init__(parent=parent,style=wx.TR_MULTIPLE|wx.TR_HIDE_ROOT |
+                                                 wx.TR_HAS_BUTTONS|wx.TR_FULL_ROW_HIGHLIGHT|
+                                                 wx.TR_COLUMN_LINES )
+
             self.InitTreeItems()
             self.map = None
             self.mapType = None
@@ -607,19 +453,46 @@
             self.ExpandAll()
             self.Bind(wx.EVT_TREE_SEL_CHANGED, self.onChanged)
             
-        def onChanged(self, evt=None):
+        def onChanged(self, evt=None): 
+            self.ListOfMapTypeDict=list()
+            maps=list()
             if self.GetChildrenCount(evt.Item) == 0:
-                self.map = self.GetItemText(evt.Item) + '@' + self.mapset
-                self.mapType = self.GetItemParent(evt.Item)
-                self.mapType = self.GetItemText(self.mapType)               
-                if self.mapType == 'vect':
-                    self.mapType = 'vector'
-                elif self.mapType == 'rast':
-                    self.mapType = 'cell'
+                for item in self.GetSelections():
+                    MapTypeDict={}
+                    maps.append(self.GetItemText(item))
+                    map = self.GetItemText(item) + '@' + self.mapset
+                    mapType = self.GetItemParent(item)
+                    mapType = self.GetItemText(mapType) 
+                                  
+                    if mapType == 'vect':
+                        mapType = 'vector'
+                    elif mapType == 'rast':
+                        mapType = 'cell'
+                    MapTypeDict[mapType]  = map
+                    
+                    self.ListOfMapTypeDict.append(MapTypeDict)  
                 self.GetParent().GetParent().toolbar.bttEdit.Enable()
+                self.GetParent().GetParent().toolbar.bttCreateTemplate.Enable()
             else:
+                self.Unselect()
                 GMessage('Please select map.')
-
+              
+            if len(maps)==0:
+                self.GetParent().GetParent().toolbar.bttEdit.Disable()
+                self.GetParent().GetParent().toolbar.bttCreateTemplate.Disable()    
+            str1=''
+            
+            for map in maps:
+                str1+=map+'  '
+            
+            if len(maps)>1:
+                self.GetParent().GetParent().configPanelLeft.comboBoxProfile.SetStringSelection('Load Custom')
+                self.GetParent().GetParent().configPanelLeft.comboBoxProfile.Disable()
+                self.GetParent().GetParent().toolbar.bttCreateTemplate.Disable()
+            else:
+                self.GetParent().GetParent().configPanelLeft.comboBoxProfile.Enable()
+                self.GetParent().GetParent().toolbar.bttCreateTemplate.Enable()
+            self.GetParent().GetParent().sb.SetStatusText(str1)
         def _popupMenuLayer(self):
             """Create popup menu for layers"""
             pass
@@ -628,7 +501,6 @@
             """Create popup menu for mapsets"""
             pass
 
-
 class RandomPanel(wx.Panel):
 
     def __init__(self, parent, color):
@@ -678,7 +550,6 @@
                 if text:
                     val = tree.AppendItem(item, text)
                     tree.SetPyData(val, e)
-                    # count+=1
 
                 add(item, e)
         add(root, xml)
@@ -705,7 +576,254 @@
             self.ExpandAllChildren(evt.Item)
         else:
             self.CollapseAllChildren(evt.Item)
+class MdToolbar(wx.Panel):
+
+    def __init__(self, parent):
+        wx.Panel.__init__(self, parent, id=wx.ID_ANY)
+        self.jinjaFile = None
+        self.xmlPath = None
+        self.toolbar = wx.ToolBar(self, 1, wx.DefaultPosition, (-1, -1))
+#-------------------------------------------------------------------- EDIT 
+        self.toolbar.AddSeparator()
+        bitmapEdit = wx.Image(
+            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'edit.png'),
+            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
+        self.bttEdit = BitmapBtnTxt(
+            self.toolbar, -1, bitmapEdit,'edit' )
+        self.toolbar.AddControl(control=self.bttEdit)
+        self.bttEdit.Disable()
+
+#-------------------------------------------------------------------- NEW SESION
+        self.toolbar.AddSeparator()
+        
+        bitmapNew = wx.Image(
+            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'create.png'),
+            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
+        self.bttNew = BitmapBtnTxt(
+            self.toolbar, -1,bitmapNew,'session')
+        self.toolbar.AddControl(control=self.bttNew)
+        self.bttNew.Disable()
+#-------------------------------------------------------------------------- SAVE
+        bitmapSave = wx.Image(
+            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'save.png'),
+            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
+        self.bttsave = BitmapBtnTxt(
+            self.toolbar, -1, bitmapSave, "XML")
+        self.bttsave.Disable()
+        self.toolbar.AddControl(control=self.bttsave)
+        self.toolbar.AddSeparator()        
+
+#----------------------------------------------------------------- OPEN TEMPLATE
+        bitmapLoad = wx.Image(
+            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'open.png'),
+            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
+        self.bttLoad = BitmapBtnTxt(
+            self.toolbar, -1, bitmapLoad, "template", size=(100, -1))
+        self.toolbar.AddControl(control=self.bttLoad)
+        self.bttLoad.Disable()
+
+#---------------------------------------------------------------------- OPEN XML
+        bitmapLoadXml = wx.Image(
+            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'open.png'),
+            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
+        self.bttLoadXml = BitmapBtnTxt(
+            self.toolbar, -1, bitmapLoad, "XML")
+        self.toolbar.AddControl(control=self.bttLoadXml)
+        self.bttLoadXml.Disable()     
+
+        self.toolbar.AddSeparator()
+        self.toolbar.AddSeparator()
+        #self.toolbar.SetMargins((500,500))
+#-------------------------------------------------------------------- NEW TEMPLATE
+  
+        bitmapCreateTemplate = wx.Image(
+            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'create.png'),
+            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
+        self.bttCreateTemplate = BitmapBtnTxt(
+            self.toolbar, -1, bitmapCreateTemplate, "template", size=(100, -1))
+        self.toolbar.AddControl(control=self.bttCreateTemplate)
+        self.bttCreateTemplate.Disable()
+        
+#-------------------------------------------------------------------------- SAVE
+        bitmapSaveTemplate = wx.Image(
+            os.path.join(os.environ['GISBASE'], 'gui', 'icons', 'grass', 'save.png'),
+            wx.BITMAP_TYPE_PNG).ConvertToBitmap()
+        self.bttSaveTemplate = BitmapBtnTxt(
+            self.toolbar, -1, bitmapSaveTemplate, "template", size=(100, -1))
+        self.bttSaveTemplate.Disable()
+        self.toolbar.AddControl(control=self.bttSaveTemplate)
+        self.toolbar.AddSeparator()         
+        
+        self.toolbar.AddSeparator()                
+#------------------------------------------------------------------------------ 
+
+        self.toolbar.Realize()
+        self._layout()
+
+        self.bttLoad.Bind(wx.EVT_BUTTON, self.OnOpenTemplate)
+        self.bttsave.Bind(wx.EVT_BUTTON, self.onSaveXML)
+        self.bttLoadXml.Bind(wx.EVT_BUTTON, self.onLoadXml)
+        self.bttNew.Bind(wx.EVT_BUTTON, self.onNewSession)
+        self.bttEdit.Bind(wx.EVT_BUTTON, self.onClickEdit)
+        self.bttCreateTemplate.Bind(wx.EVT_BUTTON, self.onCreateTemplate)
+        self.bttSaveTemplate.Bind(wx.EVT_BUTTON,self.onSaveTemplate)
+        
+    def onSaveTemplate(self,evt=None):
+        dlg = wx.FileDialog(
+                            self,
+                            "Choose a file",
+                            os.getcwd(),
+                            "",
+                            "*.xml",
+                            wx.SAVE)
+        
+        if dlg.ShowModal() == wx.ID_OK:
+            if self.jinjaFile is None:
+                self.jinjaFile = self.GetParent().jinjaPath    
+                 
+            self.GetParent().editor.exportTemlate(
+                                self.jinjaFile,
+                                outPath=dlg.GetDirectory(),
+                                xmlOutName=dlg.GetFilename())
+    def hideMultipleEdit(self):
+        self.bttLoad.Hide()
+        self.bttLoadXml.Hide()
+        self.bttNew.Hide()
+        self.bttEdit.Hide()
+        self.bttCreateTemplate.Hide()
+        self.bttSaveTemplate.Hide()
+          
+    def showMultipleEdit(self):
+        self.bttLoad.Show()
+        self.bttLoadXml.Show()
+        self.bttNew.Show()
+        self.bttEdit.Show()
+        self.bttCreateTemplate.Show()
+        self.bttSaveTemplate.Show()        
+                   
+    def onCreateTemplate(self,evt):
+        self.GetParent().templateEditor=True
+        self.onClickEdit()
+        self.bttCreateTemplate.Disable()
+        self.bttSaveTemplate.Enable()
+        
+    def onClickEdit(self, evt=None):
+        if self.GetParent().configPanelLeft.rbGrass:      
+            ok=self.GetParent().editMapMetadata()
+            if not ok:
+                return
+        else:
+            self.GetParent().initEditor()
+        self.bttCreateTemplate.Disable()
+        self.bttEdit.Disable()
+        self.bttsave.Enable()
+        
+    def onNewSession(self, evt):
+        self.GetParent().initEditor()
+        if self.GetParent().configPanelLeft.rbGrass is False:
+            self.bttLoad.Enable()
+            self.bttLoadXml.Enable() 
+        self.bttsave.Disable()
+        #self.bttCreateTemplate.Enable()
+        self.bttsave.SetLabel('XML')
+        self.showMultipleEdit()
+        self.bttSaveTemplate.Disable()
+        
+    def onChangeXmlorTemplate(self, evt=None):
+        if self.jinjaFile is not None and self.xmlPath is not None:
+            #self.GetParent().initEditor()
+            self.GetParent().hideLeftPanel()
+            self.bttEdit.Enable()
+            self.bttCreateTemplate.Enable()
+            self.jinjaFile = None
+            self.xmlPath = None
+            self.bttLoad.Disable()
+            self.bttLoadXml.Disable() 
+               
+    def onLoadXml(self, evt=None):
+        dlg = wx.FileDialog(
+                            self,
+                            "Choose a xml metadata file",
+                            os.getcwd(),
+                            "",
+                            "*.xml",
+                            wx.OPEN)
+        if dlg.ShowModal() == wx.ID_OK:
+            self.xmlPath = dlg.GetPath()
+            self.GetParent().xmlPath = self.xmlPath
+            tx=self.GetParent().sb.GetStatusText()
+            self.GetParent().sb.SetStatusText(tx+'  Selected XML: '+ self.xmlPath )
+            self.onChangeXmlorTemplate()
+            dlg.Destroy()
             
+        else:
+            dlg.Destroy()
+                
+    def onSaveXML(self, evt=None):
+
+            dlg = wx.FileDialog(
+                                self,
+                                "Set output file",
+                                os.getcwd(),
+                                "",
+                                "*.xml",
+                                wx.SAVE)
+            
+            if dlg.ShowModal() == wx.ID_OK:
+                if self.jinjaFile is None:
+                    self.jinjaFile = self.GetParent().jinjaPath
+                    
+                self.GetParent().editor.exportToXml(
+                                    self.jinjaFile,
+                                    outPath=dlg.GetDirectory(),
+                                    xmlOutName=dlg.GetFilename())
+                if self.bttsave.GetLabelText() =='next':
+                    self.GetParent().editMapMetadata(True)
+                os.remove(self.GetParent().xmlPath)
+            else:
+                  
+                if self.bttsave.GetLabelText() =='next':
+                    ask=yesNo(self,'Metadata are not saved. Do you want to save it? ')
+                    if ask:
+                        self.onSaveXML()
+                        
+                    self.GetParent().editMapMetadata(True)  
+                else:              
+                        GMessage('Metadata are not saved.' )  
+                
+            dlg.Destroy()
+            
+    def OnOpenTemplate(self, evt):
+            dlg = wx.FileDialog(
+                                self,
+                                "Choose template",
+                                os.getcwd(),
+                                "",
+                                "*.xml",
+                                wx.OPEN)
+            
+            if dlg.ShowModal() == wx.ID_OK:
+                    self.jinjaFile = dlg.GetPath()
+                
+                    self.GetParent().jinjaPath = self.jinjaFile
+                    tx=self.GetParent().sb.GetStatusText()
+                    self.GetParent().sb.SetStatusText(tx+' Selected template: '+ self.jinjaFile)            
+                    self.onChangeXmlorTemplate()
+
+            dlg.Destroy()
+
+
+    def _layout(self):
+        self.mainsizer = wx.BoxSizer(wx.HORIZONTAL)
+        self.SetSizer(self.mainsizer)
+        self.mainsizer.Add(self.toolbar)
+        
+def yesNo(parent, question, caption = 'Yes or no?'):
+    dlg = wx.MessageDialog(parent, question, caption, wx.YES_NO | wx.ICON_QUESTION)
+    result = dlg.ShowModal() == wx.ID_YES
+    dlg.Destroy()
+    return result
+            
 class InspireValidator(wx.Panel):
 
     def __init__(self, parent):
@@ -721,265 +839,17 @@
         self.SetSizer(self.mainSizer)
 
         self.mainSizer.Add(self.text, proportion=1, flag=wx.EXPAND)
-
-    def validate_inspire(self, md):
+        
+    def validate_grassProfile(self, md):
         '''function for validation INSPIRE XML file'''
-        try:
-            self.md = md
-            result = {}
-            result["status"] = "succeded"
-            result["errors"] = []
-            result["num_of_errors"] = "0"
-            errors = 0
+        pass
 
-            if self.md.identification is (None or ''):
-                result["errors"].append(
-                    "gself.md:CI_ResponsibleParty: Organization missing")
-                result["errors"].append(
-                    "gself.md:CI_ResponsibleParty: E-mail missing")
-                result["errors"].append(
-                    "gself.md:CI_ResponsibleParty: Role missing")
-                result["errors"].append(
-                    "gself.md:self.md_DataIdentification: Title is missing")
-                result["errors"].append(
-                    "gself.md:self.md_DataIdentification: Abstract is missing")
-                result["errors"].append(
-                    "gself.md:self.md_ScopeCode: Resource Type is missing")
-                result["errors"].append(
-                    "gself.md:language: Resource Language is missing")
-                result["errors"].append(
-                    "gself.md:RS_Identifier: Unique Resource Identifier is missing")
-                result["errors"].append(
-                    "gself.md:topicCategory: TopicCategory is missing")
-                result["errors"].append(
-                    "gself.md:self.md_Keywords: Keywords are missing")
-                result["errors"].append(
-                    "gself.md:thesaurusName: Thesaurus Title is missing")
-                result["errors"].append(
-                    "gself.md:thesaurusName: Thesaurus Date is missing")
-                result["errors"].append(
-                    "gself.md:thesaurusName: Thesaurus Date Type is missing")
-                result["errors"].append(
-                    "gself.md:EX_Extent: extent element is missing")
-                result["errors"].append(
-                    "gself.md:EX_GeographicBoundingBox: bbox is missing")
-                result["errors"].append(
-                    "Both gself.md:EX_TemporalExtent and gself.md:CI_Date are missing")
-                result["errors"].append("gself.md:useLimitation is missing")
-                result["errors"].append(
-                    "gself.md:accessConstraints is missing")
-                result["errors"].append("gself.md:otherConstraints is missing")
-                errors += 20
-            else:
-                if self.md.identification.contact is (None or '') or len(
-                        self.md.identification.contact) < 1:
-                    result["errors"].append(
-                        "gself.md:CI_ResponsibleParty: Organization missing")
-                    result["errors"].append(
-                        "gself.md:CI_ResponsibleParty: E-mail missing")
-                    result["errors"].append(
-                        "gself.md:CI_ResponsibleParty: Role missing")
-                    errors += 3
-                else:
-                    if self.md.identification.contact[0].organization is (None or '') :
-                        result["errors"].append(
-                            "gself.md:CI_ResponsibleParty: Organization missing")
-                        errors += 1
-                    if self.md.identification.contact[0].email is (None or ''):
-                        result["errors"].append(
-                            "gself.md:CI_ResponsibleParty: E-mail missing")
-                        errors += 1
-                    if self.md.identification.contact[0].role is (None or ''):
-                        result["errors"].append(
-                            "gself.md:CI_ResponsibleParty: Role missing")
-                        errors += 1
 
-                if self.md.identification.title is (None or ''):
-                    result["errors"].append(
-                        "gself.md:self.md_DataIdentification: Title is missing")
-                    errors += 1
-                if self.md.identification.abstract is (None or ''):
-                    result["errors"].append(
-                        "gself.md:self.md_DataIdentification: Abstract is missing")
-                    errors += 1
-                if self.md.identification.identtype is (None or ''):
-                    result["errors"].append(
-                        "gself.md:self.md_ScopeCode: Resource Type is missing")
-                    errors += 1
-                if self.md.identification.resourcelanguage is (None or '') or len(
-                        self.md.identification.resourcelanguage) < 1 or\
-                        self.md.identification.resourcelanguage[0] == '':
-                    result["errors"].append(
-                        "gself.md:language: Resource Language is missing")
-                    errors += 1
-                if self.md.identification.uricode is (None or '') or len(
-                        self.md.identification.uricode) < 1 or\
-                        self.md.identification.uricode[0] == '':
-                    result["errors"].append(
-                        "gself.md:RS_Identifier: Unique Resource Identifier is missing")
-                    errors += 1
-                if self.md.identification.topiccategory is (None or '') or len(
-                        self.md.identification.topiccategory) < 1 or\
-                        self.md.identification.topiccategory[0] == '':
-                    result["errors"].append(
-                        "gself.md:topicCategory: TopicCategory is missing")
-                    errors += 1
-                if self.md.identification.keywords is (None or '') or len(
-                        self.md.identification.keywords) < 1 or\
-                        self.md.identification.keywords[0] == '':
-                    result["errors"].append(
-                        "gself.md:self.md_Keywords: Keywords are missing")
-                    result["errors"].append(
-                        "gself.md:thesaurusName: Thesaurus Title is missing")
-                    result["errors"].append(
-                        "gself.md:thesaurusName: Thesaurus Date is missing")
-                    result["errors"].append(
-                        "gself.md:thesaurusName: Thesaurus Date Type is missing")
-                    errors += 4
-                else:
-                    if self.md.identification.keywords[0]['keywords'] is (None or '') or len(
-                            self.md.identification.keywords[0]['keywords']) < 1 :
-                        result["errors"].append(
-                            "gself.md:self.md_Keywords: Keywords are missing")
-                        errors += 1
-                    if self.md.identification.keywords[0]['thesaurus'] is (None or ''):
-                        result["errors"].append(
-                            "gself.md:thesaurusName: Thesaurus Title is missing")
-                        result["errors"].append(
-                            "gself.md:thesaurusName: Thesaurus Date is missing")
-                        result["errors"].append(
-                            "gself.md:thesaurusName: Thesaurus Date Type is missing")
-                        errors += 3
-                    else:
-                        if self.md.identification.keywords[
-                                0]['thesaurus']['title'] is (None or ''):
-                            result["errors"].append(
-                                "gself.md:thesaurusName: Thesaurus Title is missing")
-                            errors += 1
-                        if self.md.identification.keywords[
-                                0]['thesaurus']['date'] is (None or ''):
-                            result["errors"].append(
-                                "gself.md:thesaurusName: Thesaurus Date is missing")
-                            errors += 1
-                        if self.md.identification.keywords[0][
-                                'thesaurus']['datetype'] is (None or ''):
-                            result["errors"].append(
-                                "gself.md:thesaurusName: Thesaurus Date Type is missing")
-                            errors += 1
-                if self.md.identification.extent is (None or '') :
-                    result["errors"].append(
-                        "gself.md:EX_Extent: extent element is missing")
-                    errors += 1
-                else:
-                    if self.md.identification.extent.boundingBox is (None or ''):
-                        result["errors"].append(
-                            "gself.md:EX_GeographicBoundingBox: bbox is missing")
-                        errors += 1
-                    else:
-                        if self.md.identification.extent.boundingBox.minx is (None or ''):
-                            result["errors"].append(
-                                "gself.md:westBoundLongitude: minx is missing")
-                            errors += 1
-                        if self.md.identification.extent.boundingBox.maxx is (None or ''):
-                            result["errors"].append(
-                                "gself.md:eastBoundLongitude: maxx is missing")
-                            errors += 1
-                        if self.md.identification.extent.boundingBox.miny is (None or ''):
-                            result["errors"].append(
-                                "gself.md:southBoundLatitude: miny is missing")
-                            errors += 1
-                        if self.md.identification.extent.boundingBox.maxy is (None or ''):
-                            result["errors"].append(
-                                "gself.md:northBoundLatitude: maxy is missing")
-                            errors += 1
-               
-                if len(
-                        self.md.identification.date) < 1 and (
-                        self.md.identification.temporalextent_start is (None or '') or self.md.identification.temporalextent_end is (None or '')):
-                    result["errors"].append(
-                        "Both gself.md:EX_TemporalExtent and gself.md:CI_Date are missing")
-                    errors += 1
-
-                if len(self.md.identification.uselimitation) < 1 or\
-                         self.md.identification.uselimitation[0] == '':
-                    result["errors"].append(
-                        "gself.md:useLimitation is missing")
-                    errors += 1
-                if len(self.md.identification.accessconstraints) < 1 or\
-                        self.md.identification.accessconstraints[0] == '':
-                    result["errors"].append(
-                        "gself.md:accessConstraints is missing")
-                    errors += 1
-                if len(self.md.identification.otherconstraints) < 1 or\
-                        self.md.identification.otherconstraints[0] == '':
-                    result["errors"].append(
-                        "gself.md:otherConstraints is missing")
-                    errors += 1
-
-            if self.md.languagecode is (None or ''):
-                result["errors"].append(
-                    "gself.md:LanguageCode: Language code missing")
-                errors += 1
-            if self.md.datestamp is (None or ''):
-                result["errors"].append("gself.md:dateStamp: Date is missing")
-                errors += 1
-            if self.md.identifier is (None or ''):
-                result["errors"].append(
-                    "gself.md:identifier: Identifier is missing")
-                errors += 1
-            if self.md.dataquality is (None or ''):
-                result["errors"].append("gself.md:LI_Lineage is missing")
-                result["errors"].append(
-                    "gself.md:DQ_ConformanceResult: date is missing")
-                result["errors"].append(
-                    "gself.md:DQ_ConformanceResult: date type is missing")
-                # result["errors"].append("gself.md:DQ_ConformanceResult: degree is missing")
-                result["errors"].append(
-                    "gself.md:DQ_ConformanceResult: title is missing")
-                errors += 4
-            else:
-                if self.md.dataquality.lineage is (None or ''):
-                    result["errors"].append("gself.md:LI_Lineage is missing")
-                    errors += 1
-                if len(self.md.dataquality.conformancedate) < 1 or \
-                    self.md.dataquality.conformancedate[0] == '':
-                    result["errors"].append(
-                        "gself.md:DQ_ConformanceResult: date is missing")
-                    errors += 1
-                if len(self.md.dataquality.conformancedatetype) < 1 or\
-                       self.md.dataquality.conformancedatetype[0] == '' :
-                    result["errors"].append(
-                        "gself.md:DQ_ConformanceResult: date type is missing")
-                    errors += 1
-                # if len(self.md.dataquality.conformancedegree) < 1:
-                #     result["errors"].append("gself.md:DQ_ConformanceResult: degree is missing")
-                #     errors += 1
-                if len(self.md.dataquality.conformancetitle) < 1 or\
-                    self.md.dataquality.conformancetitle[0] == '':
-                    result["errors"].append(
-                        "gself.md:DQ_ConformanceResult: title is missing")
-                    errors += 1
-
-            if self.md.contact is (None or ''):
-                result["errors"].append(
-                    "gself.md:contact: Organization name is missing")
-                result["errors"].append("gself.md:contact: e-mail is missing")
-                errors += 2
-            else:
-
-                if self.md.contact[0].organization is (None or ''):
-                    result["errors"].append(
-                        "gself.md:contact: Organization name is missing")
-                    errors += 1
-                if self.md.contact[0].email is (None or ''):
-                    result["errors"].append(
-                        "gself.md:contact: e-mail is missing")
-                    errors += 1
-
+    def validate_inspire(self, md):
+            result,errors=mdutil.isnpireValidator(md)
             if errors > 0:
                 result["status"] = "failed"
                 result["num_of_errors"] = str(errors)
-            # print result
             str1 = 'INSPIRE VALIDATOR\n'
             str1 += 'Status of validation: ' + result["status"] + '\n'
             str1 += 'Numbers of errors: ' + result["num_of_errors"] + '\n'
@@ -988,10 +858,10 @@
                 str1 += 'Errors:\n'
                 for item in result["errors"]:
                     str1 += '\t' + str(item) + '\n'
-        except:
-            str1 = 'Metadata loading error'
+        
+           #str1 = 'Metadata loading error'
 
-        self.text.SetValue(str1)
+            self.text.SetValue(str1)
 
 
 #----------------------------------------------------------------------

Modified: sandbox/krejcmat/src/jinjainfo.py
===================================================================
--- sandbox/krejcmat/src/jinjainfo.py	2014-08-01 17:47:01 UTC (rev 61498)
+++ sandbox/krejcmat/src/jinjainfo.py	2014-08-01 18:47:11 UTC (rev 61499)
@@ -147,7 +147,6 @@
                         self.mdOWSTag.append(object)
 
         except IOError as e:
-            pass
             print "I/O error({0}): {1}".format(e.errno, e.strerror)
 
     def _readJinjaInfo(self):

Modified: sandbox/krejcmat/src/mdgrass.py
===================================================================
--- sandbox/krejcmat/src/mdgrass.py	2014-08-01 17:47:01 UTC (rev 61498)
+++ sandbox/krejcmat/src/mdgrass.py	2014-08-01 18:47:11 UTC (rev 61499)
@@ -33,8 +33,9 @@
 from grass.script import core as grass
 import StringIO
 import subprocess as sub
+import uuid
 
-
+import mdutil
 class GrassMD():
 
     def __init__(self, map, type):
@@ -72,7 +73,7 @@
 
     def readXML(self, xml_file):
         '''create instance of metadata(owslib) from xml file'''
-        print xml_file
+        #print xml_file
         self.md = MD_Metadata(etree.parse(xml_file))
         
     def parseRast3D(self):
@@ -84,20 +85,20 @@
 
         # parse md from v.info flags=-g -e -t
         vinfo = Module(
-            'v.info',
-            self.map,
-            flags='get',
-            quiet=True,
-            stdout_=PIPE)
+                        'v.info',
+                        self.map,
+                        flags='get',
+                        quiet=True,
+                        stdout_=PIPE)
         self.md_grass = parse_key_val(vinfo.outputs.stdout)
 
         # parse md from v.info flag h (history of map in grass)
         rinfo_h = Module(
-            'v.info',
-            self.map,
-            flags='h',
-            quiet=True,
-            stdout_=PIPE)
+                        'v.info',
+                        self.map,
+                        flags='h',
+                        quiet=True,
+                        stdout_=PIPE)
         md_h_grass = rinfo_h.outputs.stdout
         buf = StringIO.StringIO(md_h_grass)
         line = buf.readline().splitlines()
@@ -160,6 +161,7 @@
             self.md_grass['comments']=self.md_grass['comments'].replace('\n','\\n')
         except:
             pass
+        
         n = '$NULL'
         # jinja templates
         if template is None:
@@ -180,36 +182,34 @@
         val.email = n
         val.role = n
         self.md.contact.append(val)
-        self.md.languagecode = n
+        
 
         # Identification/Resource Title
-        self.md.identification.title = self.md_grass['title']
-        self.md.datestamp = date.today().isoformat()
+        self.md.identification.title = mdutil.replaceXMLReservedChar(self.md_grass['title'])
+        self.md.datestamp = mdutil.replaceXMLReservedChar(date.today().isoformat())
 
-        # Identification/Resource Locator
-        val = CI_OnlineResource()
-        val.url = n
-        self.md.distribution.online.append(val)
 
+
         # Identification/Resource Type
         self.md.identification.identtype = 'dataset'
 
         # Identification/Unique Resource Identifier
-        self.md.identifier = n
+        self.md.identifier = mdutil.replaceXMLReservedChar(str(uuid.uuid4()) )
         self.md.identification.uricode.append(n)
-
+        self.md.identification.uricodespace.append(n)
+        
         # Geographic/BB
-        self.md.identification.extent.boundingBox.minx = self.md_grass['south']
-        self.md.identification.extent.boundingBox.maxx = self.md_grass['north']
-        self.md.identification.extent.boundingBox.miny = self.md_grass['west']
-        self.md.identification.extent.boundingBox.maxy = self.md_grass['east']
+        self.md.identification.extent.boundingBox.minx = mdutil.replaceXMLReservedChar(self.md_grass['south'])
+        self.md.identification.extent.boundingBox.maxx = mdutil.replaceXMLReservedChar(self.md_grass['north'])
+        self.md.identification.extent.boundingBox.miny = mdutil.replaceXMLReservedChar(self.md_grass['west'])
+        self.md.identification.extent.boundingBox.maxy = mdutil.replaceXMLReservedChar(self.md_grass['east'])
 
         # Conformity/Title
         self.md.dataquality.conformancetitle.append(
             'GRASS basic metadata profile based on ISO 19115, 19139')
 
         # Conformity/Date:
-        self.md.dataquality.conformancedate.append(date.today().isoformat())
+        self.md.dataquality.conformancedate.append(mdutil.replaceXMLReservedChar(date.today().isoformat()))
         self.md.dataquality.conformancedatetype.append('publication')
 
         # Temporal/Date of creation
@@ -217,31 +217,39 @@
         val.date = self.md_grass['dateofcreation']
         val.type = 'creation'
         self.md.identification.date.append(val)
-
+        
+        self.md.identification.denominators.append(n)
+        self.md.identification.uom.append(n)#TODO
+        
         # different metadata sources for vector and raster
         if self.type == 'cell':
             # Identification/Resource Abstract
-            self.md.identification.abstract = self.md_abstract
+            self.md.identification.abstract = mdutil.replaceXMLReservedChar(self.md_abstract)
 
             # Geographic/resolution
-            self.md.identification.uom.append(' ')
-            self.md.identification.distance.append(
-                self.md_grass['nsres'])  # TODO for discuss
 
+            self.md.identification.distance.append(mdutil.replaceXMLReservedChar(self.md_grass['nsres']))  # TODO for discuss
+
+
             # Quality/Lineage
-            self.md.dataquality.lineage = self.md_grass['comments']
+            try:
+                self.md.dataquality.lineage = mdutil.replaceXMLReservedChar(mdutil.replaceXMLReservedChar(self.md_grass['comments']))
+            except:
+                grass.warning('Native metadata *comments* not found, dataquality.lineage filled by $NULL')
+                self.md.dataquality.lineage = n
 
             # Organisation/Responsible Party:
             val = CI_ResponsibleParty()
-            val.organization = getpass.getuser()
+            val.organization = mdutil.replaceXMLReservedChar(getpass.getuser())
             val.role = 'owner'
             self.md.identification.contact.append(val)
 
         if self.type == 'vector':
+            
             # Identification/Resource Abstract
             # TODO not enough sources for crate abstarce
-            self.md.identification.abstract = self.md_grass['name']
-            self.md.dataquality.lineage = self.md_vinfo_h
+            self.md.identification.abstract = mdutil.replaceXMLReservedChar(self.md_grass['name'])
+            self.md.dataquality.lineage = mdutil.replaceXMLReservedChar(self.md_vinfo_h)
 
             # Organisation/Responsible Party:
             val = CI_ResponsibleParty()
@@ -249,6 +257,7 @@
             val.role = 'owner'
             self.md.identification.contact.append(val)
         self.templatePathAbs=os.path.join(self.dirpath,self.template)
+
         
     def createGrassInspireISO(self,template=None):
         '''Create valid INSPIRE profile and fill it as much as possible by GRASS metadata. Missing values is $NULL
@@ -267,18 +276,18 @@
 
         n = '$NULL'
         self.md.datestamp = n
-
+        if len(self.md.identification.distance)==0:
+            self.md.identification.distance.append(n)#TODO
         # Classification/Topic Category
         self.md.identification.topiccategory.append(n)
         self.md.identification.resourcelanguage.append(n)
-
+        self.md.languagecode = n
         # Keyword/Keyword
         kw = {}
         kw['keywords'] = []
         kw['keywords'].append(n)
-        kw['keywords'].append(n)
 
-        kw['type'] = None
+        kw['type'] = n
         kw['thesaurus'] = {}
         kw['thesaurus']['date'] = n
         kw['thesaurus']['datetype'] = n
@@ -290,7 +299,10 @@
         self.md.dataquality.conformancetitle.pop()
         self.md.dataquality.conformancetitle.append(
             'Commission Regulation (EU) No 1089/2010 of 23 November 2010 implementing Directive 2007/2/EC of the European Parliament and of the Council as regards interoperability of spatial data sets and services')
-
+        # Identification/Resource Locator
+        val = CI_OnlineResource()
+        val.url = n
+        self.md.distribution.online.append(val)
         # Conformity/Date
         self.md.dataquality.conformancedate.append(n)
         self.md.dataquality.conformancedatetype.append(n)
@@ -308,7 +320,10 @@
         # Temporal/Temporal Extent
         self.md.identification.temporalextent_start = n
         self.md.identification.temporalextent_end = n
+
         self.templatePathAbs=os.path.join(self.dirpath,self.template)
+
+      
     def saveXML(self, path=None, xml_out_name=None):
         ''' Save custom record to ISO XML file'''
 
@@ -329,8 +344,11 @@
         env.globals.update(zip=zip)
         template = env.get_template(self.template)
         iso_xml = template.render(md=self.md)
-        xml_file = xml_out_name
-
+       #xml_file = xml_out_name
+       
+        #control validity of xml and ascii characters
+        #iso_xml=mdutil.strip_control_characters(iso_xml)
+       
         # write xml to flat file
         try:
             xml_file = open(path, "w")

Added: sandbox/krejcmat/src/mdutil.py
===================================================================
--- sandbox/krejcmat/src/mdutil.py	                        (rev 0)
+++ sandbox/krejcmat/src/mdutil.py	2014-08-01 18:47:11 UTC (rev 61499)
@@ -0,0 +1,290 @@
+#!/usr/bin/env python
+# -*- coding: utf-8
+#===============================================================================
+# def strip_control_characters(input):  
+#       
+#     if input:  
+#               
+#         import re  
+#           
+#         # unicode invalid characters  
+#         RE_XML_ILLEGAL = u'([\u0000-\u0008\u000b-\u000c\u000e-\u001f\ufffe-\uffff])' +   \
+#                          u'|' + \
+#                          u'([%s-%s][^%s-%s])|([^%s-%s][%s-%s])|([%s-%s]$)|(^[%s-%s])' %   \
+#                           (unichr(0xd800),unichr(0xdbff),unichr(0xdc00),unichr(0xdfff),  
+#                            unichr(0xd800),unichr(0xdbff),unichr(0xdc00),unichr(0xdfff),  
+#                            unichr(0xd800),unichr(0xdbff),unichr(0xdc00),unichr(0xdfff),  
+#                            )  
+#         input = re.sub(RE_XML_ILLEGAL, "", input)  
+#                           
+#         # ascii control characters  
+#         input = re.sub(r"[\x01-\x1F\x7F]", "", input)  
+#               
+#     return input
+#===============================================================================
+
+def replaceXMLReservedChar(input):
+    if input:   
+            import re  
+
+            input = re.sub('<', '<', input)
+            input = re.sub('>', '>', input)
+            input = re.sub('&', '&', input)
+            input = re.sub('%', '%', input)
+                        
+
+    return input
+
+def isnpireValidator( md):
+            '''function for validation INSPIRE XML file'''
+
+
+            result = {}
+            result["status"] = "succeded"
+            result["errors"] = []
+            result["num_of_errors"] = "0"
+            errors = 0
+
+            if md.identification is (None or ''):
+                result["errors"].append(
+                    "gmd:CI_ResponsibleParty: Organization missing")
+                result["errors"].append(
+                    "gmd:CI_ResponsibleParty: E-mail missing")
+                result["errors"].append(
+                    "gmd:CI_ResponsibleParty: Role missing")
+                result["errors"].append(
+                    "gmd:md_DataIdentification: Title is missing")
+                result["errors"].append(
+                    "gmd:md_DataIdentification: Abstract is missing")
+                result["errors"].append(
+                    "gmd:md_ScopeCode: Resource Type is missing")
+                result["errors"].append(
+                    "gmd:language: Resource Language is missing")
+                result["errors"].append(
+                    "gmd:RS_Identifier: Unique Resource Identifier is missing")
+                result["errors"].append(
+                    "gmd:topicCategory: TopicCategory is missing")
+                result["errors"].append(
+                    "gmd:md_Keywords: Keywords are missing")
+                result["errors"].append(
+                    "gmd:thesaurusName: Thesaurus Title is missing")
+                result["errors"].append(
+                    "gmd:thesaurusName: Thesaurus Date is missing")
+                result["errors"].append(
+                    "gmd:thesaurusName: Thesaurus Date Type is missing")
+                result["errors"].append(
+                    "gmd:EX_Extent: extent element is missing")
+                result["errors"].append(
+                    "gmd:EX_GeographicBoundingBox: bbox is missing")
+                result["errors"].append(
+                    "Both gmd:EX_TemporalExtent and gmd:CI_Date are missing")
+                result["errors"].append("gmd:useLimitation is missing")
+                result["errors"].append(
+                    "gmd:accessConstraints is missing")
+                result["errors"].append("gmd:otherConstraints is missing")
+                errors += 20
+            else:
+                if md.identification.contact is (None or '') or len(
+                        md.identification.contact) < 1:
+                    result["errors"].append(
+                        "gmd:CI_ResponsibleParty: Organization missing")
+                    result["errors"].append(
+                        "gmd:CI_ResponsibleParty: E-mail missing")
+                    result["errors"].append(
+                        "gmd:CI_ResponsibleParty: Role missing")
+                    errors += 3
+                else:
+                    if md.identification.contact[0].organization is (None or '') :
+                        result["errors"].append(
+                            "gmd:CI_ResponsibleParty: Organization missing")
+                        errors += 1
+                    if md.identification.contact[0].email is (None or ''):
+                        result["errors"].append(
+                            "gmd:CI_ResponsibleParty: E-mail missing")
+                        errors += 1
+                    if md.identification.contact[0].role is (None or ''):
+                        result["errors"].append(
+                            "gmd:CI_ResponsibleParty: Role missing")
+                        errors += 1
+
+                if md.identification.title is (None or ''):
+                    result["errors"].append(
+                        "gmd:md_DataIdentification: Title is missing")
+                    errors += 1
+                if md.identification.abstract is (None or ''):
+                    result["errors"].append(
+                        "gmd:md_DataIdentification: Abstract is missing")
+                    errors += 1
+                if md.identification.identtype is (None or ''):
+                    result["errors"].append(
+                        "gmd:md_ScopeCode: Resource Type is missing")
+                    errors += 1
+                if md.identification.resourcelanguage is (None or '') or len(
+                        md.identification.resourcelanguage) < 1 or\
+                        md.identification.resourcelanguage[0] == '':
+                    result["errors"].append(
+                        "gmd:language: Resource Language is missing")
+                    errors += 1
+                if md.identification.uricode is (None or '') or len(
+                        md.identification.uricode) < 1 or\
+                        md.identification.uricode[0] == '':
+                    result["errors"].append(
+                        "gmd:RS_Identifier: Unique Resource Identifier is missing")
+                    errors += 1
+                if md.identification.topiccategory is (None or '') or len(
+                        md.identification.topiccategory) < 1 or\
+                        md.identification.topiccategory[0] == '':
+                    result["errors"].append(
+                        "gmd:topicCategory: TopicCategory is missing")
+                    errors += 1
+                if md.identification.keywords is (None or '') or len(
+                        md.identification.keywords) < 1 or\
+                        md.identification.keywords[0] == '':
+                    result["errors"].append(
+                        "gmd:md_Keywords: Keywords are missing")
+                    result["errors"].append(
+                        "gmd:thesaurusName: Thesaurus Title is missing")
+                    result["errors"].append(
+                        "gmd:thesaurusName: Thesaurus Date is missing")
+                    result["errors"].append(
+                        "gmd:thesaurusName: Thesaurus Date Type is missing")
+                    errors += 4
+                else:
+                    if md.identification.keywords[0]['keywords'] is (None or '') or len(
+                            md.identification.keywords[0]['keywords']) < 1 :
+                        result["errors"].append(
+                            "gmd:md_Keywords: Keywords are missing")
+                        errors += 1
+                    if md.identification.keywords[0]['thesaurus'] is (None or ''):
+                        result["errors"].append(
+                            "gmd:thesaurusName: Thesaurus Title is missing")
+                        result["errors"].append(
+                            "gmd:thesaurusName: Thesaurus Date is missing")
+                        result["errors"].append(
+                            "gmd:thesaurusName: Thesaurus Date Type is missing")
+                        errors += 3
+                    else:
+                        if md.identification.keywords[
+                                0]['thesaurus']['title'] is (None or ''):
+                            result["errors"].append(
+                                "gmd:thesaurusName: Thesaurus Title is missing")
+                            errors += 1
+                        if md.identification.keywords[
+                                0]['thesaurus']['date'] is (None or ''):
+                            result["errors"].append(
+                                "gmd:thesaurusName: Thesaurus Date is missing")
+                            errors += 1
+                        if md.identification.keywords[0][
+                                'thesaurus']['datetype'] is (None or ''):
+                            result["errors"].append(
+                                "gmd:thesaurusName: Thesaurus Date Type is missing")
+                            errors += 1
+                if md.identification.extent is (None or '') :
+                    result["errors"].append(
+                        "gmd:EX_Extent: extent element is missing")
+                    errors += 1
+                else:
+                    if md.identification.extent.boundingBox is (None or ''):
+                        result["errors"].append(
+                            "gmd:EX_GeographicBoundingBox: bbox is missing")
+                        errors += 1
+                    else:
+                        if md.identification.extent.boundingBox.minx is (None or ''):
+                            result["errors"].append(
+                                "gmd:westBoundLongitude: minx is missing")
+                            errors += 1
+                        if md.identification.extent.boundingBox.maxx is (None or ''):
+                            result["errors"].append(
+                                "gmd:eastBoundLongitude: maxx is missing")
+                            errors += 1
+                        if md.identification.extent.boundingBox.miny is (None or ''):
+                            result["errors"].append(
+                                "gmd:southBoundLatitude: miny is missing")
+                            errors += 1
+                        if md.identification.extent.boundingBox.maxy is (None or ''):
+                            result["errors"].append(
+                                "gmd:northBoundLatitude: maxy is missing")
+                            errors += 1
+               
+                if len( md.identification.date) < 1 or (md.identification.temporalextent_start is (None or '') or md.identification.temporalextent_end is (None or '')):
+                    result["errors"].append(
+                        "Both gmd:EX_TemporalExtent and gmd:CI_Date are missing")
+                    errors += 1
+
+                if len(md.identification.uselimitation) < 1 or\
+                         md.identification.uselimitation[0] == '':
+                    result["errors"].append(
+                        "gmd:useLimitation is missing")
+                    errors += 1
+                if len(md.identification.accessconstraints) < 1 or\
+                        md.identification.accessconstraints[0] == '':
+                    result["errors"].append(
+                        "gmd:accessConstraints is missing")
+                    errors += 1
+                if len(md.identification.otherconstraints) < 1 or\
+                        md.identification.otherconstraints[0] == '':
+                    result["errors"].append(
+                        "gmd:otherConstraints is missing")
+                    errors += 1
+
+            if md.languagecode is (None or ''):
+                result["errors"].append(
+                    "gmd:LanguageCode: Language code missing")
+                errors += 1
+            if md.datestamp is (None or ''):
+                result["errors"].append("gmd:dateStamp: Date is missing")
+                errors += 1
+            if md.identifier is (None or ''):
+                result["errors"].append(
+                    "gmd:identifier: Identifier is missing")
+                errors += 1
+            if md.dataquality is (None or ''):
+                result["errors"].append("gmd:LI_Lineage is missing")
+                result["errors"].append(
+                    "gmd:DQ_ConformanceResult: date is missing")
+                result["errors"].append(
+                    "gmd:DQ_ConformanceResult: date type is missing")
+                # result["errors"].append("gmd:DQ_ConformanceResult: degree is missing")
+                result["errors"].append(
+                    "gmd:DQ_ConformanceResult: title is missing")
+                errors += 4
+            else:
+                if md.dataquality.lineage is (None or ''):
+                    result["errors"].append("gmd:LI_Lineage is missing")
+                    errors += 1
+                if len(md.dataquality.conformancedate) < 1 or \
+                    md.dataquality.conformancedate[0] == '':
+                    result["errors"].append(
+                        "gmd:DQ_ConformanceResult: date is missing")
+                    errors += 1
+                if len(md.dataquality.conformancedatetype) < 1 or\
+                       md.dataquality.conformancedatetype[0] == '' :
+                    result["errors"].append(
+                        "gmd:DQ_ConformanceResult: date type is missing")
+                    errors += 1
+                # if len(md.dataquality.conformancedegree) < 1:
+                #     result["errors"].append("gmd:DQ_ConformanceResult: degree is missing")
+                #     errors += 1
+                if len(md.dataquality.conformancetitle) < 1 or\
+                    md.dataquality.conformancetitle[0] == '':
+                    result["errors"].append(
+                        "gmd:DQ_ConformanceResult: title is missing")
+                    errors += 1
+
+            if md.contact is (None or ''):
+                result["errors"].append(
+                    "gmd:contact: Organization name is missing")
+                result["errors"].append("gmd:contact: e-mail is missing")
+                errors += 2
+            else:
+
+                if md.contact[0].organization is (None or ''):
+                    result["errors"].append(
+                        "gmd:contact: Organization name is missing")
+                    errors += 1
+                if md.contact[0].email is (None or ''):
+                    result["errors"].append(
+                        "gmd:contact: e-mail is missing")
+                    errors += 1
+            return result,errors
+        
\ No newline at end of file

Added: sandbox/krejcmat/src/metadata/full.xml
===================================================================
--- sandbox/krejcmat/src/metadata/full.xml	                        (rev 0)
+++ sandbox/krejcmat/src/metadata/full.xml	2014-08-01 18:47:11 UTC (rev 61499)
@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmd:MD_Metadata xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd"
+    xmlns:gmd="http://www.isotc211.org/2005/gmd"
+    xmlns:gco="http://www.isotc211.org/2005/gco"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:gml="http://www.opengis.net/gml"
+    xmlns:xlink="http://www.w3.org/1999/xlink">
+    <gmd:fileIdentifier>
+        <gco:CharacterString>286c0725-146e-4533-b1bf-d6e367f6c342</gco:CharacterString>
+    </gmd:fileIdentifier>
+    <gmd:language>
+        <gmd:LanguageCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#LanguageCode" codeListValue="eng">eng</gmd:LanguageCode>
+    </gmd:language>
+    <gmd:hierarchyLevel>
+        <gmd:MD_ScopeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_ScopeCode" codeListValue="dataset">dataset</gmd:MD_ScopeCode>
+    </gmd:hierarchyLevel>
+    <gmd:contact>
+        <gmd:CI_ResponsibleParty>
+            <gmd:organisationName>
+                <gco:CharacterString>xouxoutos</gco:CharacterString>
+            </gmd:organisationName>
+            <gmd:contactInfo>
+                <gmd:CI_Contact>
+                    <gmd:address>
+                        <gmd:CI_Address>
+                            <gmd:electronicMailAddress>
+                                <gco:CharacterString>foufoutos at gmail.com</gco:CharacterString>
+                            </gmd:electronicMailAddress>
+                            <gmd:electronicMailAddress>
+                                <gco:CharacterString>tsiou at gmail.com</gco:CharacterString>
+                            </gmd:electronicMailAddress>
+                        </gmd:CI_Address>
+                    </gmd:address>
+                </gmd:CI_Contact>
+            </gmd:contactInfo>
+            <gmd:role>
+                <gmd:CI_RoleCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact">pointOfContact</gmd:CI_RoleCode>
+            </gmd:role>
+        </gmd:CI_ResponsibleParty>
+    </gmd:contact>
+    <gmd:contact>
+        <gmd:CI_ResponsibleParty>
+            <gmd:organisationName>
+                <gco:CharacterString>momos</gco:CharacterString>
+            </gmd:organisationName>
+            <gmd:contactInfo>
+                <gmd:CI_Contact>
+                    <gmd:address>
+                        <gmd:CI_Address>
+                            <gmd:electronicMailAddress>
+                                <gco:CharacterString>kokos at gmail.com</gco:CharacterString>
+                            </gmd:electronicMailAddress>
+                            <gmd:electronicMailAddress>
+                                <gco:CharacterString>lolos at gmail.com</gco:CharacterString>
+                            </gmd:electronicMailAddress>
+                        </gmd:CI_Address>
+                    </gmd:address>
+                </gmd:CI_Contact>
+            </gmd:contactInfo>
+            <gmd:role>
+                <gmd:CI_RoleCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact">pointOfContact</gmd:CI_RoleCode>
+            </gmd:role>
+        </gmd:CI_ResponsibleParty>
+    </gmd:contact>
+    <gmd:dateStamp>
+        <gco:Date>2014-05-20</gco:Date>
+    </gmd:dateStamp>
+    <gmd:metadataStandardName>
+        <gco:CharacterString>ISO19115</gco:CharacterString>
+    </gmd:metadataStandardName>
+    <gmd:metadataStandardVersion>
+        <gco:CharacterString>2003/Cor.1:2006</gco:CharacterString>
+    </gmd:metadataStandardVersion>
+    <gmd:identificationInfo>
+        <gmd:MD_DataIdentification>
+            <gmd:citation>
+                <gmd:CI_Citation>
+                    <gmd:title>
+                        <gco:CharacterString>Title bla bla</gco:CharacterString>
+                    </gmd:title>
+                    <gmd:date>
+                        <gmd:CI_Date>
+                            <gmd:date>
+                                <gco:Date>2014-05-06</gco:Date>
+                            </gmd:date>
+                            <gmd:dateType>
+                                <gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication">publication</gmd:CI_DateTypeCode>
+                            </gmd:dateType>
+                        </gmd:CI_Date>
+                    </gmd:date>
+                    <gmd:date>
+                        <gmd:CI_Date>
+                            <gmd:date>
+                                <gco:Date>2014-05-08</gco:Date>
+                            </gmd:date>
+                            <gmd:dateType>
+                                <gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication">publication</gmd:CI_DateTypeCode>
+                            </gmd:dateType>
+                        </gmd:CI_Date>
+                    </gmd:date>
+                    <gmd:date>
+                        <gmd:CI_Date>
+                            <gmd:date>
+                                <gco:Date>2014-05-01</gco:Date>
+                            </gmd:date>
+                            <gmd:dateType>
+                                <gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue="creation">creation</gmd:CI_DateTypeCode>
+                            </gmd:dateType>
+                        </gmd:CI_Date>
+                    </gmd:date>
+                    <gmd:date>
+                        <gmd:CI_Date>
+                            <gmd:date>
+                                <gco:Date>2014-05-12</gco:Date>
+                            </gmd:date>
+                            <gmd:dateType>
+                                <gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue="revision">revision</gmd:CI_DateTypeCode>
+                            </gmd:dateType>
+                        </gmd:CI_Date>
+                    </gmd:date>
+                    <gmd:identifier>
+                        <gmd:RS_Identifier>
+                            <gmd:code>
+                                <gco:CharacterString>286c0725-146e-4533-b1bf-d6e367f6c342</gco:CharacterString>
+                            </gmd:code>
+                        </gmd:RS_Identifier>
+                    </gmd:identifier>
+                </gmd:CI_Citation>
+            </gmd:citation>
+            <gmd:abstract>
+                <gco:CharacterString>Abstract blah blah</gco:CharacterString>
+            </gmd:abstract>
+            <gmd:pointOfContact>
+                <gmd:CI_ResponsibleParty>
+                    <gmd:organisationName>
+                        <gco:CharacterString>NTUA</gco:CharacterString>
+                    </gmd:organisationName>
+                    <gmd:contactInfo>
+                        <gmd:CI_Contact>
+                            <gmd:address>
+                                <gmd:CI_Address>
+                                    <gmd:electronicMailAddress>
+                                        <gco:CharacterString>lolo2 at gmail.com</gco:CharacterString>
+                                    </gmd:electronicMailAddress>
+                                </gmd:CI_Address>
+                            </gmd:address>
+                        </gmd:CI_Contact>
+                    </gmd:contactInfo>
+                    <gmd:role>
+                        <gmd:CI_RoleCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_RoleCode" codeListValue="owner">owner</gmd:CI_RoleCode>
+                    </gmd:role>
+                </gmd:CI_ResponsibleParty>
+            </gmd:pointOfContact>
+            <gmd:descriptiveKeywords>
+                <gmd:MD_Keywords>
+                    <gmd:keyword>
+                        <gco:CharacterString>Agricultural and aquaculture facilities</gco:CharacterString>
+                    </gmd:keyword>
+                    <gmd:keyword>
+                        <gco:CharacterString>Bio-geographical regions</gco:CharacterString>
+                    </gmd:keyword>
+                    <gmd:thesaurusName>
+                        <gmd:CI_Citation>
+                            <gmd:title>
+                                <gco:CharacterString>GEMET - INSPIRE themes, version 1.0</gco:CharacterString>
+                            </gmd:title>
+                            <gmd:date>
+                                <gmd:CI_Date>
+                                    <gmd:date>
+                                        <gco:Date>2008-06-01</gco:Date>
+                                    </gmd:date>
+                                    <gmd:dateType>
+                                        <gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication">publication</gmd:CI_DateTypeCode>
+                                    </gmd:dateType>
+                                </gmd:CI_Date>
+                            </gmd:date>
+                        </gmd:CI_Citation>
+                    </gmd:thesaurusName>
+                </gmd:MD_Keywords>
+            </gmd:descriptiveKeywords>
+            <gmd:descriptiveKeywords>
+                <gmd:MD_Keywords>
+                    <gmd:keyword>
+                        <gco:CharacterString>test</gco:CharacterString>
+                    </gmd:keyword>
+                    <gmd:thesaurusName>
+                        <gmd:CI_Citation>
+                            <gmd:title>
+                                <gco:CharacterString>oeo</gco:CharacterString>
+                            </gmd:title>
+                            <gmd:date>
+                                <gmd:CI_Date>
+                                    <gmd:date>
+                                        <gco:Date>2014-05-20</gco:Date>
+                                    </gmd:date>
+                                    <gmd:dateType>
+                                        <gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue="creation">creation</gmd:CI_DateTypeCode>
+                                    </gmd:dateType>
+                                </gmd:CI_Date>
+                            </gmd:date>
+                        </gmd:CI_Citation>
+                    </gmd:thesaurusName>
+                </gmd:MD_Keywords>
+            </gmd:descriptiveKeywords>
+            <gmd:resourceConstraints>
+                <gmd:MD_Constraints>
+                    <gmd:useLimitation>
+                        <gco:CharacterString>no conditions apply</gco:CharacterString>
+                    </gmd:useLimitation>
+                </gmd:MD_Constraints>
+            </gmd:resourceConstraints>
+            <gmd:resourceConstraints>
+                <gmd:MD_LegalConstraints>
+                    <gmd:accessConstraints>
+                        <gmd:MD_RestrictionCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_RestrictionCode" codeListValue="otherRestrictions">otherRestrictions</gmd:MD_RestrictionCode>
+                    </gmd:accessConstraints>
+                    <gmd:otherConstraints>
+                        <gco:CharacterString>no limitations</gco:CharacterString>
+                    </gmd:otherConstraints>
+                </gmd:MD_LegalConstraints>
+            </gmd:resourceConstraints>
+            <gmd:spatialResolution>
+                <gmd:MD_Resolution>
+                    <gmd:equivalentScale>
+                        <gmd:MD_RepresentativeFraction>
+                            <gmd:denominator>
+                                <gco:Integer>5000</gco:Integer>
+                            </gmd:denominator>
+                        </gmd:MD_RepresentativeFraction>
+                    </gmd:equivalentScale>
+                </gmd:MD_Resolution>
+            </gmd:spatialResolution>
+            <gmd:spatialResolution>
+                <gmd:MD_Resolution>
+                    <gmd:distance>
+                        <gco:Distance uom="Meters">2</gco:Distance>
+                    </gmd:distance>
+                </gmd:MD_Resolution>
+            </gmd:spatialResolution>
+            <gmd:language>
+                <gmd:LanguageCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#LanguageCode" codeListValue="eng">eng</gmd:LanguageCode>
+            </gmd:language>
+            <gmd:language>
+                <gmd:LanguageCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#LanguageCode" codeListValue="gre">gre</gmd:LanguageCode>
+            </gmd:language>
+            <gmd:topicCategory>
+                <gmd:MD_TopicCategoryCode>biota</gmd:MD_TopicCategoryCode>
+            </gmd:topicCategory>
+            <gmd:topicCategory>
+                <gmd:MD_TopicCategoryCode>economy</gmd:MD_TopicCategoryCode>
+            </gmd:topicCategory>
+            <gmd:topicCategory>
+                <gmd:MD_TopicCategoryCode>environment</gmd:MD_TopicCategoryCode>
+            </gmd:topicCategory>
+            <gmd:extent>
+                <gmd:EX_Extent>
+                    <gmd:geographicElement>
+                        <gmd:EX_GeographicBoundingBox>
+                            <gmd:westBoundLongitude>
+                                <gco:Decimal>23.04</gco:Decimal>
+                            </gmd:westBoundLongitude>
+                            <gmd:eastBoundLongitude>
+                                <gco:Decimal>25.05</gco:Decimal>
+                            </gmd:eastBoundLongitude>
+                            <gmd:southBoundLatitude>
+                                <gco:Decimal>44.03</gco:Decimal>
+                            </gmd:southBoundLatitude>
+                            <gmd:northBoundLatitude>
+                                <gco:Decimal>45.01</gco:Decimal>
+                            </gmd:northBoundLatitude>
+                        </gmd:EX_GeographicBoundingBox>
+                    </gmd:geographicElement>
+                </gmd:EX_Extent>
+            </gmd:extent>
+            <gmd:extent>
+                <gmd:EX_Extent>
+                    <gmd:temporalElement>
+                        <gmd:EX_TemporalExtent>
+                            <gmd:extent>
+                                <gml:TimePeriod gml:id="ID_05d1d6c2-111f-4dc5-b51d-551a93cfdbbc" xsi:type="gml:TimePeriodType">
+                                    <gml:beginPosition>2014-05-20</gml:beginPosition>
+                                    <gml:endPosition>2014-05-21</gml:endPosition>
+                                </gml:TimePeriod>
+                            </gmd:extent>
+                        </gmd:EX_TemporalExtent>
+                    </gmd:temporalElement>
+                </gmd:EX_Extent>
+            </gmd:extent>
+        </gmd:MD_DataIdentification>
+    </gmd:identificationInfo>
+    <gmd:distributionInfo>
+        <gmd:MD_Distribution>
+            <gmd:distributionFormat>
+                <gmd:MD_Format>
+                    <gmd:name gco:nilReason="inapplicable"/>
+                    <gmd:version gco:nilReason="inapplicable"/>
+                </gmd:MD_Format>
+            </gmd:distributionFormat>
+            <gmd:transferOptions>
+                <gmd:MD_DigitalTransferOptions>
+                    <gmd:onLine>
+                        <gmd:CI_OnlineResource>
+                            <gmd:linkage>
+                                <gmd:URL>http://publicamundi.eu</gmd:URL>
+                            </gmd:linkage>
+                        </gmd:CI_OnlineResource>
+                    </gmd:onLine>
+                </gmd:MD_DigitalTransferOptions>
+            </gmd:transferOptions>
+        </gmd:MD_Distribution>
+    </gmd:distributionInfo>
+    <gmd:dataQualityInfo>
+        <gmd:DQ_DataQuality>
+            <gmd:scope>
+                <gmd:DQ_Scope>
+                    <gmd:level>
+                        <gmd:MD_ScopeCode codeListValue="dataset" codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_ScopeCode">dataset</gmd:MD_ScopeCode>
+                    </gmd:level>
+                </gmd:DQ_Scope>
+            </gmd:scope>
+            <gmd:report>
+                <gmd:DQ_DomainConsistency xsi:type="gmd:DQ_DomainConsistency_Type">
+                    <gmd:measureIdentification>
+                        <gmd:RS_Identifier>
+                            <gmd:code>
+                                <gco:CharacterString>Conformity_001</gco:CharacterString>
+                            </gmd:code>
+                            <gmd:codeSpace>
+                                <gco:CharacterString>INSPIRE</gco:CharacterString>
+                            </gmd:codeSpace>
+                        </gmd:RS_Identifier>
+                    </gmd:measureIdentification>
+                    <gmd:result>
+                        <gmd:DQ_ConformanceResult xsi:type="gmd:DQ_ConformanceResult_Type">
+                            <gmd:specification>
+                                <gmd:CI_Citation>
+                                    <gmd:title>
+                                        <gco:CharacterString>Commission Regulation (EU) No 1089/2010 of 23 November 2010 implementing Directive 2007/2/EC of the European Parliament and of the Council as regards interoperability of spatial data sets and services</gco:CharacterString>
+                                    </gmd:title>
+                                    <gmd:date>
+                                        <gmd:CI_Date>
+                                            <gmd:date>
+                                                <gco:Date>2010-12-08</gco:Date>
+                                            </gmd:date>
+                                            <gmd:dateType>
+                                                <gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication">publication</gmd:CI_DateTypeCode>
+                                            </gmd:dateType>
+                                        </gmd:CI_Date>
+                                    </gmd:date>
+                                </gmd:CI_Citation>
+                            </gmd:specification>
+                            <gmd:explanation>
+                                <gco:CharacterString>See the referenced specification</gco:CharacterString>
+                            </gmd:explanation>
+                            <gmd:pass>
+                                <gco:Boolean>true</gco:Boolean>
+                            </gmd:pass>
+                        </gmd:DQ_ConformanceResult>
+                    </gmd:result>
+                </gmd:DQ_DomainConsistency>
+            </gmd:report>
+            <gmd:lineage>
+                <gmd:LI_Lineage>
+                    <gmd:statement>
+                        <gco:CharacterString>history blah blah blah</gco:CharacterString>
+                    </gmd:statement>
+                </gmd:LI_Lineage>
+            </gmd:lineage>
+        </gmd:DQ_DataQuality>
+    </gmd:dataQualityInfo>
+</gmd:MD_Metadata>

Modified: sandbox/krejcmat/src/templates/grassGRASSTemplateFinal.xml
===================================================================
--- sandbox/krejcmat/src/templates/grassGRASSTemplateFinal.xml	2014-08-01 17:47:01 UTC (rev 61498)
+++ sandbox/krejcmat/src/templates/grassGRASSTemplateFinal.xml	2014-08-01 18:47:11 UTC (rev 61499)
@@ -3,37 +3,34 @@
     <gmd:fileIdentifier>
         <gco:CharacterString>{{ md.identifier }}{# tag="md.identifier",ref="Part B 1.5",  name ="Resource Identifier", desc ="Unique Resource Identifier", example ="286c0725-046e-4533-b0bf-d6e367f6c342", type = "CharacterString", multi = 0, group = "Identification", multiline=False #}</gco:CharacterString>
     </gmd:fileIdentifier>
-    <gmd:language>
-        <gmd:LanguageCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#LanguageCode" codeListValue="{{ md.languagecode }}{# tag="md.languagecode", name ="Metadata language", desc ="Language(s) used within the datasets", example ="eng", type = "CharacterString", multi = 0, group = "Metadata",multiline=False #}"></gmd:LanguageCode>
-    </gmd:language>
     <gmd:hierarchyLevel>
-        <gmd:MD_ScopeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode" codeListValue="dataset" codeSpace="ISOTC211/19115">{{ md.identification.identtype }}{# tag="md.identification.identtype", name ="Resource Type", desc ="Scope to which metadata applies", example ="dataset", type = "CharacterString", multi = 0, group = "Identification",multiline=False #}</gmd:MD_ScopeCode>
+        <gmd:MD_ScopeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode" codeListValue="dataset" codeSpace="ISOTC211/19115">{{ md.identification.identtype }}{# tag="md.identification.identtype", name ="Resource Type", desc ="Scope to which metadata applies", example ="dataset", type = "MD_ScopeCode", multi = 0, group = "Identification",multiline=False #}</gmd:MD_ScopeCode>
     </gmd:hierarchyLevel>
   {% for co in md.contact -%}{# tag="for co in md.contact",  inboxmulti = 1, group = "Metadata",inbox="Metadata point of contact",object="CI_ResponsibleParty()" #}
     <gmd:contact>
         <gmd:CI_ResponsibleParty>
             <gmd:organisationName>
-                <gco:CharacterString>{{ co.organization }}{# tag="co.organization",ref="Part B 9.1",  inboxmulti = 1,multi = 0, group = "Metadata",object="CI_ResponsibleParty()", inbox="Metadata point of contact",name="Organisation name",example="SDI Unit, Institute for Environment and Sustainability, Joint ResearchCentre",desc="identification of, and means of communication with, person(s) and organization(s) associated with theresource(s)" #}</gco:CharacterString>
+                <gco:CharacterString>{{ co.organization }}{# tag="co.organization",ref="Part B 9.1",  inboxmulti = 1,multi = 0,type = "string",group = "Metadata",object="CI_ResponsibleParty()", inbox="Metadata point of contact",name="Organisation name",example="SDI Unit, Institute for Environment and Sustainability, Joint ResearchCentre",desc="identification of, and means of communication with, person(s) and organization(s) associated with theresource(s)" #}</gco:CharacterString>
             </gmd:organisationName>
             <gmd:contactInfo>
                 <gmd:CI_Contact>
                     <gmd:address>
                         <gmd:CI_Address>
                             <gmd:electronicMailAddress>
-                                <gco:CharacterString>{{ co.email }}{# tag="co.email",name="E-mail",ref="Part B 10.1",  multi = 0,object="CI_ResponsibleParty()", inboxmulti = 1,group = "Metadata", inbox="Metadata point of contact",example="image2000 at jrc.it", desc="Party responsible for the metadata information." #}</gco:CharacterString>
+                                <gco:CharacterString>{{ co.email }}{# tag="co.email",name="E-mail",ref="Part B 10.1",  multi = 0,object="CI_ResponsibleParty()", inboxmulti = 1,group = "Metadata", inbox="Metadata point of contact",type = "email",example="image2000 at jrc.it", desc="Party responsible for the metadata information." #}</gco:CharacterString>
                             </gmd:electronicMailAddress>
                         </gmd:CI_Address>
                     </gmd:address>
                 </gmd:CI_Contact>
             </gmd:contactInfo>
             <gmd:role>
-                <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="{{  co.role }}{# tag="co.role",name="Responsible party role",ref="Part B 9.2" , multi = 0, inboxmulti = 1,group = "Responsible party",object="CI_ResponsibleParty()", inbox="Metadata pointt of contact",example="custodian", desc="function performed by the responsible party" #}" codeSpace="ISOTC211/19115"></gmd:CI_RoleCode>
+                <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="{{  co.role }}{# tag="co.role",name="Responsible party role",ref="Part B 9.2" , multi = 0,type = "CI_RoleCode", inboxmulti = 1,group = "Responsible party",object="CI_ResponsibleParty()", inbox="Metadata pointt of contact",example="custodian", desc="function performed by the responsible party" #}" codeSpace="ISOTC211/19115">{{  co.role }}</gmd:CI_RoleCode>
             </gmd:role>
         </gmd:CI_ResponsibleParty>
     </gmd:contact>
   {% endfor -%}
     <gmd:dateStamp>
-        <gco:Date>{{ md.datestamp }}{# tag="md.datestamp" , name="Metadata date" , ref= "Part B 10.2" , desc= "Date that the metadata was created." , example = "2005-03-27" , type ="Date" , multi= 0 , group= "Metadata" , multiline= False #}</gco:Date>
+        <gco:Date>{{ md.datestamp }}{# tag="md.datestamp" , name="Metadata date" , ref= "Part B 10.2" , desc= "Date that the metadata was created.",type = "date" , example = "2005-03-27" , multi= 0 , group= "Metadata" , multiline= False #}</gco:Date>
     </gmd:dateStamp>
     <gmd:metadataStandardName>
         <gco:CharacterString>ISO 19115</gco:CharacterString>
@@ -46,17 +43,16 @@
             <gmd:citation>
                 <gmd:CI_Citation>
                     <gmd:title>
-                        <gco:CharacterString>{{ md.identification.title }}{# tag="md.identification.title", ref="Part B 1.1", name ="Resource title", desc ="Name by which the cited resource is known.", example ="Image2000 Product 1 (nl2) MultispectB 10.1" , multi = 0, group ="Identification", type = "CharacterString", multiline=False #}</gco:CharacterString>
+                        <gco:CharacterString>{{ md.identification.title }}{# tag="md.identification.title", ref="Part B 1.1", name ="Resource title", desc ="Name by which the cited resource is known.", example ="Image2000 Product 1 (nl2) MultispectB 10.1" , multi = 0, group ="Identification", type = "string", multiline=False #}</gco:CharacterString>
                     </gmd:title>
           {% for d in md.identification.date -%}{# tag="for d in md.identification.date" ,name="",object="CI_Date()",group= "Temporal" , inbox= "Date of creation/publication/revision",  inboxmulti=1, multiline= False #}
                     <gmd:date>
                         <gmd:CI_Date>
                             <gmd:date>
-                                <gco:DateTime>{{ d.date }}{# tag="d.date" , group= "Temporal" ,object="CI_Date()", inbox= "Date of creation/publication/revision",  inboxmulti=1, multiline= False, name="Date of: type(below)",desc="reference date for the cited resource - publication/creation/revision",example="2007-09-15" #}</gco:DateTime>
+                                <gco:DateTime>{{ d.date }}{# tag="d.date" , group= "Temporal" ,object="CI_Date()", inbox= "Date of creation/publication/revision",  inboxmulti=1, multiline= False, name="Date of: type(below)",type = "date",desc="reference date for the cited resource - publication/creation/revision",example="2007-09-15" #}</gco:DateTime>
                             </gmd:date>
                             <gmd:dateType>
-                                <gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="{{ d.type }}{# tag="d.type" , group= "Temporal" ,object="CI_Date()", inbox= "Date of creation/publication/revision",  inboxmulti=1, multiline= False, name="type: creation/publication/revision",desc="reference date for the cited resource - publication/creation/revision",example="creation" #}"
- codeSpace="ISOTC211/19115"></gmd:CI_DateTypeCode>
+                                <gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="{{ d.type }}{# tag="d.type" , group= "Temporal" ,type = "CI_DateTypeCode",object="CI_Date()", inbox= "Date of creation/publication/revision",  inboxmulti=1, multiline= False, name="type: creation/publication/revision",desc="reference date for the cited resource - publication/creation/revision",example="creation" #}" codeSpace="ISOTC211/19115">{{ d.type }}</gmd:CI_DateTypeCode>
                             </gmd:dateType>
                         </gmd:CI_Date>
                     </gmd:date>
@@ -64,27 +60,27 @@
             </gmd:citation>
       {% endfor -%}
             <gmd:abstract>
-                <gco:CharacterString>{{ md.identification.abstract }}{# tag="md.identification.abstract ",ref="Part B 1.2",  name ="Resource Abstract", desc ="Brief narrative summary of the content of the resource(s).", example ="IMAGE2000 product 1 individual orthorectified scenes. IMAGE2000 was produced from ETM+ Landsat 7 satellite data and provides a consistent European coverage of individual orthorectified scenes in national map projection systems. The year 2000 was targeted as reference year, but a deviation of maximum 1-year was allowed to obtain a full coverage of Europe, which involves approximately 450 Landsat TM Frames. Where Landsat 7 data were not available, Landsat 5 data have been used instead. The spatial resolution is 25 metres for multispectral and 12.5 metres for panchromatic imagery", type = "CharacterString", multi = 0, group = "Identification", multiline=True #}</gco:CharacterString>
+                <gco:CharacterString>{{ md.identification.abstract }}{# tag="md.identification.abstract ",ref="Part B 1.2",  name ="Resource Abstract", desc ="Brief narrative summary of the content of the resource(s).", example ="IMAGE2000 product 1 individual orthorectified scenes. IMAGE2000 was produced from ETM+ Landsat 7 satellite data and provides a consistent European coverage of individual orthorectified scenes in national map projection systems. The year 2000 was targeted as reference year, but a deviation of maximum 1-year was allowed to obtain a full coverage of Europe, which involves approximately 450 Landsat TM Frames. Where Landsat 7 data were not available, Landsat 5 data have been used instead. The spatial resolution is 25 metres for multispectral and 12.5 metres for panchromatic imagery", type = "string", multi = 0, group = "Identification", multiline=True #}</gco:CharacterString>
             </gmd:abstract>
       {% for co in md.identification.contact -%}{# tag="for co in md.identification.contact",object="CI_ResponsibleParty()", inboxmulti=1, group = "Responsible party",inbox="Point of contact" #}
             <gmd:pointOfContact>
                 <gmd:CI_ResponsibleParty>
                     <gmd:organisationName>
-                        <gco:CharacterString>{{ co.organization }}{# tag="co.organization",ref="Part B 9.1",  multi = 0, group = "Responsible party",inboxmulti=1 ,inbox="Point of contact",object="CI_ResponsibleParty()",name="Organisation name",example="SDI Unit, Institute for Environment and Sustainability, Joint ResearchCentre",desc="identification of, and means of communication with, person(s) and organization(s) associated with theresource(s)" #}</gco:CharacterString>
+                        <gco:CharacterString>{{ co.organization }}{# tag="co.organization",ref="Part B 9.1",  multi = 0, group = "Responsible party",inboxmulti=1 ,inbox="Point of contact",object="CI_ResponsibleParty()",name="Organisation name",example="SDI Unit, Institute for Environment and Sustainability, Joint ResearchCentre",type = "string",desc="identification of, and means of communication with, person(s) and organization(s) associated with theresource(s)" #}</gco:CharacterString>
                     </gmd:organisationName>
                     <gmd:contactInfo>
                         <gmd:CI_Contact>
                             <gmd:address>
                                 <gmd:CI_Address>
                                     <gmd:electronicMailAddress>
-                                        <gco:CharacterString>{{ co.email }}{# tag="co.email",name="E-mail",ref="Part B 10.1" , group = "Metadata",inboxmulti=1, inbox="Responsible party",multi=0,example="image2000 at jrc.it",object="CI_ResponsibleParty()", desc="Party responsible for the metadata information." #}</gco:CharacterString>
+                                        <gco:CharacterString>{{ co.email }}{# tag="co.email",name="E-mail",ref="Part B 10.1" , group = "Metadata",inboxmulti=1, inbox="Responsible party",multi=0,type ="email",example="image2000 at jrc.it",object="CI_ResponsibleParty()", desc="Party responsible for the metadata information." #}</gco:CharacterString>
                                     </gmd:electronicMailAddress>
                                 </gmd:CI_Address>
                             </gmd:address>
                         </gmd:CI_Contact>
                     </gmd:contactInfo>
                     <gmd:role>
-                        <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="{{ co.role }}{# tag="co.role",inboxmulti=1,name="Responsible party role",object="CI_ResponsibleParty()",ref="Part B 9.2",  multi = 0, group = "Responsible party", inbox="Responsible party",example="custodian", desc="function performed by the responsible party" #}" codeSpace="ISOTC211/19115"></gmd:CI_RoleCode>
+                        <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="{{ co.role }}{# tag="co.role",inboxmulti=1,name="Responsible party role",object="CI_ResponsibleParty()",ref="Part B 9.2", type = "CI_RoleCode", multi = 0, group = "Responsible party", inbox="Responsible party",example="custodian", desc="function performed by the responsible party" #}" codeSpace="ISOTC211/19115">{{ co.role }}</gmd:CI_RoleCode>
                     </gmd:role>
                 </gmd:CI_ResponsibleParty>
             </gmd:pointOfContact>
@@ -94,32 +90,27 @@
                     <gmd:spatialResolution>
                         <gmd:MD_Resolution>
                             <gmd:distance>
-                                <gco:Distance uom="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/uom/ML_gmxUom.xml#m">{{ d }}{# tag="d" , name="Distance" , ref= "Part B 6.2" , desc= "Ground sample distance" , example = "25" , type ="Integer" , group = "Quality and Validity" ,inbox="Spatial resolution-dostance", multi=0 , inboxmulti=1, multiline= False #}</gco:Distance>
+                                <gco:Distance uom="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/uom/ML_gmxUom.xml#m">{{ d }}{# tag="d" , name="Distance" , ref= "Part B 6.2" , desc= "Ground sample distance" , example = "25" ,type = "integer", group = "Quality and Validity" ,inbox="Spatial resolution-dostance", multi=0 , inboxmulti=1, multiline= False #}</gco:Distance>
                             </gmd:distance>
                         </gmd:MD_Resolution>
                     </gmd:spatialResolution>
       {% endfor -%}
       {% endif -%}
-      {% for lan in md.identification.resourcelanguage -%}{# tag="for lan in md.identification.resourcelanguage" , group= "Identification" ,inbox='Languages',inboxmulti=1, multiline= False #}
-                    <gmd:language>
-                        <gmd:LanguageCode codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#LanguageCode" codeListValue="{{ lan }}{{ lan }}{# tag="lan" , name="Metadata language" , ref= "Part B 10.3" , desc= "Language used for documenting metadata." , example = "eng" , type ="LanguageCode (ISO/TS 19139)" ,multi=0,inbox='Languages',inboxmulti=1, group= "Identification" , multiline= False #}"></gmd:LanguageCode>
-                    </gmd:language>
-      {% endfor -%}
                     <gmd:extent>
                         <gmd:EX_Extent>
                             <gmd:geographicElement>
                                 <gmd:EX_GeographicBoundingBox>
                                     <gmd:westBoundLongitude>
-                                        <gco:Decimal>{{ md.identification.extent.boundingBox.minx }}{# tag="md.identification.extent.boundingBox.minx" , name="West Bound Longitude" , ref= "Part B 4.1" , desc= "Western-most coordinate of the limit of the dataset extent, expressed in longitude in decimal degrees (positive east)." , example = "3.93" , type ="Decimal" , group= "Geographic" ,  multi=0 ,  multiline= False #}</gco:Decimal>
+                                        <gco:Decimal>{{ md.identification.extent.boundingBox.minx }}{# tag="md.identification.extent.boundingBox.minx" , name="West Bound Longitude" , ref= "Part B 4.1" , desc= "Western-most coordinate of the limit of the dataset extent, expressed in longitude in decimal degrees (positive east)." , example = "3.93" , type ="decimal" , group= "Geographic" ,  multi=0 ,  multiline= False #}</gco:Decimal>
                                     </gmd:westBoundLongitude>
                                     <gmd:eastBoundLongitude>
-                                        <gco:Decimal>{{ md.identification.extent.boundingBox.maxx }}{# tag="md.identification.extent.boundingBox.maxx" , name="East Bound Longitude" , ref= "Part B 4.1" , desc= "Eastern-most coordinate of the limit of the dataset extent, expressed in longitude in decimal degrees (positive east)." , example = "7.57" , type ="Decimal" , group= "Geographic" ,  multi=0 ,  multiline= False #}</gco:Decimal>
+                                        <gco:Decimal>{{ md.identification.extent.boundingBox.maxx }}{# tag="md.identification.extent.boundingBox.maxx" , name="East Bound Longitude" , ref= "Part B 4.1" , desc= "Eastern-most coordinate of the limit of the dataset extent, expressed in longitude in decimal degrees (positive east)." , example = "7.57" , type ="decimal" , group= "Geographic" ,  multi=0 ,  multiline= False #}</gco:Decimal>
                                     </gmd:eastBoundLongitude>
                                     <gmd:southBoundLatitude>
-                                        <gco:Decimal>{{ md.identification.extent.boundingBox.miny }}{# tag="md.identification.extent.boundingBox.miny" , name="South Bound Latitude" , ref= "Part B 4.1" , desc= "Southern-most coordinate of the limit of the dataset extent, expressed in latitude in decimal degrees (positive north)." , example = "52.10" , type ="Decimal" , group= "Geographic" ,multi=0 , multiline= False #}</gco:Decimal>
+                                        <gco:Decimal>{{ md.identification.extent.boundingBox.miny }}{# tag="md.identification.extent.boundingBox.miny" , name="South Bound Latitude" , ref= "Part B 4.1" , desc= "Southern-most coordinate of the limit of the dataset extent, expressed in latitude in decimal degrees (positive north)." , example = "52.10" , type ="decimal" , group= "Geographic" ,multi=0 , multiline= False #}</gco:Decimal>
                                     </gmd:southBoundLatitude>
                                     <gmd:northBoundLatitude>
-                                        <gco:Decimal>{{ md.identification.extent.boundingBox.maxy }}{# tag="md.identification.extent.boundingBox.maxy" , name="North Bound Latitude" , ref= "Part B 4.1" , desc= "Northern-most coordinate of the limit of the dataset extent, expressed in latitude in decimal degrees (positive north)." , example = "54.10" , type ="Decimal" , group= "Geographic" , multi=0 ,  multiline= False #}</gco:Decimal>
+                                        <gco:Decimal>{{ md.identification.extent.boundingBox.maxy }}{# tag="md.identification.extent.boundingBox.maxy" , name="North Bound Latitude" , ref= "Part B 4.1" , desc= "Northern-most coordinate of the limit of the dataset extent, expressed in latitude in decimal degrees (positive north)." , example = "54.10" , type ="decimal" , group= "Geographic" , multi=0 ,  multiline= False #}</gco:Decimal>
                                     </gmd:northBoundLatitude>
                                 </gmd:EX_GeographicBoundingBox>
                             </gmd:geographicElement>
@@ -135,19 +126,6 @@
                             <gmd:version gco:nilReason="inapplicable"/>
                         </gmd:MD_Format>
                     </gmd:distributionFormat>
-                    <gmd:transferOptions>
-                        <gmd:MD_DigitalTransferOptions>
-                          {% for ln in md.distribution.online -%}{# tag="for ln in md.distribution.online" , group= "Identification",object='CI_OnlineResource()'  #}
-                            <gmd:onLine>
-                                <gmd:CI_OnlineResource>
-                                    <gmd:linkage>
-                                        <gmd:URL>{{ ln.url }}{# tag="ln.url" , name="Linkage" , ref= "Part B 1.4" ,object='CI_OnlineResource()', desc= "Location (address) for on-line access using a Uniform Resource Locator address or similar addressing scheme." , example = "http://image2000.jrc.it" , type ="URL" , group= "Identification" ,multi=1, multiline= False #}</gmd:URL>
-                                    </gmd:linkage>
-                                </gmd:CI_OnlineResource>
-                            </gmd:onLine>
-                           {% endfor -%}
-                        </gmd:MD_DigitalTransferOptions>
-                    </gmd:transferOptions>
                 </gmd:MD_Distribution>
             </gmd:distributionInfo>
             <gmd:dataQualityInfo>
@@ -155,7 +133,7 @@
                     <gmd:scope>
                         <gmd:DQ_Scope>
                             <gmd:level>
-                                <gmd:MD_ScopeCode codeListValue="{{ md.identification.identtype }}{# tag="md.identification.identtype", name ="Resource Type", desc ="Scope to which metadata applies", example ="dataset", type = "CharacterString", multi = 0, group = "Identification",multiline=True #}" codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#MD_ScopeCode"></gmd:MD_ScopeCode>
+                                <gmd:MD_ScopeCode codeListValue="{{ md.identification.identtype }}{# tag="md.identification.identtype", name ="Resource Type",type = "MD_ScopeCode", desc ="Scope to which metadata applies", example ="dataset", multi = 0, group = "Identification",multiline=True #}" codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#MD_ScopeCode">{{ md.identification.identtype }}</gmd:MD_ScopeCode>
                             </gmd:level>
                         </gmd:DQ_Scope>
                     </gmd:scope>

Modified: sandbox/krejcmat/src/templates/grassInspireTemplateFinal.xml
===================================================================
--- sandbox/krejcmat/src/templates/grassInspireTemplateFinal.xml	2014-08-01 17:47:01 UTC (rev 61498)
+++ sandbox/krejcmat/src/templates/grassInspireTemplateFinal.xml	2014-08-01 18:47:11 UTC (rev 61499)
@@ -1,39 +1,39 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gmd:MD_Metadata xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink">
     <gmd:fileIdentifier>
-        <gco:CharacterString>{{ md.identifier }}{# tag="md.identifier",ref="Part B 1.5",  name ="Resource Identifier", desc ="Unique Resource Identifier", example ="286c0725-046e-4533-b0bf-d6e367f6c342", type = "CharacterString", multi = 0, group = "Identification", multiline=False #}</gco:CharacterString>
+        <gco:CharacterString>{{ md.identifier }}{# tag="md.identifier",ref="Part B 1.5",  name ="Resource Identifier", desc ="Unique Resource Identifier", example ="286c0725-046e-4533-b0bf-d6e367f6c342", type = "string", multi = 0, group = "Identification", multiline=False #}</gco:CharacterString>
     </gmd:fileIdentifier>
     <gmd:language>
-        <gmd:LanguageCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#LanguageCode" codeListValue="{{ md.languagecode }}{# tag="md.languagecode", name ="Metadata language", desc ="Language(s) used within the datasets", example ="eng", type = "CharacterString", multi = 0, group = "Metadata",multiline=False #}"></gmd:LanguageCode>
+        <gmd:LanguageCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#LanguageCode" codeListValue="{{ md.languagecode }}{# tag="md.languagecode", name ="Metadata language", desc ="Language(s) used within the datasets", example ="eng", type = "string", multi = 0, group = "Metadata",multiline=False #}">{{ md.languagecode }}</gmd:LanguageCode>
     </gmd:language>
     <gmd:hierarchyLevel>
-        <gmd:MD_ScopeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode" codeListValue="dataset" codeSpace="ISOTC211/19115">{{ md.identification.identtype }}{# tag="md.identification.identtype", name ="Resource Type", desc ="Scope to which metadata applies", example ="dataset", type = "CharacterString", multi = 0, group = "Identification",multiline=False #}</gmd:MD_ScopeCode>
+        <gmd:MD_ScopeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode" codeListValue="dataset" codeSpace="ISOTC211/19115">{{ md.identification.identtype }}{# tag="md.identification.identtype", name ="Resource Type", desc ="Scope to which metadata applies", example ="dataset", type = "string", multi = 0, group = "Identification",multiline=False #}</gmd:MD_ScopeCode>
     </gmd:hierarchyLevel>
   {% for co in md.contact -%}{# tag="for co in md.contact",  inboxmulti = 1, group = "Metadata",inbox="Metadata point of contact",object="CI_ResponsibleParty()" #}
     <gmd:contact>
         <gmd:CI_ResponsibleParty>
             <gmd:organisationName>
-                <gco:CharacterString>{{ co.organization }}{# tag="co.organization",ref="Part B 9.1",  inboxmulti = 1,multi = 0, group = "Metadata",object="CI_ResponsibleParty()", inbox="Metadata point of contact",name="Organisation name",example="SDI Unit, Institute for Environment and Sustainability, Joint ResearchCentre",desc="identification of, and means of communication with, person(s) and organization(s) associated with theresource(s)" #}</gco:CharacterString>
+                <gco:CharacterString>{{ co.organization }}{# tag="co.organization",ref="Part B 9.1",  inboxmulti = 1,multi = 0, type = "string",group = "Metadata",object="CI_ResponsibleParty()", inbox="Metadata point of contact",name="Organisation name",example="SDI Unit, Institute for Environment and Sustainability, Joint ResearchCentre",desc="identification of, and means of communication with, person(s) and organization(s) associated with theresource(s)" #}</gco:CharacterString>
             </gmd:organisationName>
             <gmd:contactInfo>
                 <gmd:CI_Contact>
                     <gmd:address>
                         <gmd:CI_Address>
                             <gmd:electronicMailAddress>
-                                <gco:CharacterString>{{ co.email }}{# tag="co.email",name="E-mail",ref="Part B 10.1",  multi = 0,object="CI_ResponsibleParty()", inboxmulti = 1,group = "Metadata", inbox="Metadata point of contact",example="image2000 at jrc.it", desc="Party responsible for the metadata information." #}</gco:CharacterString>
+                                <gco:CharacterString>{{ co.email }}{# tag="co.email",name="E-mail",ref="Part B 10.1",type = "email",  multi = 0,object="CI_ResponsibleParty()", inboxmulti = 1,group = "Metadata", inbox="Metadata point of contact",example="image2000 at jrc.it", desc="Party responsible for the metadata information." #}</gco:CharacterString>
                             </gmd:electronicMailAddress>
                         </gmd:CI_Address>
                     </gmd:address>
                 </gmd:CI_Contact>
             </gmd:contactInfo>
             <gmd:role>
-                <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="{{  co.role }}{# tag="co.role",name="Responsible party role",ref="Part B 9.2" , multi = 0, inboxmulti = 1,group = "Responsible party",object="CI_ResponsibleParty()", inbox="Metadata pointt of contact",example="custodian", desc="function performed by the responsible party" #}" codeSpace="ISOTC211/19115"></gmd:CI_RoleCode>
+                <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="{{  co.role }}{# tag="co.role",name="Responsible party role",ref="Part B 9.2" , multi = 0,type = "CI_RoleCode", inboxmulti = 1,group = "Responsible party",object="CI_ResponsibleParty()", inbox="Metadata pointt of contact",example="custodian", desc="function performed by the responsible party" #}" codeSpace="ISOTC211/19115">{{  co.role }}</gmd:CI_RoleCode>
             </gmd:role>
         </gmd:CI_ResponsibleParty>
     </gmd:contact>
   {% endfor -%}
     <gmd:dateStamp>
-        <gco:Date>{{ md.datestamp }}{# tag="md.datestamp" , name="Metadata date" , ref= "Part B 10.2" , desc= "Date that the metadata was created." , example = "2005-03-27" , type ="Date" , multi= 0 , group= "Metadata" , multiline= False #}</gco:Date>
+        <gco:Date>{{ md.datestamp }}{# tag="md.datestamp" , name="Metadata date" , ref= "Part B 10.2" , desc= "Date that the metadata was created." , example = "2005-03-27" , type ="date" , multi= 0 , group= "Metadata" , multiline= False #}</gco:Date>
     </gmd:dateStamp>
     <gmd:metadataStandardName>
         <gco:CharacterString>ISO 19115</gco:CharacterString>
@@ -46,17 +46,16 @@
             <gmd:citation>
                 <gmd:CI_Citation>
                     <gmd:title>
-                        <gco:CharacterString>{{ md.identification.title }}{# tag="md.identification.title", ref="Part B 1.1", name ="Resource title", desc ="Name by which the cited resource is known.", example ="Image2000 Product 1 (nl2) MultispectB 10.1" , multi = 0, group ="Identification", type = "CharacterString", multiline=False #}</gco:CharacterString>
+                        <gco:CharacterString>{{ md.identification.title }}{# tag="md.identification.title", ref="Part B 1.1", name ="Resource title", desc ="Name by which the cited resource is known.", example ="Image2000 Product 1 (nl2) MultispectB 10.1" , multi = 0, group ="Identification", type = "string", multiline=False #}</gco:CharacterString>
                     </gmd:title>
           {% for d in md.identification.date -%}{# tag="for d in md.identification.date" ,name="",object="CI_Date()",group= "Temporal" , inbox= "Date of creation/publication/revision",  inboxmulti=1, multiline= False #}
                     <gmd:date>
                         <gmd:CI_Date>
                             <gmd:date>
-                                <gco:DateTime>{{ d.date }}{# tag="d.date" , group= "Temporal" ,object="CI_Date()", inbox= "Date of creation/publication/revision",  inboxmulti=1, multiline= False, name="Date of: type(below)",desc="reference date for the cited resource - publication/creation/revision",example="2007-09-15" #}</gco:DateTime>
+                                <gco:DateTime>{{ d.date }}{# tag="d.date" , group= "Temporal" ,object="CI_Date()",type = "date", inbox= "Date of creation/publication/revision",  inboxmulti=1, multiline= False, name="Date of: type(below)",desc="reference date for the cited resource - publication/creation/revision",example="2007-09-15" #}</gco:DateTime>
                             </gmd:date>
                             <gmd:dateType>
-                                <gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="{{ d.type }}{# tag="d.type" , group= "Temporal" ,object="CI_Date()", inbox= "Date of creation/publication/revision",  inboxmulti=1, multiline= False, name="type: creation/publication/revision",desc="reference date for the cited resource - publication/creation/revision",example="creation" #}"
-codeSpace="ISOTC211/19115"></gmd:CI_DateTypeCode>
+                                <gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="{{ d.type }}{# tag="d.type" , group= "Temporal" ,object="CI_Date()",type = "CI_DateTypeCode", inbox= "Date of creation/publication/revision",  inboxmulti=1, multiline= False, name="type: creation/publication/revision",desc="reference date for the cited resource - publication/creation/revision",example="creation" #}" codeSpace="ISOTC211/19115">{{ d.type }}</gmd:CI_DateTypeCode>
                             </gmd:dateType>
                         </gmd:CI_Date>
                     </gmd:date>
@@ -69,10 +68,10 @@
                                     <gmd:geographicIdentifier>
                                         <gmd:RS_Identifier>
                                             <gmd:code>
-                                                <gco:CharacterString>{{ cod }}{# tag="cod", inboxmulti=1, group = "Identification",inbox="Unique resource identifier" ,ref="Part B 1.5",  name ="Idetifier- code", desc ="A value uniquely identifying the resource.The value domain of this metadata element is a mandatory character string code, generally assigned by the data owner, and a character string namespace uniquely identifying the context of the identifier code (for example, the data owner).", example ="http://image2000.jrc.it # image2000_1_nl2_multi", type = "CharacterString", multi = 0  #}</gco:CharacterString>
+                                                <gco:CharacterString>{{ cod }}{# tag="cod", inboxmulti=1, group = "Identification",inbox="Unique resource identifier" ,ref="Part B 1.5",  name ="Idetifier- code", desc ="A value uniquely identifying the resource.The value domain of this metadata element is a mandatory character string code, generally assigned by the data owner, and a character string namespace uniquely identifying the context of the identifier code (for example, the data owner).", example ="http://image2000.jrc.it # image2000_1_nl2_multi", type = "string", multi = 0  #}</gco:CharacterString>
                                             </gmd:code>
                                             <gmd:codeSpace>
-                                                <gco:CharacterString>{{ code }}{# tag="cod", inboxmulti=1, group = "Identification",inbox="Unique resource identifier" ,ref="Part B 1.5",  name ="Idetifier- code space", desc ="A value uniquely identifying the resource.The value domain of this metadata element is a mandatory character string code, generally assigned by the data owner, and a character string namespace uniquely identifying the context of the identifier code (for example, the data owner).", example ="http://image2000.jrc.it", type = "CharacterString", multi = 0 #}</gco:CharacterString>
+                                                <gco:CharacterString>{{ code }}{# tag="code", inboxmulti=1, group = "Identification",inbox="Unique resource identifier" ,ref="Part B 1.5",  name ="Idetifier- code space", desc ="A value uniquely identifying the resource.The value domain of this metadata element is a mandatory character string code, generally assigned by the data owner, and a character string namespace uniquely identifying the context of the identifier code (for example, the data owner).", example ="http://image2000.jrc.it", type = "string", multi = 0 #}</gco:CharacterString>
                                             </gmd:codeSpace>
                                         </gmd:RS_Identifier>
                                     </gmd:geographicIdentifier>
@@ -84,28 +83,28 @@
                 </gmd:CI_Citation>
             </gmd:citation>
             <gmd:abstract>
-                <gco:CharacterString>{{ md.identification.abstract }}{# tag="md.identification.abstract ",ref="Part B 1.2",  name ="Resource Abstract", desc ="Brief narrative summary of the content of the resource(s).", example ="IMAGE2000 product 1 individual orthorectified scenes. IMAGE2000 was produced from ETM+ Landsat 7 satellite data and provides a consistent European coverage of individual orthorectified scenes in national map projection systems. The year 2000 was targeted as reference year, but a deviation of maximum 1-year was allowed to obtain a full coverage of Europe, which involves approximately 450 Landsat TM Frames. Where Landsat 7 data were not available, Landsat 5 data have been used instead. The spatial resolution is 25 metres for multispectral and 12.5 metres for panchromatic imagery", type = "CharacterString", multi = 0, group = "Identification", multiline=True #}</gco:CharacterString>
+                <gco:CharacterString>{{ md.identification.abstract }}{# tag="md.identification.abstract ",ref="Part B 1.2",  name ="Resource Abstract", desc ="Brief narrative summary of the content of the resource(s).", example ="IMAGE2000 product 1 individual orthorectified scenes. IMAGE2000 was produced from ETM+ Landsat 7 satellite data and provides a consistent European coverage of individual orthorectified scenes in national map projection systems. The year 2000 was targeted as reference year, but a deviation of maximum 1-year was allowed to obtain a full coverage of Europe, which involves approximately 450 Landsat TM Frames. Where Landsat 7 data were not available, Landsat 5 data have been used instead. The spatial resolution is 25 metres for multispectral and 12.5 metres for panchromatic imagery", type = "string", multi = 0, group = "Identification", multiline=True #}</gco:CharacterString>
             </gmd:abstract>
       {% for co in md.identification.contact -%}{# tag="for co in md.identification.contact",object="CI_ResponsibleParty()", inboxmulti=1, group = "Responsible party",inbox="Point of contact" #}
       
             <gmd:pointOfContact>
                 <gmd:CI_ResponsibleParty>
                     <gmd:organisationName>
-                        <gco:CharacterString>{{ co.organization }}{# tag="co.organization",ref="Part B 9.1",  multi = 0, group = "Responsible party",inboxmulti=1 ,inbox="Point of contact",object="CI_ResponsibleParty()",name="Organisation name",example="SDI Unit, Institute for Environment and Sustainability, Joint ResearchCentre",desc="identification of, and means of communication with, person(s) and organization(s) associated with theresource(s)" #}</gco:CharacterString>
+                        <gco:CharacterString>{{ co.organization }}{# tag="co.organization",ref="Part B 9.1", type = "string", multi = 0, group = "Responsible party",inboxmulti=1 ,inbox="Point of contact",object="CI_ResponsibleParty()",name="Organisation name",example="SDI Unit, Institute for Environment and Sustainability, Joint ResearchCentre",desc="identification of, and means of communication with, person(s) and organization(s) associated with theresource(s)" #}</gco:CharacterString>
                     </gmd:organisationName>
                     <gmd:contactInfo>
                         <gmd:CI_Contact>
                             <gmd:address>
                                 <gmd:CI_Address>
                                     <gmd:electronicMailAddress>
-                                        <gco:CharacterString>{{ co.email }}{# tag="co.email",name="E-mail",ref="Part B 10.1" , group = "Metadata",inboxmulti=1, inbox="Responsible party",multi=0,example="image2000 at jrc.it",object="CI_ResponsibleParty()", desc="Party responsible for the metadata information." #}</gco:CharacterString>
+                                        <gco:CharacterString>{{ co.email }}{# tag="co.email",name="E-mail",ref="Part B 10.1" , group = "Metadata",inboxmulti=1, inbox="Responsible party",multi=0,example="image2000 at jrc.it",object="CI_ResponsibleParty()", type = "email",desc="Party responsible for the metadata information." #}</gco:CharacterString>
                                     </gmd:electronicMailAddress>
                                 </gmd:CI_Address>
                             </gmd:address>
                         </gmd:CI_Contact>
                     </gmd:contactInfo>
                     <gmd:role>
-                        <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="{{ co.role }}{# tag="co.role",inboxmulti=1,name="Responsible party role",object="CI_ResponsibleParty()",ref="Part B 9.2",  multi = 0, group = "Responsible party", inbox="Responsible party",example="custodian", desc="function performed by the responsible party" #}" codeSpace="ISOTC211/19115"></gmd:CI_RoleCode>
+                        <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="{{ co.role }}{# tag="co.role",inboxmulti=1,name="Responsible party role",type = "CI_RoleCode",object="CI_ResponsibleParty()",ref="Part B 9.2",  multi = 0, group = "Responsible party", inbox="Responsible party",example="custodian", desc="function performed by the responsible party" #}" codeSpace="ISOTC211/19115">{{ co.role }}</gmd:CI_RoleCode>
                     </gmd:role>
                 </gmd:CI_ResponsibleParty>
             </gmd:pointOfContact>
@@ -117,21 +116,21 @@
                 <gmd:MD_Keywords>
           {% for kw in k["keywords"] -%}{# tag='for kw in k["keywords"]',group = "Keywords",inbox="Free keywords",inboxmulti=1 #}
                     <gmd:keyword>
-                        <gco:CharacterString>{{ kw }}{# tag="kw",ref="Part B 3.1", name ="Keyword",example="Land cover (INSPIRE Spatial Data Theme),humanCatalogueViewer (spatial data service,subcategory), water springs (AGROVOC), freshwater (GEMET Concepts)", desc ="Commonly used word(s) or formalised word(s) or phrase(s) used to describe the subject." , type = "CharacterString",inboxmulti=1, multi = 1, group = "Keywords", multiline=False, inbox="Free keywords" #} </gco:CharacterString>
+                        <gco:CharacterString>{{ kw }}{# tag="kw",ref="Part B 3.1", name ="Keyword",example="Land cover (INSPIRE Spatial Data Theme),humanCatalogueViewer (spatial data service,subcategory), water springs (AGROVOC), freshwater (GEMET Concepts)", desc ="Commonly used word(s) or formalised word(s) or phrase(s) used to describe the subject." , type = "string",inboxmulti=1, multi = 1, group = "Keywords", multiline=False, inbox="Free keywords" #} </gco:CharacterString>
                     </gmd:keyword>
           {% endfor -%}
                     <gmd:thesaurusName>
                         <gmd:CI_Citation>
                             <gmd:title>
-                                <gco:CharacterString>{{ k["thesaurus"]["title"] }}{# tag='k["thesaurus"]["title"]', name ="Title", desc ="This citation shall include title of keywords )" , type = "CharacterString", multi = 0,inboxmulti=1, group = "Keywords", multiline=False, inbox="Free keywords" #}</gco:CharacterString>
+                                <gco:CharacterString>{{ k["thesaurus"]["title"] }}{# tag='k["thesaurus"]["title"]', name ="Title", desc ="This citation shall include title of keywords )" , type = "string", multi = 0,inboxmulti=1, group = "Keywords", multiline=False, inbox="Free keywords" #}</gco:CharacterString>
                             </gmd:title>
                             <gmd:date>
                                 <gmd:CI_Date>
                                     <gmd:date>
-                                        <gco:Date>{{ k["thesaurus"]["date"] }}{# tag='k["thesaurus"]["date"]', name ="Reference date", desc ="This citation shall include at least the title a reference date(publication, revision, creation." , type = "CharacterString",inboxmulti=1, multi = 0, group = "Keywords", multiline=False, inbox="Free keywords" #}</gco:Date>
+                                        <gco:Date>{{ k["thesaurus"]["date"] }}{# tag='k["thesaurus"]["date"]', name ="Reference date", desc ="This citation shall include at least the title a reference date(publication, revision, creation." , type = "date",inboxmulti=1, multi = 0, group = "Keywords", multiline=False, inbox="Free keywords" #}</gco:Date>
                                     </gmd:date>
                                     <gmd:dateType>
-                                        <gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="{{ k["thesaurus"]["datetype"] }}{{ k["thesaurus"]["datetype"] }}{# tag='k["thesaurus"]["datetype"]', name ="Date type",inboxmulti=1, desc ="Options: Date of creation, Date of last revision, date of publication" , multi = 0, group = "Keywords", multiline=False, inbox="Free keywords" #}"></gmd:CI_DateTypeCode>
+                                        <gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="{{ k["thesaurus"]["datetype"] }}{{ k["thesaurus"]["datetype"] }}{# tag='k["thesaurus"]["datetype"]', type = "CI_DateTypeCode",name ="Date type",inboxmulti=1, desc ="Options Date of creation, Date of last revision, date of publication" , multi = 0, group = "Keywords", multiline=False, inbox="Free keywords" #}">{{ k["thesaurus"]["datetype"] }}</gmd:CI_DateTypeCode>
                                     </gmd:dateType>
                                 </gmd:CI_Date>
                             </gmd:date>
@@ -144,7 +143,7 @@
             <gmd:resourceConstraints>
                 <gmd:MD_Constraints>
                     <gmd:useLimitation>
-                        <gco:CharacterString>{{ rc }}{# tag="rc" , name="Use limitation" , ref= "Part B 8.1" , desc= "restrictions on the access and use of a resource or metadata" , example = "no conditions apply" , type ="CharacterString" ,group= "Constraints" , multi= 0, multiline= False,inbox="Condition applying to access and use", inboxmulti=1  #}</gco:CharacterString>
+                        <gco:CharacterString>{{ rc }}{# tag="rc" , name="Use limitation" , ref= "Part B 8.1" , desc= "restrictions on the access and use of a resource or metadata" , example = "no conditions apply" , type ="string" ,group= "Constraints" , multi= 0, multiline= False,inbox="Condition applying to access and use", inboxmulti=1  #}</gco:CharacterString>
                     </gmd:useLimitation>
                 </gmd:MD_Constraints>
             </gmd:resourceConstraints>
@@ -153,12 +152,12 @@
             <gmd:resourceConstraints>
                 <gmd:MD_LegalConstraints>
                     <gmd:accessConstraints>
-                        <gmd:MD_RestrictionCode codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#MD_RestrictionCode" codeListValue="{{ oc }}{# tag="oc" , name="Other constraionts" , ref= "Part B 8.1" , desc= "Restrictions on the access and use of a resource or metadata" , example = "No conditions apply" , type ="CharacterString" ,group= "Constraints" , multi= 0, multiline= False,inbox="Other restriction", inboxmulti=1  #}"></gmd:MD_RestrictionCode>
+                        <gmd:MD_RestrictionCode codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#MD_RestrictionCode" codeListValue="{{ oc }}{# tag="oc" , name="Other constraionts" , ref= "Part B 8.1" , desc= "Restrictions on the access and use of a resource or metadata" , example = "No conditions apply" , type ="MD_RestrictionCode" ,group= "Constraints" , multi= 0, multiline= False,inbox="Other restriction", inboxmulti=1  #}">{{ oc }}</gmd:MD_RestrictionCode>
                     </gmd:accessConstraints>
                {% endfor -%}
       {% for ac in md.identification.accessconstraints -%}{# tag="for oc in md.identification.accessconstraints" , group= "Constraints",inbox="Limitation on public access", inboxmulti=1  #}
                     <gmd:otherConstraints>
-                        <gco:CharacterString>{{ ac }} {# tag="ac" ,name="Access constraints", group= "Constraints",inbox="Limitations on public access", inboxmulti=1,ref= "Part B 8.2" , desc= "access constraints applied to assure the protection of privacy or intellectual property, and any special restrictionsor limitations on obtaining the resource." , example = "intellectualPropertyRights (rights to financial benefit from and control of distribution of non tangible property that is a result of creativity)." , type ="CharacterString", multi=0 ,  multiline= False #}</gco:CharacterString>
+                        <gco:CharacterString>{{ ac }} {# tag="ac" ,name="Access constraints", group= "Constraints",inbox="Limitations on public access", inboxmulti=1,ref= "Part B 8.2" , desc= "access constraints applied to assure the protection of privacy or intellectual property, and any special restrictionsor limitations on obtaining the resource." , example = "intellectualPropertyRights (rights to financial benefit from and control of distribution of non tangible property that is a result of creativity)." , type ="string", multi=0 ,  multiline= False #}</gco:CharacterString>
                     </gmd:otherConstraints>
                 </gmd:MD_LegalConstraints>
             </gmd:resourceConstraints>
@@ -170,7 +169,7 @@
                     <gmd:equivalentScale>
                         <gmd:MD_RepresentativeFraction>
                             <gmd:denominator>
-                                <gco:Integer>{{ den }}{# tag="den" , name="Equivalent scale" , ref= "Part B 6.2" , desc= "level of detail expressed as the scale denominator of a comparable hardcopy map or chart" , example = "50000 (e.g. 1:50000 scale map)" , type ="Integer" , group = "Quality and Validity" ,inbox="Spatial resolution-scale", multi=0 , inboxmulti=1, multiline= False #}</gco:Integer>
+                                <gco:Integer>{{ den }}{# tag="den" , name="Equivalent scale" , ref= "Part B 6.2" , desc= "level of detail expressed as the scale denominator of a comparable hardcopy map or chart" , example = "50000 (e.g. 1:50000 scale map)" , type ="integer" , group = "Quality and Validity" ,inbox="Spatial resolution-scale", multi=0 , inboxmulti=1, multiline= False #}</gco:Integer>
                             </gmd:denominator>
                         </gmd:MD_RepresentativeFraction>
                     </gmd:equivalentScale>
@@ -183,7 +182,7 @@
                     <gmd:spatialResolution>
                         <gmd:MD_Resolution>
                             <gmd:distance>
-                                <gco:Distance uom="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/uom/ML_gmxUom.xml#m">{{ d }}{# tag="d" , name="Distance" , ref= "Part B 6.2" , desc= "Ground sample distance" , example = "25" , type ="Integer" , group = "Quality and Validity" ,inbox="Spatial resolution-dostance", multi=0 , inboxmulti=1, multiline= False #}</gco:Distance>
+                                <gco:Distance uom="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/uom/ML_gmxUom.xml#m">{{ d }}{# tag="d" , name="Distance" , ref= "Part B 6.2" , desc= "Ground sample distance" , example = "25" , type ="integer" , group = "Quality and Validity" ,inbox="Spatial resolution-dostance", multi=0 , inboxmulti=1, multiline= False #}</gco:Distance>
                             </gmd:distance>
                         </gmd:MD_Resolution>
                     </gmd:spatialResolution>
@@ -191,7 +190,7 @@
       {% endif -%}
       {% for lan in md.identification.resourcelanguage -%}{# tag="for lan in md.identification.resourcelanguage" , group= "Identification" ,inbox='Languages',inboxmulti=1, multiline= False #}
             <gmd:language>
-                <gmd:LanguageCode codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#LanguageCode" codeListValue="{{ lan }}{{ lan }}{# tag="lan" , name="Metadata language" , ref= "Part B 10.3" , desc= "Language used for documenting metadata." , example = "eng" , type ="LanguageCode (ISO/TS 19139)" ,multi=0,inbox='Languages',inboxmulti=1, group= "Identification" , multiline= False #}"></gmd:LanguageCode>
+                <gmd:LanguageCode codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#LanguageCode" codeListValue="{{ lan }}{# tag="lan" , name="Metadata language" , ref= "Part B 10.3" , desc= "Language used for documenting metadata." , example = "eng" , type ="LanguageCode (ISO/TS 19139)" ,multi=0,inbox='Languages',inboxmulti=1, group= "Identification" , multiline= False #}">{{ lan }}</gmd:LanguageCode>
             </gmd:language>
       {% endfor -%}
       {% for tc in md.identification.topiccategory -%}{# tag="for tc in md.identification.topiccategory", inbox='Topic category',group= "Classification", multiline= False #}
@@ -204,16 +203,16 @@
                     <gmd:geographicElement>
                         <gmd:EX_GeographicBoundingBox>
                             <gmd:westBoundLongitude>
-                                <gco:Decimal>{{ md.identification.extent.boundingBox.minx }}{# tag="md.identification.extent.boundingBox.minx" , name="West Bound Longitude" , ref= "Part B 4.1" , desc= "Western-most coordinate of the limit of the dataset extent, expressed in longitude in decimal degrees (positive east)." , example = "3.93" , type ="Decimal" , group= "Geographic" ,  multi=0 ,  multiline= False #}</gco:Decimal>
+                                <gco:Decimal>{{ md.identification.extent.boundingBox.minx }}{# tag="md.identification.extent.boundingBox.minx" , name="West Bound Longitude" , ref= "Part B 4.1" , desc= "Western-most coordinate of the limit of the dataset extent, expressed in longitude in decimal degrees (positive east)." , example = "3.93" , type ="decimal" , group= "Geographic" ,  multi=0 ,  multiline= False #}</gco:Decimal>
                             </gmd:westBoundLongitude>
                             <gmd:eastBoundLongitude>
-                                <gco:Decimal>{{ md.identification.extent.boundingBox.maxx }}{# tag="md.identification.extent.boundingBox.maxx" , name="East Bound Longitude" , ref= "Part B 4.1" , desc= "Eastern-most coordinate of the limit of the dataset extent, expressed in longitude in decimal degrees (positive east)." , example = "7.57" , type ="Decimal" , group= "Geographic" ,  multi=0 ,  multiline= False #}</gco:Decimal>
+                                <gco:Decimal>{{ md.identification.extent.boundingBox.maxx }}{# tag="md.identification.extent.boundingBox.maxx" , name="East Bound Longitude" , ref= "Part B 4.1" , desc= "Eastern-most coordinate of the limit of the dataset extent, expressed in longitude in decimal degrees (positive east)." , example = "7.57" , type ="decimal" , group= "Geographic" ,  multi=0 ,  multiline= False #}</gco:Decimal>
                             </gmd:eastBoundLongitude>
                             <gmd:southBoundLatitude>
-                                <gco:Decimal>{{ md.identification.extent.boundingBox.miny }}{# tag="md.identification.extent.boundingBox.miny" , name="South Bound Latitude" , ref= "Part B 4.1" , desc= "Southern-most coordinate of the limit of the dataset extent, expressed in latitude in decimal degrees (positive north)." , example = "52.10" , type ="Decimal" , group= "Geographic" ,multi=0 , multiline= False #}</gco:Decimal>
+                                <gco:Decimal>{{ md.identification.extent.boundingBox.miny }}{# tag="md.identification.extent.boundingBox.miny" , name="South Bound Latitude" , ref= "Part B 4.1" , desc= "Southern-most coordinate of the limit of the dataset extent, expressed in latitude in decimal degrees (positive north)." , example = "52.10" , type ="decimal" , group= "Geographic" ,multi=0 , multiline= False #}</gco:Decimal>
                             </gmd:southBoundLatitude>
                             <gmd:northBoundLatitude>
-                                <gco:Decimal>{{ md.identification.extent.boundingBox.maxy }}{# tag="md.identification.extent.boundingBox.maxy" , name="North Bound Latitude" , ref= "Part B 4.1" , desc= "Northern-most coordinate of the limit of the dataset extent, expressed in latitude in decimal degrees (positive north)." , example = "54.10" , type ="Decimal" , group= "Geographic" , multi=0 ,  multiline= False #}</gco:Decimal>
+                                <gco:Decimal>{{ md.identification.extent.boundingBox.maxy }}{# tag="md.identification.extent.boundingBox.maxy" , name="North Bound Latitude" , ref= "Part B 4.1" , desc= "Northern-most coordinate of the limit of the dataset extent, expressed in latitude in decimal degrees (positive north)." , example = "54.10" , type ="decimal" , group= "Geographic" , multi=0 ,  multiline= False #}</gco:Decimal>
                             </gmd:northBoundLatitude>
                         </gmd:EX_GeographicBoundingBox>
                     </gmd:geographicElement>
@@ -226,8 +225,8 @@
                         <gmd:EX_TemporalExtent>
                             <gmd:extent>
                                 <gml:TimePeriod xsi:type="gml:TimePeriodType">
-                                    <gml:beginPosition>{{ md.identification.temporalextent_start }}{# tag="md.identification.temporalextent_start" , name="Starting date" , ref= "Part B 5.1" , desc= "Time period covered by the content of the dataset." , example = "From 1977-03-10T11:45:30 to 2005-01-15T09:10:00" , type ="TM_Primitive" , group= "Temporal" , inbox= "Temporal extend", multi=0 , inboxmulti= 0, multiline= False #}</gml:beginPosition>
-                                    <gml:endPosition>{{ md.identification.temporalextent_end }}{# tag="md.identification.temporalextent_end" , name="Ending date" , ref= "Part B 5.1" , desc= "Time period covered by the content of the dataset." , example = "From 1977-03-10T11:45:30 to 2005-01-15T09:10:00" , type ="TM_Primitive" , group= "Temporal" , inbox= "Temporal extend", multi=0 , inboxmulti= 0, multiline= False #}</gml:endPosition>
+                                    <gml:beginPosition>{{ md.identification.temporalextent_start }}{# tag="md.identification.temporalextent_start" , name="Starting date" , ref= "Part B 5.1" , desc= "Time period covered by the content of the dataset." , example = "2000-11-30" , type ="date" , group= "Temporal" , inbox= "Temporal extend", multi=0 , inboxmulti= 0, multiline= False #}</gml:beginPosition>
+                                    <gml:endPosition>{{ md.identification.temporalextent_end }}{# tag="md.identification.temporalextent_end" , name="Ending date" , ref= "Part B 5.1" , desc= "Time period covered by the content of the dataset." , example = "2000-11-30" , type ="date" , group= "Temporal" , inbox= "Temporal extend", multi=0 , inboxmulti= 0, multiline= False #}</gml:endPosition>
                                 </gml:TimePeriod>
                             </gmd:extent>
                         </gmd:EX_TemporalExtent>
@@ -251,7 +250,7 @@
                     <gmd:onLine>
                         <gmd:CI_OnlineResource>
                             <gmd:linkage>
-                                <gmd:URL>{{ ln.url }}{# tag="ln.url" , name="Linkage" , ref= "Part B 1.4" ,object='CI_OnlineResource()', desc= "Location (address) for on-line access using a Uniform Resource Locator address or similar addressing scheme." , example = "http://image2000.jrc.it" , type ="URL" , group= "Identification" ,multi=1, multiline= False #}</gmd:URL>
+                                <gmd:URL>{{ ln.url }}{# tag="ln.url" , name="Linkage" , ref= "Part B 1.4" ,object='CI_OnlineResource()', desc= "Location (address) for on-line access using a Uniform Resource Locator address or similar addressing scheme." , example = "http://image2000.jrc.it" , type ="url" , group= "Identification" ,multi=1, multiline= False #}</gmd:URL>
                             </gmd:linkage>
                         </gmd:CI_OnlineResource>
                     </gmd:onLine>
@@ -259,66 +258,66 @@
                 </gmd:MD_DigitalTransferOptions>
             </gmd:transferOptions>
         </gmd:MD_Distribution>
-    </gmd:distributionInfo>
-    <gmd:dataQualityInfo>
+       </gmd:distributionInfo>
+  <gmd:dataQualityInfo>
         <gmd:DQ_DataQuality>
             <gmd:scope>
                 <gmd:DQ_Scope>
                     <gmd:level>
-                        <gmd:MD_ScopeCode codeListValue="{{ md.identification.identtype }}{# tag="md.identification.identtype", name ="Resource Type", desc ="Scope to which metadata applies", example ="dataset", type = "CharacterString", multi = 0, group = "Identification",multiline=True #}" codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#MD_ScopeCode"></gmd:MD_ScopeCode>
+                        <gmd:MD_ScopeCode codeListValue="{{ md.identification.identtype }}{# tag="md.identification.identtype", name ="Resource Type", desc ="Scope to which metadata applies", example ="dataset", type = "string", multi = 0, group = "Identification",multiline=True #}" codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#MD_ScopeCode">{{ md.identification.identtype }}</gmd:MD_ScopeCode>
                     </gmd:level>
                 </gmd:DQ_Scope>
             </gmd:scope>
+ {% for (t,d,dt,dg) in zip(md.dataquality.conformancetitle,md.dataquality.conformancedate,md.dataquality.conformancedatetype,md.dataquality.conformancedegree) -%}{# tag="for (t,d,dt,dg) in zip(md.dataquality.conformancetitle,md.dataquality.conformancedate,md.dataquality.conformancedatetype,md.dataquality.conformancedegree)", group = "Conformity", inbox="Conformity",inboxmulti= 1 #}
+      <gmd:report>
+        <gmd:DQ_DomainConsistency xsi:type="gmd:DQ_DomainConsistency_Type">
+          <gmd:measureIdentification>
+            <gmd:RS_Identifier>
+              <gmd:code>
+                <gco:CharacterString>Conformity</gco:CharacterString>
+              </gmd:code>
+              <gmd:codeSpace>
+                <gco:CharacterString>INSPIRE</gco:CharacterString>
+              </gmd:codeSpace>
+            </gmd:RS_Identifier>
+          </gmd:measureIdentification>
+          <gmd:result>
+            <gmd:DQ_ConformanceResult xsi:type="gmd:DQ_ConformanceResult_Type">
+              <gmd:specification>
+                <gmd:CI_Citation>
+                  <gmd:title>
+                    <gco:CharacterString>{{ t }}{# tag="t" , name="Specification" , ref= "Part B 7.1" , desc= "citation of the product specification or user requirement against which data is being evaluated." , example = "INSPIRE Data Specification on orthoimagery - Guidelines" , type ="string" , group= "Conformity" , inbox= "Conformity", multi=0 , inboxmulti= 1, multiline= True #}</gco:CharacterString>
+                  </gmd:title>
+                  <gmd:date>
+                    <gmd:CI_Date>
+                      <gmd:date>
+                        <gco:Date>{{ d }}{# tag="d" , name="Date" , ref= "Part B 7.1" , desc= "citation of the product specification or user requirement against which data is being evaluated." , example = "2010-04-26" , type ="date" , group= "Conformity" , inbox= "Conformity", multi=0 , inboxmulti= 1, multiline= False #}</gco:Date>
+                      </gmd:date>
+                      <gmd:dateType>
+                        <gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue={{ "\"%s\"" % dt }}>{{ dt }}{# tag="dt" , name="Date type" , ref= "Part B 7.1" , desc= "a date type: creation, revision or publication." , example = "publication" , type ="dateType" , group= "Conformity" , inbox= "Conformity", multi=0 , inboxmulti= 1, multiline= False #}</gmd:CI_DateTypeCode>
+                      </gmd:dateType>
+                    </gmd:CI_Date>
+                  </gmd:date>
+                </gmd:CI_Citation>
+              </gmd:specification>
+              <gmd:explanation>
+                <gco:CharacterString>See the referenced specification</gco:CharacterString>
+              </gmd:explanation>
+              <gmd:pass>
+                <gco:Boolean>{{ dg }}{# tag="dg" , name="Degree" , ref= "Part B 7.1" , desc= "TODO" , example = "This is the degree of conformity of the resource to the implementing rules adopted under Article 7(1) of Directive 2007/2/EC or other specification." , type ="boolean" , group= "Conformity" , inbox= "Conformity", multi=0 , inboxmulti= 1, multiline= False #}</gco:Boolean>
+              </gmd:pass>
+            </gmd:DQ_ConformanceResult>
+          </gmd:result>
+        </gmd:DQ_DomainConsistency>
+      </gmd:report>
+      {% endfor -%}
             <gmd:lineage>
                 <gmd:LI_Lineage>
                     <gmd:statement>
-                        <gco:CharacterString>{{ md.dataquality.lineage }}{# tag="md.dataquality.lineage" , name="Lineage" , ref= "Part B 6.1" , desc= "General explanation of the data producers knowledge about the lineage of a dataset." , example = "Product 1 scenes correspond to the path/row of the Landsat orbit.." , type ="Text" , group= "Quality and Validity" ,  multiline= True #}</gco:CharacterString>
+                        <gco:CharacterString>{{ md.dataquality.lineage }}{# tag="md.dataquality.lineage" , name="Lineage" , ref= "Part B 6.1" , desc= "General explanation of the data producers knowledge about the lineage of a dataset." , example = "Product 1 scenes correspond to the path/row of the Landsat orbit.." , type ="string" , group= "Quality and Validity" ,  multiline= True #}</gco:CharacterString>
                     </gmd:statement>
                 </gmd:LI_Lineage>
             </gmd:lineage>
-        </gmd:DQ_DataQuality>
-    </gmd:dataQualityInfo>
-      {% for (t,d,dt,dg) in zip(md.dataquality.conformancetitle,md.dataquality.conformancedate,md.dataquality.conformancedatetype,md.dataquality.conformancedegree) -%}{# tag="for (t,d,dt,dg) in zip(md.dataquality.conformancetitle,md.dataquality.conformancedate,md.dataquality.conformancedatetype,md.dataquality.conformancedegree)", group = "Conformity", inbox="Conformity",inboxmulti= 1 #}
-    <gmd:report>
-        <gmd:DQ_DomainConsistency xsi:type="gmd:DQ_DomainConsistency_Type">
-            <gmd:measureIdentification>
-                <gmd:RS_Identifier>
-                    <gmd:code>
-                        <gco:CharacterString>Conformity</gco:CharacterString>
-                    </gmd:code>
-                    <gmd:codeSpace>
-                        <gco:CharacterString>INSPIRE</gco:CharacterString>
-                    </gmd:codeSpace>
-                </gmd:RS_Identifier>
-            </gmd:measureIdentification>
-            <gmd:result>
-                <gmd:DQ_ConformanceResult xsi:type="gmd:DQ_ConformanceResult_Type">
-                    <gmd:specification>
-                        <gmd:CI_Citation>
-                            <gmd:title>
-                                <gco:CharacterString>{{ t }}{# tag="t" , name="Specification" , ref= "Part B 7.1" , desc= "citation of the product specification or user requirement against which data is being evaluated." , example = "INSPIRE Data Specification on orthoimagery - Guidelines" , type ="CI_Citation" , group= "Conformity" , inbox= "Conformity", multi=0 , inboxmulti= 1, multiline= True #}</gco:CharacterString>
-                            </gmd:title>
-                            <gmd:date>
-                                <gmd:CI_Date>
-                                    <gmd:date>
-                                        <gco:Date>{{ d }}{# tag="d" , name="Date" , ref= "Part B 7.1" , desc= "citation of the product specification or user requirement against which data is being evaluated." , example = "2010-04-26" , type ="Date" , group= "Conformity" , inbox= "Conformity", multi=0 , inboxmulti= 1, multiline= False #}</gco:Date>
-                                    </gmd:date>
-                                    <gmd:dateType>
-                                        <gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue="{{ dt }}{# tag="dt" , name="Date type" , ref= "Part B 7.1" , desc= "a date type: creation, revision or publication." , example = "publication" , type ="dateType" , group= "Conformity" , inbox= "Conformity", multi=0 , inboxmulti= 1, multiline= False #}"></gmd:CI_DateTypeCode>
-                                    </gmd:dateType>
-                                </gmd:CI_Date>
-                            </gmd:date>
-                        </gmd:CI_Citation>
-                    </gmd:specification>
-                    <gmd:explanation>
-                        <gco:CharacterString>See the referenced specification</gco:CharacterString>
-                    </gmd:explanation>
-                    <gmd:pass>
-                        <gco:Boolean>{{ dg }}{# tag="dg" , name="Degree" , ref= "Part B 7.1" , desc= "Is it valid?" , example = "This is the degree of conformity of the resource to the implementing rules adopted under Article 7(1) of Directive 2007/2/EC or other specification." , type ="Boolean" , group= "Conformity" , inbox= "Conformity", multi=0 , inboxmulti= 1, multiline= False #}</gco:Boolean>
-                    </gmd:pass>
-                </gmd:DQ_ConformanceResult>
-            </gmd:result>
-        </gmd:DQ_DomainConsistency>
-    </gmd:report>
-      {% endfor -%}
+    </gmd:DQ_DataQuality>
+  </gmd:dataQualityInfo>
 </gmd:MD_Metadata>



More information about the grass-commit mailing list