eXist-db/shared-resources

templates:each creates wrapping element

Opened this issue · 2 comments

Applies to current shared-resources v0.4.0.

The example from http://exist-db.org/exist/apps/demo/examples/templating/templates.html
does wrap all <tr> elements in a <tr>.

Replacing %templates:wrap with %templates:replace solves the issue.

The current version of templates.xql does not seem to have this problem but is not released yet.

This issue states that the problem had already been fixed in source but just wasn't released yet. There have been releases since then, so the fix was surely included.

@line-o Please reopen if I'm incorrect.

This problem indeed remains in source. The cause was https://github.com/eXist-db/shared-resources/pull/29/files#diff-7f941bbe6a7334081fb7678dc7e71b99R451-R453 - adapted from https://github.com/eXist-db/shared-resources/pull/27/files#diff-7f941bbe6a7334081fb7678dc7e71b99R459-R461. However, the solution shouldn't be to change %templates:wrap to %templates:replace, since replace is not a supported or documented annotation. The solution is to remove the %templates:wrap annotation. I'll investigate if any other items deleted in that PR should be reinstated, and I'll submit a PR.