Skip to main content



      Home
Home » Modeling » TMF (Xtext) » XML Meta Model
XML Meta Model [message #45217] Mon, 25 May 2009 07:17 Go to next message
Eclipse UserFriend
Hello,
I have some idea make XML editor with some extension with xtext.
I need use standard XML but with some additional rules for attribute value.
It is possible to do it this way?
Can I get some XML Meta model ,where and how can I use it?
Thanks a lot for your answer.
Re: XML Meta Model [message #45347 is a reply to message #45217] Tue, 26 May 2009 02:53 Go to previous message
Eclipse UserFriend
Do you have a generic XML editor in mind, or an XML-dialect, i.e. a
concrete language reusing XML's syntax?
Have you had a look at what WTP offers? They have an XML editor, which
is extendable.

If you want your own langauge with XML syntax, you should come up with
your own specific meta model. The easiest way, would be to let the meta
model be derived from your grammar.
An XML-like grammar could be written like so:

Element :
'<' name=ID (attributes+=Attribute)* '>'
(children+=Element)*
'</' closingName=ID '>'
|
'<' name=ID (attributes+=Attribute)* '/>';

Attribute :
name=ID '=' value=STRING;

Very basic and you'll have to validate that name == closingName in the
first alternative of Element.

Hope that helps,
Sven


Martin Novak schrieb:
> Hello,
> I have some idea make XML editor with some extension with xtext.
> I need use standard XML but with some additional rules for attribute value.
> It is possible to do it this way?
> Can I get some XML Meta model ,where and how can I use it?
> Thanks a lot for your answer.
>
Previous Topic:importing subpackages of external ecore models
Next Topic:[Announce] TMF XTEXT 0.7.0RC1 is available
Goto Forum:
  


Current Time: Sat Jul 12 07:21:06 EDT 2025

Powered by FUDForum. Page generated in 0.23749 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top