SSML Breakdown

I never intended for my blog to become an XSL resource but it’s sure headed that way at the moment. Simple Stylesheet Markup Language (SSML, a.k.a. “double S”-ML) is still in its early stages but it looks promising. I now have the requirement to add conditional processing and other goodies. I want to keep the language simple, hence the Simple in SSML. However the requirements are pulling at it’s simplicity. I now present you with an overview of the language and what I hope to accomplish with it. The following specs are very alpha and subject to change, morph, fizzle, and possibly ingest themselves.

SSML Tag description

<document/>: The root element which should describe the layout of, you guessed it, the document. A document must contain one or more page elements.

<page/>: Holds all of the information contained on a page or series of pages. A page can be ordered via an optional sequence attribute which may contain the values “first”, “last”, or any number. (That is any number except for infinity and PI because they happen to be my lucky lotto numbers and I don’t want them getting out to everyone.) A page holds one or more section elements that have the goodies you want to end up on the final generated document.

<section/>: Where all of the interesting stuff goes. Sections can hold text elements which will spell out anything from order header and line item info to lewd comments made on Sections may be positioned anywhere on a page via location attributes. Locations can be specified in relative terms or in absolute terms. Accepted relative locations values are “header”, “footer”, “left-side”, and “right-side”. (In the future support will be added for locations “First National Vault” and “Halle Berry’s Dressing room”.) Absolute locations are specified using locationx and locatioy attributes where origin coordinates 0,0 begin in the upper left corner of the document. Absolute locations can be specified in any unit of measure supported by FO syntax.

<text/>: Text to print on the page. Text element may contain literal values or they may contain src attributes that use XPath to reference data from the bound XML. (Remember the bound XML is considered the XML that the generated template is supposed to process)

<engage-missiles/>: The secret element that arms my prototype nuclear war head and targets known high profile areas. The element is immediately available only after hitting the red button marked, “Do Not Press!”

…And that just about sums it up for my magnificent grammar. Let me know if I’ve left anything out. It looks pretty thorough and comprehensive. The big idea is to have a simple layer of abstraction over XSLT generated FO syntax. In other words we need an easy interface to use to generate FO from arbitrary XML. (I say arbitrary XML even as we have a target XML grammar because the target isn’t in stone yet and I want my language to be extensible.) We only need to paint text on the document so far and we want the templates to be user controlled. SSML give me an easy syntax to work with as I can (and will) easily develop a UI for generating it. The net result will actually be a UI that generates XSLT stylesheets or an XSLT editor, but the functionality will be limited. It’s not a bad job for someone who is learning XSL FO as he goes along. (I’m really making things up as I develop and praying that it’ll all work in production.) That’s all I got to say so in the words of a true thug, “Throw yo’ hood up, lay yo’ comments down!”

(If you are just visiting the site for the first time then be advised that this is the section the generally more or less explains the gibberish that usually concludes topics. In this case the author does not expect you to raise the hood of your vehicle, or perform any overdue maintanance. Instead, “throw yo’ hood up” is an indirect means of requesting information about your native town or origin while “lay yo’ comments down” should encourage you to key text into the comment box reflecting your inner thoughts, ideas, and/or suggestions.)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s