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

Don't omit sequence on RNG generation

Else we may end up in bad element ordering when some sequence is not generated,
eg when iterating on children, if first element is a skipped sequence, its
sibling elements will occur before its children, while they should not.
parent 6493df257368
...@@ -611,9 +611,8 @@ class SEDA2RelaxNGExport(RNGMixin, SEDA2ExportAdapter): ...@@ -611,9 +611,8 @@ class SEDA2RelaxNGExport(RNGMixin, SEDA2ExportAdapter):
def element_sequence(self, occ, profile_element, target_value, to_process, card_entity): def element_sequence(self, occ, profile_element, target_value, to_process, card_entity):
parent_element = self._rng_element_parent(occ, card_entity, profile_element) parent_element = self._rng_element_parent(occ, card_entity, profile_element)
if parent_element.tag == '{http://relaxng.org/ns/structure/1.0}choice': target_element = self.element('rng:group', parent_element) # XXX sequence
parent_element = self.element('rng:group', parent_element) # XXX sequence to_process[occ.target].append((target_value, target_element))
to_process[occ.target].append((target_value, parent_element))
def element_xmlattribute(self, occ, profile_element, target_value, to_process, card_entity): def element_xmlattribute(self, occ, profile_element, target_value, to_process, card_entity):
parent_element = self._rng_attribute_parent(occ, card_entity, profile_element) parent_element = self._rng_attribute_parent(occ, card_entity, profile_element)
......
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