Commit 73b3d4a9 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[profile gen] DescriptionLevel should be before Name in SEDA 0.2

parent 3436855cb5a6
......@@ -1174,14 +1174,14 @@ class SEDA02XSDExport(SEDA1XSDExport):
self.element_schema(archive_node, 'DescriptionLanguage', 'qdt:CodeLanguageType',
fixed_value='fr',
xsd_attributes=[LIST_VERSION_ID_2009])
# in SEDA 0.2, description level is on the archive element, not on its content description
content_entity = self.archive_unit_content(archive_unit)
self.xsd_description_level(archive_node, content_entity.description_level_concept)
name_entity = self.archive_unit_name(archive_unit)
self.element_schema(archive_node, 'Name', 'udt:TextType',
fixed_value=name_entity.title,
documentation=name_entity.user_annotation,
xsd_attributes=[XAttr('languageID', 'xsd:language')])
# in SEDA 0.2, description level is on the archive element, not on its content description
content_entity = self.archive_unit_content(archive_unit)
self.xsd_description_level(archive_node, content_entity.description_level_concept)
appraisal_rule_entity = self.archive_unit_appraisal_rule(archive_unit)
if appraisal_rule_entity:
self.xsd_appraisal_rule(archive_node, appraisal_rule_entity)
......@@ -1225,6 +1225,9 @@ class SEDA02XSDExport(SEDA1XSDExport):
# description
content_entity = self.archive_unit_content(archive_unit)
self.xsd_description_level(ao_node, content_entity.description_level_concept)
# actually DescriptionLevel should be before Name (ie. currently the last and first
# elements)
ao_node.insert(0, ao_node[-1])
# in SEDA 0.2, ArchiveObject tag name is 'Contains' (as for Archive)
archive_object_tag_name = 'Contains'
......
......@@ -42,14 +42,14 @@
</rng:attribute>
<rng:value type="string">fr</rng:value>
</rng:element>
<rng:element name="Name">
<rng:data type="string"/>
</rng:element>
<rng:element name="DescriptionLevel">
<rng:attribute name="listVersionID">
<rng:value type="token">edition 2009</rng:value>
</rng:attribute>
<rng:value type="string">file</rng:value>
</rng:element>
<rng:element name="Name">
<rng:data type="string"/>
</rng:element>
<rng:optional>
<rng:element name="Appraisal">
......@@ -125,6 +125,12 @@
</rng:element>
<rng:oneOrMore>
<rng:element name="Contains">
<rng:element name="DescriptionLevel">
<rng:attribute name="listVersionID">
<rng:value type="token">edition 2009</rng:value>
</rng:attribute>
<rng:data type="string"/>
</rng:element>
<rng:element name="Name">
<rng:data type="string"/>
</rng:element>
......@@ -158,16 +164,16 @@
<rng:data type="string"/>
</rng:element>
</rng:element>
</rng:element>
</rng:oneOrMore>
<rng:oneOrMore>
<rng:element name="Contains">
<rng:element name="DescriptionLevel">
<rng:attribute name="listVersionID">
<rng:value type="token">edition 2009</rng:value>
</rng:attribute>
<rng:data type="string"/>
</rng:element>
</rng:element>
</rng:oneOrMore>
<rng:oneOrMore>
<rng:element name="Contains">
<rng:element name="Name">
<rng:data type="string"/>
</rng:element>
......@@ -204,12 +210,6 @@
<rng:data type="string"/>
</rng:element>
</rng:element>
<rng:element name="DescriptionLevel">
<rng:attribute name="listVersionID">
<rng:value type="token">edition 2009</rng:value>
</rng:attribute>
<rng:data type="string"/>
</rng:element>
</rng:element>
</rng:oneOrMore>
<rng:zeroOrMore>
......
......@@ -84,20 +84,20 @@
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="Name">
<xsd:element fixed="file" name="DescriptionLevel">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="udt:TextType">
<xsd:attribute name="languageID" type="xsd:language" use="prohibited"/>
<xsd:extension base="qdt:CodeDescriptionLevelType">
<xsd:attribute fixed="edition 2009" name="listVersionID" type="xsd:token" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element fixed="file" name="DescriptionLevel">
<xsd:element name="Name">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="qdt:CodeDescriptionLevelType">
<xsd:attribute fixed="edition 2009" name="listVersionID" type="xsd:token" use="required"/>
<xsd:extension base="udt:TextType">
<xsd:attribute name="languageID" type="xsd:language" use="prohibited"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
......@@ -204,6 +204,15 @@
<xsd:element maxOccurs="unbounded" name="Contains">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DescriptionLevel">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="qdt:CodeDescriptionLevelType">
<xsd:attribute fixed="edition 2009" name="listVersionID" type="xsd:token" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="Name">
<xsd:complexType>
<xsd:simpleContent>
......@@ -251,6 +260,13 @@
<xsd:attribute name="Id" type="xsd:ID" use="prohibited"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="prohibited"/>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="unbounded" name="Contains">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DescriptionLevel">
<xsd:complexType>
<xsd:simpleContent>
......@@ -260,13 +276,6 @@
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="prohibited"/>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="unbounded" name="Contains">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name">
<xsd:complexType>
<xsd:simpleContent>
......@@ -318,15 +327,6 @@
<xsd:attribute name="Id" type="xsd:ID" use="prohibited"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="DescriptionLevel">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="qdt:CodeDescriptionLevelType">
<xsd:attribute fixed="edition 2009" name="listVersionID" type="xsd:token" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="prohibited"/>
</xsd:complexType>
......
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