Skip to content

dvdkruk/xtext-xsd-resourceprovider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xtext-xsd-resourceprovider

Two projects to make XSD references possible in your Xtext grammar. This project uses the concepts explained in https://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/.

Tech

  • Java 8
  • Xtext
  • Eclipse XML Schema Editor

How To Use

  • Import the org.eclipse.xtext.xsd and org.eclipse.xtext.xsd.ui projects into your workspace.
  • Add the following required bundles to the MANIFEST.MF of your core Xtext DSL project:
org.eclipse.xtext.xsd,
org.eclipse.xtext.xsd.ui,
org.eclipse.xsd
  • Add the following lines to your .mwe2 generate file:
Workflow {
  bean = org.eclipse.emf.mwe.utils.StandaloneSetup {
    scanClassPath = true
    platformUri = rootPath
    registerGeneratedEPackage = "org.eclipse.xsd.XSDPackage"
    registerGenModelFile = "platform:/resource/org.eclipse.xsd/model/XSD.genmodel"
  }
}
  • Add the following import to your Xtext grammar file (.xtext):
import "http://www.eclipse.org/xsd/2002/XSD" as xsd

Note: Imports should be added between the grammar and generate declarations.

  • Now your Xtext DSL can reference to elements defined in XSD files. For example, the following rule is now possible:
TypeInstance:
  'instance' name=ID ':' type=[xsd::XSDTypeDefinition|QN];
  
QN:
  ID ('.' ID)*;

About

Two projects to make XSD references possible in your Xtext grammar.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages