Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Grammar in XML and attribute completion
Grammar in XML and attribute completion [message #719868] Mon, 29 August 2011 09:13 Go to next message
Roded Bahat is currently offline Roded Bahat
Messages: 152
Registered: August 2011
Senior Member
Hello all,
I'm quite new to EMF and xText besides the reading and experimenting done for the last few days. I figured that before starting implementing anything, It would be better to ask the collective for some advice:

We use propriety XML files for configuration and as DSLs (more on that in a bit). My final goal is to allow visually editing of those XML files via an Eclipse plugin and not have the users fuddle about with the XML itself.

This would've been easy with simple XMLs but I have the following aspirations:
1) The configuration files rely on other XML files for some definitions for which I'd like to allow auto-completion. (For example, if a base XML has an <output name="x"> tag, I'd like to be able to auto-complete the name attribute of an <input> tag in a different XML to that of the same name defined in the base XML).
2) We use XMLs as DSLs. For example:
<condition>
<conidionStatement>!myDslFlag</conditionStatement>
<statement>myDslVariable = myDslMethod(arg)</statement>
</condition>

I'd like to be able to auto-complete & syntax color our grammar inside XML those tags.

I'd really appreciate any inputs or points in the right direction regarding how to accomplish the above.
Thanks,
Roded

[Updated on: Mon, 29 August 2011 09:23]

Report message to a moderator

Re: Grammar in XML and attribute auto-completion [message #720016 is a reply to message #719868] Mon, 29 August 2011 17:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26141
Registered: July 2009
Senior Member
Roded,

Comments below.

On 29/08/2011 2:13 AM, Roded wrote:
> Hello all,
> I'm quite new to EMF and xText besides the reading and experimenting
> done for the last few days. I figured that before starting
> implementing anything, It would be better to ask the collective for
> some advice:
>
> We use propriety XML files for configuration and as DSLs (more on that
> in a bit). My final goal is to allow visually editing of those XML
> files via an Eclipse plugin and not have the users fuddle about with
> the XML itself.
XML isn't fit for human consumption.
>
> This would've been easy with simple XMLs but I have the following
> aspirations:
> 1) The configuration files rely on other XML files for some
> definitions for which I'd like to allow auto-completion. (For example,
> if a base XML has an <output name="x"> tag, I'd like to be able to
> auto-complete the name attribute of an <input> tag in a different XML
> to that of the same name defined in the base XML).
I see.
> 2) We use XMLs as DSLs. For example:
> <condition>
> <conidionStatement>!myDslFlag</conditionStatement>
> <statement>myDslVariable = myDslMethod(arg)</statement>
> </condition>
> I'd like to be able to auto-complete & syntax color our grammar
> inside XML those tags.
I'm not sure that Xtext is appropriate for defining an XML syntax. The
Web Tools project has a structured XML editor that might well be more
appropriate.

Perhaps you'd be far better off defining a human readable syntax with
Xtext and providing some type of "save as XML" ability if some other
part of your runtime stack really needs the XML rather than the human
readable notation.
>
> I'd really appreciate any inputs or points in the right direction
> regarding how to accomplish the above.
> Thanks,
> Roded
Re: Grammar in XML and attribute auto-completion [message #720306 is a reply to message #720016] Tue, 30 August 2011 10:52 Go to previous message
Roded Bahat is currently offline Roded Bahat
Messages: 152
Registered: August 2011
Senior Member
Thanks for your reply Ed.
I generally agree with you, but there are restrictions..

I'll focus my current efforts on the Web Tools XML editor.
Thanks,
Roded
Previous Topic:[CDO] folder concept
Next Topic:[CDO] Exception with queryXRefs and teneo Annotation @Transient
Goto Forum:
  


Current Time: Sat Oct 25 09:45:24 GMT 2014

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

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