-1

I am developing some tool using eclipse emf modeling and I would like to know how to get the xml line number of an parsed object. I need this in order to create file problem markers during data validation. I read some topics about this but I couldn't find the information I was looking for. I was thinking that maybe somebody can help me with some hints regarding how to do that.

Thanks.

L. B.
  • 1

1 Answers1

0

I don't know if EMF provides this feature.

I haven't tried it but would start looking into how you can customize the XML deserialization process. It's possible to store the line number of each XML DOM node during de-serialization process. With XMLResource.getDOMHelper() you should be able to build a mapping between XML nodes and EMF objects. Using this mapping it should be possible to associate each EMF object with a line in XML file.

kapex
  • 28,903
  • 6
  • 107
  • 121