DocumentRoot is generated in final XML [message #1408655] |
Fri, 15 August 2014 17:58 |
Alex Kravets Messages: 561 Registered: November 2009 |
Senior Member |
|
|
I was working on my model and wrote substantial supporting code around it. After needed regen my XML contains DocumentRoot in it:
<?xml version="1.0" encoding="UTF-8"?>
<rep:DocumentRoot xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:rep="http://repo.com/xml/repository">
<rChannel description="" name="ww" targetServer="7.0.2-SNAPSHOT" uid="161FC3B35274C9963FA4DAD0574DF550"/>
</rep:DocumentRoot>
I am not sure what caused it, and I remember I fix this in the past, but don't remember what I did. I have different roots of the model created into separate files and all of them, including above mentioned channel element using the same code:
protected abstract EReference getModelEReference();
protected EObject createInitialModel(String guid) {
EClass eClass = ExtendedMetaData.INSTANCE.getDocumentRoot(channelPackage);
EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(getModelEReference().getName());
EObject rootObject = channelFactory.create(eClass);
rootObject.eSet(eStructuralFeature, EcoreUtil.create((EClass)eStructuralFeature.getEType()));
EObject feature = (EObject) rootObject.eGet(eStructuralFeature);
feature.eSet(ChannelPackage.eINSTANCE.getComponent_Name(), (String) model.get(AbstractIWResourceGeneralPropertiesPage.RESOURCE_NAME));
feature.eSet(ChannelPackage.eINSTANCE.getComponent_Description(), (String) model.get(AbstractIWResourceGeneralPropertiesPage.RESOURCE_DESC));
feature.eSet(ChannelPackage.eINSTANCE.getComponent_TargetServer(), (String) model.get(AbstractIWResourceGeneralPropertiesPage.RESOURCE_TARGET_VERSION));
feature.eSet(ChannelPackage.eINSTANCE.getComponent_Uid(), guid);
return rootObject;
}
I think it's something minor I overlooked. Any help is appreciated.
[Updated on: Fri, 15 August 2014 17:59] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02870 seconds