Problem loading a resource with renamed feature [message #718441] |
Wed, 24 August 2011 06:41  |
Eclipse User |
|
|
|
Hi,
I'm working on an EMF-based data model which is serialized to XML. This file must follow the OPF specification which means that certain features must be renamed. This is solved using ExtendedMetaData in the ECore model. as such:
<eStructuralFeatures xsi:type="ecore:EAttribute" name="uniqueIdentifier" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="unique-identifier"/>
</eAnnotations>
</eStructuralFeatures>
An example result file looks like this (generated by existing code):
<?xml version="1.0" encoding="UTF-8"?>
<opf:package xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="uuid">
<opf:metadata>
<dc:title>Mylyn Docs Test EPUB</dc:title>
<dc:creator opf:role="aut" opf:file-as="Resheim, Torkild U.">Torkild U. Resheim</dc:creator>
<dc:subject>Testing</dc:subject>
<dc:contributor opf:role="red">Eclipse Committers and Contributors</dc:contributor>
<dc:date opf:event="creation">2011-08-24</dc:date>
<dc:format>application/epub+zip</dc:format>
<dc:identifier id="uuid" opf:scheme="UUID">f47799a9-3d87-41ff-a7ac-5df16632e7be</dc:identifier>
<dc:source>Eclipse</dc:source>
<dc:language>en</dc:language>
</opf:metadata>
<opf:manifest>
<opf:item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
<opf:item id="plain-page" href="plain-page.xhtml" media-type="application/xhtml+xml"/>
</opf:manifest>
<opf:spine toc="ncx">
<opf:itemref idref="plain-page"/>
</opf:spine>
<opf:guide/>
</opf:package>
Now, the problem arises when I want to load the same file. It appears that the loading mechanism figures out how to start as I do get an instance of OPFPackage which represents opf:package. However the parser barfs at "unique-identifier" with the message "org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'unique-identifier' not found". I cannot see why the ExtendedMetaData for the package are not applied.
I would be grateful for any help resolving this.
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10875 seconds