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

Improve XML references pattern #1466

Open
angelozerr opened this issue Jan 25, 2023 · 0 comments
Open

Improve XML references pattern #1466

angelozerr opened this issue Jan 25, 2023 · 0 comments
Assignees

Comments

@angelozerr
Copy link
Contributor

angelozerr commented Jan 25, 2023

Today XML references uses pattern to know if expressions must be applied for a given XML file.

"xml.references": [
    {
      "pattern": "**/docbook.xml",
      "expressions": [
        {
          "from": "xref/@linkend",
          "to": "@id"
        }
      ]
    }
  ]

Those references will be applied for all XML document which matches the pattern **/docbook.xml

Instead of providing only pattern It should be nice if we could add more filter like:

  • apply for xsd, apply for rng, etc
"xml.references": [
    {
      "applyFor": "xsd",
   }
  ]
  • defines URIs of some grammar file ex : *tei.xsd
"xml.references": [
    {
      "whenBoundWithGrammar": "**/tei.xsd",
   }
  ]
  • defines include element (ex : xs:include/@href xs:import/@href for xsd)
"xml.references": [
    {
      "applyFor": "xsd",
      "include": ["xs:include/@href", "xs:import@href"],
      "expressions": [
             {
               "from": "element/@type",
               "to": "complexType/@name"
             }
        ]
     }
  ]

It should be nice too to contribute to XML references plugin with a plugin. The goal is to use XML references to manage references for xs:completxType/@name for XSD and define/@name for rng which are managed todaywith scpecific code.

As XML references is superiror to custom code which manages XSD and RNG, those files should use XML references support.

In other words, XSD plugin will be able to register this XML references

"xml.references": [
    {
      "applyFor": "xsd",
      "include": ["xs:include/@href", "xs:import@href"],
   }
  ]

And all features for XSD:

will be managed by XML references support and we will able to to remove all code specific for XSD which manages that (very nice for maintenance)

@angelozerr angelozerr self-assigned this Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant