Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to get the position in the XML file where a validation error occures?
How to get the position in the XML file where a validation error occures? [message #392934] Wed, 18 May 2005 06:35 Go to next message
Michael Scharf is currently offline Michael ScharfFriend
Messages: 301
Registered: July 2009
Senior Member
Hi,

we are using models in an makefile based build process.
This calls a java program that uses emf to read some xml files.
Normally the model validation is done in the UI. However,
some command-line customers are using emacs/vi to edit
the xml files directlt. The java program is using EMF to
validate xml file.

Is there a way to spit out the position in the XML file
where the validation error occured?

This would also be interesting for a multi page editor
that shows a page with the xml code.

Michael
Re: How to get the position in the XML file where a validation error occures? [message #392935 is a reply to message #392934] Wed, 18 May 2005 10:12 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Michael,

No, not directly. An in memory model instance may not even have come
from an XML file or may have been just created and never been saved to
an XML file yet. I know some folks have written code to associate line
numbers while parsing (since the XMLHandler can know about the line
number at the point that it creates each object). That would be an
interesting load option which could be used if you immediately validate
the model to give feedback in terms of line numbers. I could imagine
recording line numbers while saving too. I suppose line number tracking
would be an interesting feature request...


Michael Scharf wrote:

> Hi,
>
> we are using models in an makefile based build process.
> This calls a java program that uses emf to read some xml files.
> Normally the model validation is done in the UI. However,
> some command-line customers are using emacs/vi to edit
> the xml files directlt. The java program is using EMF to
> validate xml file.
>
> Is there a way to spit out the position in the XML file
> where the validation error occured?
>
> This would also be interesting for a multi page editor
> that shows a page with the xml code.
>
> Michael
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:JET: How to dynamically change newline NL separator?
Next Topic:Strange problems encountered using FormEditor with an EMF Model
Goto Forum:
  


Current Time: Thu Apr 25 21:37:51 GMT 2024

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

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

Back to the top