Eclipse xtext- Xml grammar

alexhamed

New Member
I am writing a project using Eclipse xtext framework. I want to make a grammar for XML language. How can I parse open and close tags ? When I give something like this:\[quote\] \[code\]Body: '<'Type'>''</'type=[Type]'>';\[/code\] \[code\]Type: name=ID;\[/code\]\[/quote\]It allows to have tags like that: \[quote\] \[code\]<foo></foo>\[/code\] \[code\]<bar></foo>\[/code\]\[/quote\]I would like to have only the possibility like that: \[quote\] \[code\]<foo></foo>\[/code\] \[code\]<bar></bar>\[/code\]\[/quote\]What is the best way to do that?
 
Back
Top