XML Import for TEI XML Data into Flex 4

February 7, 2009

Intro

At NKU, our group has had two goals: (1) to go global, and (2) to build a 3D learning management system (LMS) in Flex. Two different data base systems are being developed for the LMS – a flat file and MYSQL. In both cases, complex XML structures are required. Not just the simple examples typically found on the web or Flex training tutorial sites. Sas Jacobs in his book on XML and E4X treats working with XML, Flash, and Flex in great detail.

In an upcoming seminar, we demonstrate such a complex data structure, the TEI database:

The Text Encoding Initiative (TEI) is a consortium which collectively develops and maintains a standard for the representation of texts in digital form. Its chief deliverable is a set of Guidelines which specify encoding methods for machine-readable texts, chiefly in the humanities, social sciences and linguistics.

The upcoming seminar is free to the public and its description is given below:

Creating a Data-Driven Website (March 24):
Using Roxanne Kent-Drury’s 3D English course website as an example, learn how to create a searchable Flex interface using PHP to interact with the interface and a MYSQL (open source) database. You’ll also learn about CRUD– how to store and change information in your database.

The code required to import this complex XML flat-file into Flex is shown below:

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”
layout=”absolute” creationComplete=”xmlService.send()”>
<mx:HTTPService id=”xmlService” url=”assets/yearsley1788P5.xml”
resultFormat=”e4x”/>
<mx:VBox x=”10″ y=”10″ height=”335″ width=”393″>

<mx:Label text=”Output” fontWeight=”bold”/>
<mx:TextArea id=”output_txt” width=”369″ height=”295″
text=”{xmlService.lastResult}”/>
</mx:VBox>
</mx:Application>

Source

To see a sample of the TEI XML file click the more button below:

Read the rest of this entry »