Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

don't follow the simplification algorithm so closely #45

Open
lddubeau opened this issue Jul 25, 2018 · 0 comments
Open

don't follow the simplification algorithm so closely #45

lddubeau opened this issue Jul 25, 2018 · 0 comments

Comments

@lddubeau
Copy link
Member

Problem

Relax NG specifies that during simplification group, interleave and choice are transformed so that each of them contain at most two children. (That's step 10.) This leads to a multiplication of elements and some complications:

  1. It takes time to perform the transformation.

  2. More elements means more walking during later simplification steps and during constraint checks.

  3. It also leads to a bigger JSON file once serialized.

  4. It also means a deeper walker tree during validation, though this may not have that much impact on validation performance.

Solution 1: Don't Perform the Work in Step 10

Not performing the simplification of these elements would take care of the issues above. However:

  • It requires rewriting Group, Interleave and Choice to handle multiple children, which may make them much more complex.

  • It means losing the 1-to-1 steps between our internal simplifier and the old XSL code. Harder to test.

  • We need to carefully assess the impact on later simplification steps because they assume that the transformation in step 10 has been done.

  • It may also affect the constraint checks.

Solution 2: Add a Later Step Which Collapses the Elements

Another approach, rather than not performing the transformation, would be to add a step that would collapse the group, interleave and choice elements at the end of simplification. This would take care of complications 3 and 4 but it would add to the total simplification time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant