Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multi branch, multi token format fills #10

Open
LandingEllipse opened this issue Apr 27, 2021 · 0 comments
Open

Support multi branch, multi token format fills #10

LandingEllipse opened this issue Apr 27, 2021 · 0 comments
Labels
feature New feature or request

Comments

@LandingEllipse
Copy link
Contributor

LandingEllipse commented Apr 27, 2021

I've just implemented support for multiple fill format tokens, however fills declared on a multi branch are restricted to yielding a single substitution. The reason being that nested node-sets are not supported in XPath/lxml. For instance, the following raises an XPathResultError:

pt:sequence(pt:sequence('B1 T1', 'B1 T2'), pt:sequence('B2 T1', 'B2 T2'))`

A way around this could be to use Element nesting instead of node-sets for the pt:sequence extension function (i.e. return a detached tree), and change the internal implementation of how fills are handled accordingly (e.g. if we're on a multi branch, select the corresponding child of the evaluated root element, then use its children as token substitutions).

@LandingEllipse LandingEllipse added the feature New feature or request label Apr 27, 2021
LandingEllipse added a commit that referenced this issue Apr 27, 2021
Treat members of node sets as format token substitutions for fill
expressions declared outside of multi branch contexts (where they
would otherwise be greedily mapped to branches instead).

Fill expressions within multi branches are currently unable to declare
more than one substitution (see #10).
LandingEllipse added a commit that referenced this issue Apr 27, 2021
Treat members of node sets as format token substitutions for fill
expressions declared outside of multi branch contexts (where they
would otherwise be greedily mapped to branches instead).

Fill expressions within multi branches are currently unable to declare
more than one substitution (see #10).
LandingEllipse added a commit that referenced this issue Apr 28, 2021
Ensure pt:sequence unwraps single-member node-sets, and complains in the
case of empty of multi-member node-sets (see #10)
LandingEllipse added a commit that referenced this issue Apr 28, 2021
Ensure pt:sequence unwraps single-member node-sets, and complains in the
case of empty of multi-member node-sets (see #10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant