XSLT

MYOML #9: Validation and Conclusion

The custom markup language has been designed to have a certain structure. That is, there is supposed to be one <article> tag, followed by a <section> container, followed by a <text> container. The CSS stylesheet has been designed with this in mind. However, nothing actually enforces this structure. There is nothing stopping you from writing an article with arbitrary tag structure (or even using undefined tags). There are two problems with this:

  1. Both the XSLT and CSS stylesheets were designed with a certain nesting order in mind, and allowing a different structure risks having a document that doesn't look quite right when displayed.
  2. Not having a consistent structure makes it hard or even impossible to write an XML query tool for indexing articles, etc., since there is no fixed structure to parse.

MYOML #8: Smoothing things out with PHP

The markup language is complete, but there are a few nice touches left to add. One is to make the articles compatible with non-XSLT capable browsers. Another is to add some preprocessing of <code> sections so that you (shouldn't have to) touch them up manually.

Issue #8: Smoothing things out with PHP

MYOML #7: Adding the final few tags

Agh, RealLife(tm) intruded on my writing progress for a while there, but I should be back on track for a bit at least.

This installment of Make Your Own Markup Language finalizes (for now at least) the design and adds the final tags. All that's left after this is to do a little polishing.

MYOML Issue #7: Adding the final few tags

MYOML #6: Metainfo, notes, warnings, and more HTML tags

As I get further into this series, the example template is diverging more and more from the "official" boodebr.org template, as I learn more and make improvements. This is making me antsy to go ahead and get finished with MYOML so I can start using the improved template on the whole site.

This time around I'm going to restructure the root template to add metainfo to the article. The metainfo is used to create the overall page layout, but can also be useful in if I ever want to create an article index. A script will be able to easily pull the metainfo from the article to create a database, etc.

I'm also going to add some 'note' and 'warning' boxes for highlighting important details, and add a few more HTML tags.

Issue #6: Metainfo, notes, warnings, and more HTML tags

MYOML #5: Attributes, titles, and other blocks.

So far so good, but the layout (although functional) is still pretty bland. Time to add a title= attribute to the <section> and <code> blocks, implement inline code samples, and see how to add some standard HTML tags to our markup language.

Issue #5: Attributes, titles, and other blocks.

MYOML #4: Creating the Outline

Finally, it's time to start writing some XSLT and putting an actual article together. In this installment of Make Your Own Markup Language the basic XML document structure is created. Once this is in place, we'll be able to freely tweak the individual sections to get the desired result.

Issue #4: Creating the Outline

MYOML #3: Building Blocks

There are two basic things needed when building an XML-based markup language: Containers to put your content in, and a way to visually format those containers. In MYOML #3, the HTML containers <div> and <span> are introduced, CSS classes are explained, and a little demo shows why separating content from presentation is important.

Issue #3: Building Blocks

MYOML #2: Setting Things Up

The second installment of "MYOML: Make Your Own Markup Language" has been posted.

This article sets up the basic "skeleton" files that the rest of the series will be built upon. It introduces some basic XSLT and CSS concepts. It also contains a test page to see if your browser can handle XSLT natively. If not, it shows you how to run an XSLT processor manually.

Issue #2: Setting Things Up

MYOML - Make Your Own Markup Language

I vaguely remember writing my first webpage, and thinking that HTML was the greatest invention ever. That enthusiam wore off by about the middle of the second page. I've never liked writing raw HTML because it forces you to spend a large amount of time on presentation, which takes time away from writing the content itself.

This series of articles will show you how to create your own "mini" markup language, using standards and tools like XML, XSLT, CSS and (optionally) a little PHP. If those four acronyms mean nothing to you, don't worry - everything you need to know will be covered here.

Series begins here: First Steps Towards Your Own Markup Language

Syndicate content