Ensure your Plurals are correct – XpressDox

Ensuring that plurals are correct on your XpressDox templates

Documents / Precedents often have numerous places where constructs such as “is/are” or “child/children” appear, or else the singular is always used.

With document assembly, and XpressDox in particular, the template can provide instructions in conditional assembly which can insert the correct words in the places where they are required.

 

Using the When command with the Count function

This is probably the quickest and easiest way to ensure plurals are correct on your document. Use the When command in conjunction with the Count function. Because XpressDox counts the number of items inside a ForEach (beginning at 1), you can use that count to work out if there is 1 or more than 1 item in the ForEach. With that information, it’s easy to insert a quick When (or If) command based on that count to insert the correct plural.

«ForEach(Beneficiary)»
«FirstName» «LastName»
«End()»
The «when(count(Beneficiary) > 1,beneficiaries are,beneficiary is)» …

 

Using the Plural function (in conjunction with a ForEach)

An example would be:

The name«Plural(count(Child),' ','s')» of my child«Plural(count(Child),' is','ren are')» «ForEach(Child)»«When(position() > 1, and )»«Name»«End()»

 

Using the Plural function (with no ForEach)

Sometimes the number cannot be inferred using the count() function and has to be requested explicitly either in an interview or perhaps in data retrieved from a data source which is nonetheless not repeating.  In this case a checkbox or a list asking if there is only one child, and then document logic based off of that answer, would do the trick. The Plural command is not necessary, you could also use document logic and say «When(OnlyOneChild = ‘Y’,is,ren are)». It’s a little bit shorter.

«ChooseUsingCheckBox(OnlyOneChild,Y,N)»
The name«Plural((OnlyOneChild = 'Y'),' ','s')» of my child«Plural((OnlyOneChild = 'Y'),' is','ren are')» «ChildNames»