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

Generating grandchild element with choice from schema #1463

Open
datho7561 opened this issue Jan 24, 2023 · 0 comments
Open

Generating grandchild element with choice from schema #1463

datho7561 opened this issue Jan 24, 2023 · 0 comments
Labels
code action enhancement New feature or request

Comments

@datho7561
Copy link
Contributor

Given the following schema:

<grammar xmlns="http://relaxng.org/ns/structure/1.0"
  datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <ref name="root" />
  </start>
  <define name="root">
    <element name="root">
      <choice>
        <element name="child1">
          <choice>
            <element name="child1A">
              <text />
            </element>
            <element name="child1B">
              <text />
            </element>
          </choice>
        </element>
        <element name="child2">
          <choice>
            <element name="child2A">
              <text />
            </element>
            <element name="child2B">
              <text />
            </element>
          </choice>
        </element>
      </choice>
    </element>
  </define>
</grammar>

If you have the XML document <root></root> and you use the code action to generate child1, currently it generates child1A as well. I think it might be better to provide an additional code action that only generates child1, so that the user has the option to pick between child1A and child1B.

@datho7561 datho7561 added enhancement New feature or request code action labels Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code action enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant