Implementing XSEM Today
Having a text model is not enough. There need to be practical ways to implement it. This demonstration will show you how XSEM can be implemented using existing technologies.
Eric Albright has developed several stylesheets that render XSEM marked up text into several different output formats. One exciting aspect of this is that there is only one source text. This is the great advantage to using a markup standard such as XML. We hope this page helps the readers get familiar as to how this can be done.
There are several different demonstrations included in this package that will show the versatility of XSEM. This page will show the results of several transformations done on a specially prepared source text. For the complete demonstration package you can download it from the resource page.
One of the great advantages of using an XML based markup standard is that you can use XSLT (XML Stylesheet Language Transformations) to convert it to another form. XSL parsers are readily available but to implement them users need a knowledge of XML and XSL which is becoming more and more common. Please note that these demonstrations were developed in the Microsoft Windows environment. Though not intentional, there may be parts of this demonstration that view better in Microsoft Internet Explorer version 5.5. Please bear that in mind.
To start, we will transform the XML source text with the XSL file we have developed into this HTML text. To do this transformation we used Microsoft's XSL Parser package. The parser was invoked with a command line in MS-DOS like this:
Next, we will extract a simple portion of the book of Mark with the
same stylesheet. By adding
Sometimes verses can cross structural boundaries like sections or paragraphs. In this example we have extracted Mark 6:6 which crosses a section boundary. With XSL we can control the range according to the context it is found in. Another example would be a quote that spans verses. In this case, Mark 4:30, the quote spans three verses so the stylesheet pulls out all three verses to preserve the context.
All the above examples were produced using the same stylesheet. This shows the versatility and power of XSL and also how easy it is to transform Scripture text marked up in XSEM to HTML.
PDF (Portable Document Format) was created by Adobe and has become an industry standard. PDF allows us to capture the content and almost the exact format of a document as it was produced by a given application. Where HTML is concerned with delivering content, PDF is concerned with delivering format. When PDF becomes the output from XML the results can be interesting.
This is a two-step procedure. First the XSEM source, via XSLT, is transformed into an intermediate form called Formatting Objects or FO. Like PDF, FO is concerned with the format of a document. A FO file contains information like page size, margin widths, text direction and other formatting information that would not normally be in a more content intensive environment like HTML.
In the second step we convert the FO file into the final formatted output that is ready for printing or electronic display. In this example we produced a PDF version of our source text. (You will need Adobe Acrobat Reader installed on your computer to view this document.) However a similar process could produce another format like RTF (Rich Text Format) a commonly used format from Microsoft.
Another technology that has emerged in recent years is the EBook format. Companies like Adobe and Microsoft are competing to see who's version of that technology will win the market. For our demonstration we choose Microsoft's technology called Reader.
Like PDF, to convert text marked up in XML, we need to go through a two step process. First we need to create a slightly different version of HTML that is more compliant with what Microsoft's Reader conversion tool is expecting. One of the main differences is that the footnotes that are embedded in the XML source text need to be in a separate file. To do this we make two passes with our stylesheet, once to extract and format the main body of text, and again to create the footnotes file.
After the HTML files have been produced (along with their supporting files) a final conversion can be run which transforms it into a single binary file that is compatible with Microsoft Reader. This file can then be opened in the Reader application and read. For those reading this who may not have Microsoft Reader installed on their computers here is a screen shot of the first page.
Another interesting form of output that Eric has included in this demonstration is text transformed into WML. This is an XML markup language that is specially designed around the needs of small display devices like cell phones.
This type of device has a set of requirements that are somewhat unique from those of a web browser. This is mainly because of screen size and the way this kind of technology is used. For example, a cell phone user would not want to read the entire Bible from their cell phone, rather, they would just want to reference a single verse or a range of verses. The stylesheet developed for this application is designed to extract XSEM source text and transform it into WML, another XML markup language.
This section of the demonstration includes several different examples of WML output, this is one of them. WML serves the same function for cell phones as HTML does for the web browser. On a cell phone, the above example would be rendered to look like this.
We hope that the examples contained here will encourage you to try out the demonstration package. You are also encouraged to modify the stylesheets and try different variations. Please share your work with us if you are so inclined to do so.
* Please note that because of copyright protection, we have developed a special XSEM source text for these demonstrations.
* It should also be noted that the particular PDF formater we used is a demonstration version. After page 9 you will note that every other page is blank.
* One would question the usefulness of having the Bible on a cell phone but then some questioned the need for personal computers as well.
* This example was rendered on a cell phone emulation program. Information on how to obtain this program is included in the demonstration package.
Contact: Dennis Drescher
Copyright © 2001SIL International