Commit ebc5f5ae authored by Alexander Gehrke's avatar Alexander Gehrke
Browse files

Fix namespaces and missing elements in default metadata

parent 53d84b69
This diff is collapsed.
This diff is collapsed.
......@@ -140,7 +140,7 @@ def parseString(inString, silence=False, print_warnings=True):
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(
sys.stdout, 0, name_=rootTag,
namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"')
namespacedef_='xmlns="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"')
if print_warnings and len(gds_collector.get_messages()) > 0:
separator = ('-' * 50) + '\n'
sys.stderr.write(separator)
......
......@@ -82,19 +82,21 @@ supermod.PcGtsType.subclass = PcGtsTypeSub
class MetadataTypeSub(supermod.MetadataType):
def __init__(self, externalRef: str = None, Creator: Optional[str] = None, Created: Optional[str] = None,
LastChange: Optional[str] = None, Comments: Optional[List[str]] = None,
def __init__(self, Creator: str, Created: str,
LastChange: Optional[str] = None, externalRef: str = None, Comments: Optional[List[str]] = None,
UserDefined: Optional[UserDefinedTypeSub] = None,
MetadataItem: Optional[List[MetadataTypeSub]] = None):
super(MetadataTypeSub, self).__init__(externalRef, Creator, Created, LastChange, Comments, UserDefined,
super(MetadataTypeSub, self).__init__(externalRef, Creator, Created, LastChange or Created, Comments, UserDefined,
MetadataItem)
@staticmethod
def default() -> MetadataTypeSub:
from pypagexml import PCGTS_CREATOR
now = iso_now()
return MetadataTypeSub(
Creator=PCGTS_CREATOR,
Created=iso_now(),
Created=now,
LastChange=now,
)
......@@ -1216,7 +1218,7 @@ def parse(inFilename, silence=False):
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(
sys.stdout, 0, name_=rootTag,
namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"',
namespacedef_=DefaultNamespace,
pretty_print=True)
return rootObj
......@@ -1264,7 +1266,7 @@ def parseString(inString, silence=False):
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(
sys.stdout, 0, name_=rootTag,
namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"')
namespacedef_=DefaultNamespace)
return rootObj
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment