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

Assert no duplicate field name in common property binding context #11

Open
safris opened this issue Aug 9, 2023 · 0 comments
Open

Assert no duplicate field name in common property binding context #11

safris opened this issue Aug 9, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@safris
Copy link
Collaborator

safris commented Aug 9, 2023

In the following example, each of the 4 paths bind to field "a". Since the context of each binding is object "o", the fields collide.

<binding>
  <xi:include href="schema.jsdx"/>

  <any path="o[0]"><bind lang="java" field="a"/></any>
  <reference path="o.r"><bind lang="java" field="a"/></reference>
  <boolean path="o.b"><bind lang="java" field="a"/></boolean>
  <number path="o.n"><bind lang="java" field="a"/></number>
  <string path="o.s"><bind lang="java" field="a"/></string>

</binding>

This can be detected by something akin <xs:assert test="count(replace($path, '([^\\]|\\\\)[\.\[].*', concat('$1.', $field)) = count(distinct-values(replace($path, '([^\\]|\\\\)[\.\[].*', concat('$1.', $field)))"/>.

@safris safris added the enhancement New feature or request label Aug 9, 2023
@safris safris added this to the v0.5 milestone Aug 9, 2023
@safris safris self-assigned this Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant