Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xtend] How to create and populate an XMLFeatureMap
[Xtend] How to create and populate an XMLFeatureMap [message #714037] Tue, 09 August 2011 16:34 Go to next message
Peter Keller is currently offline Peter KellerFriend
Messages: 14
Registered: October 2009
Junior Member
I have been using Xtend's XSD adapter for a while now to generate XML schemata, but now for the first time I need to generate a
<xs:annotation><xs:documentation>
element. This apparently simple task has got me completely stuck. Can anyone help?

I have used the debugger to examine what happens when I do the reverse operation, that is reading in an XSD that contains a documentation element, and the results are shown in the attached screenshot. It seems to me that I would need to write a Java extension that creates and populates an XMLFeatureMap and adds it to a documentation element something like this:

create xmlschema::DocumentationType this newDocumentation( String text ):
   this.setMixed( newXMLFeatureMap(text) );

newXMLFeatureMap( String text ):
   JAVA some.package.Helper.createXMLFeatureMap( java.lang.String )


I have spent some time looking through the source code of org.eclipse.xtend.typesystem.xsd without managing to work out how to set about writing a Java extension to do this, but it looks like it should be possible. I seem to be missing factory methods for creating instances of org.eclipse.xtend.typesystem.xsd.type.XMLFeatureMapTypeImpl. Can anyone point me to some more information about how to set about this, or perhaps suggest an alternative approach?

Thanks,
Peter.

[Updated on: Tue, 09 August 2011 16:35]

Report message to a moderator

Re: [Xtend] How to create and populate an XMLFeatureMap [message #714120 is a reply to message #714037] Tue, 09 August 2011 20:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

maybe this helps
http://www.openarchitectureware.org/forum/viewtopic.php?forum=2&showtopic=8589&highlight=XMLFeatureMap

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xtend] How to create and populate an XMLFeatureMap [message #714310 is a reply to message #714120] Wed, 10 August 2011 09:42 Go to previous message
Peter Keller is currently offline Peter KellerFriend
Messages: 14
Registered: October 2009
Junior Member
Ah, I missed that one. Embarrassed The Itemis guys and the old OAW forums to the rescue (again)!

For the record, this kind of construction works fine:

create xmlschema::DocumentationType this newDocumentation( String text ):
   this.mixed.text.add(text);


Many thanks,
Peter.
Previous Topic:[Acceleo] Direct access to the elements in a Collection or Sequence
Next Topic:Probleme with Acceleo
Goto Forum:
  


Current Time: Wed Apr 24 22:47:13 GMT 2024

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

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

Back to the top