0

I am working on my own eclipse plugin, which includes parsing CompleteOCL file. I worked it out when I run the plugin by click on the "Luanch an Eclipse application" in overview tab of plugin.xml. But since I wanted to deploy the plugin elsewhere, I wrote a simple product file and click the run button on the product file, It occurs an error says "SAXSparseEception: 'Constraints.ocl'; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog".

I checked the encoding of my complete ocl file, and it is UTF-8.(I think this is OK.)

https://www.eclipse.org/forums/index.php/t/1075241/ This page gave me a clue, in the answers, "The Web editor does not use Equinox. That's why you have to register the respective EPackage in the standalone setup manually. In Equinox, this happens by means of the extension point "org.eclipse.emf.ecore.generated_package"." I don't know if this would help in my occasion, because I developed the plugin in Eclipse Papyrus, and it contains Equinox in the first place. What should I do? Thanks in advance.

1 Answers1

0

It looks as if the *.ocl file is being read as XML and diagnosed as not-XML. This is usually because the appropriate Xtext setup has not been invoked to register the *.ocl to 'XML' parser. Try invoking

org.eclipse.ocl.xtext.completeocl.CompleteOCLStandaloneSetup.doSetup()

Ed Willink
  • 1,205
  • 7
  • 8
  • Apologies. Newer Eclipse help documentation has not been successfully indexed by Google since older Eclipse help documentation was moved to archive breaking the links. You therefore get no useful hits on CompleteOCLStandaloneSetup. You will have to open the Eclipse OCL documentation within Eclipse and search there. – Ed Willink Jul 06 '23 at 12:53
  • Thank you. But may I ask, how can I open the Eclipse OCL Documentation within Eclipse? I tried press Ctrl and click on the OCL class, but I got source not found. Please forgive me for my unfamiliar with Eclipse. – Kelly Wang Jul 13 '23 at 08:56
  • I add `CompleteOCLStandaloneSetup.doSetup()` at the top of my java file, and it works. Thank you very much. – Kelly Wang Jul 13 '23 at 09:09
  • Help->Help Contents->OCL Documentation – Ed Willink Jul 13 '23 at 12:47