Example: Manage XSD-backed XML files with EOL

var note = NoteType.all.first();

("From: " + note.from).println();
("To: " + note.to).println();
("Heading: " + note.heading).println();
("Body: " + note.body).println();
("Text: " + note.mixed.last().value.trim()).println();
<?xml version="1.0" encoding="UTF-8"?>
<note xmlns="xsdxml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <to>John</to>
  <from>Nick</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
  Some text
</note>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema xmlns="xsdxml" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="xsdxml">

<xs:element name="note">
  <xs:complexType mixed="true">
    <xs:sequence>
      <xs:element name="to" type="xs:string"/>
      <xs:element name="from" type="xs:string"/>
      <xs:element name="heading" type="xs:string"/>
      <xs:element name="body" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

</xs:schema>

Check out the code from the SVN:

  • go to the SVN repository
  • navigate to trunk/examples
  • check out the org.eclipse.epsilon.examples.xsdxml project

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.xsdxml project
  2. right click the .launch file in the org.eclipse.epsilon.examples.xsdxml project
  3. select Run as... and click the first item in the menu that pops up

What's this?

In this example we demonstrate using EOL to query an XSD-backed XML file.

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
Combining the Epsilon Languages
EuGENia
EUnit

Even more examples...

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