Example: Cloning and copying XML elements across documents with EOL

// The contacts list in contacts.xml
var contacts = Contacts!t_contacts.all.first();

// The vcard element in templates.xml
var vcard = Templates!t_vcard.all.first();

// Copy the vcard into the contacts document
var clone = Contacts.document.importNode(vcard, true);

// Put it under the contacts list
<?xml version="1.0"?>
    <address number="" postcode=""/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <address number="" postcode=""/>

Clone Epsilon's Git repository and then:

Once you have checked out/imported the code, to run the example you need to go through the following steps:

  1. register any .ecore metamodels in the org.eclipse.epsilon.examples.plainxml.copyfromtemplate project
  2. right click the .launch file in the org.eclipse.epsilon.examples.plainxml.copyfromtemplate project
  3. select Run as... and click the first item in the menu that pops up

What's this?

In this example, we use the plain XML driver of Epsilon to clone and copy XML elements across different documents with EOL.

What are .emf files?

.emf files are Ecore metamodels expressed using the Emfatic textual syntax.

More examples...

Epsilon Object Language
Epsilon Transformation Language
Epsilon Generation Language
Epsilon Validation Language
Epsilon Merging Language
Epsilon Flock
Epsilon Model Generation Language
Epsilon Pattern Language
Combining the Epsilon Languages

Even more examples...

More examples are available in the examples folder of the Git repository.