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

Function for determining the number of documents #22

Open
xatapult opened this issue Aug 23, 2020 · 0 comments
Open

Function for determining the number of documents #22

xatapult opened this issue Aug 23, 2020 · 0 comments

Comments

@xatapult
Copy link
Contributor

xatapult commented Aug 23, 2020

In one of the things I did in XProc 3 I had a p:for-each that could spit out zero or more documents. If it were zero documents I needed some special handling, so I had to write a test for it. That is currently not straightforward. What I finally did was:

<p:if collection="true" test="count(collection()) eq 0">

That works but feels like a nerdy trick. I would advocate to add a function that returns the number of documents: p:document-count() or whatever.

Can also be solved by #48.

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

No branches or pull requests

1 participant