Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » tracing EObjects to locations in a XML file
tracing EObjects to locations in a XML file [message #186045] Thu, 11 January 2007 19:02
Eclipse UserFriend
Originally posted by: rasmusmodsat.hotmail.com

Hi,

I recently asked the following question on the EMF group and was told, that
the WTP group had already solved this problem. So if anyone can answer this
question and direct me to the appropriate place in the source then I would
be very grateful.

I have a method which loads an xml file based on a previously generated
xsd2ecore-mapping and generated model code.

public Resource loadResource(String path, String eNS, EPackage ePackage,
Resource.Factory resourceFactory) {
System.out.println("load resource: "+path);
ResourceSet resourceSet = new ResourceSetImpl();
final ExtendedMetaData extendedMetaData = new
BasicExtendedMetaData(resourceSet.getPackageRegistry());
resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
extendedMetaData);
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put
(Resource.Factory.Registry.DEFAULT_EXTENSION, resourceFactory);
resourceSet.getPackageRegistry().put(eNS, ePackage);
Resource resource = resourceSet.getResource(URI.createFileURI(path),
true);
return resource;
}

This gives me a Resource with an instance of my EMF model. My question now
is: How can I trace EObjects back to specific locations in my xml-file? I
imagine a marker-based approach.

-- HW
Previous Topic:About extension point 'OperationExtension'
Next Topic:Websphere 6.1 support?
Goto Forum:
  


Current Time: Wed Apr 24 21:23:05 GMT 2024

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

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

Back to the top