Back to Thomas's Bridge Fantasia

XML and Bridge Publishing

XML as replacement for PBN

PBN is the current standard for records of bridge hands. I have some problems with PBN, and think that an XML language can likely be substituted with ease. The big problem with PBN is that it is not very extensible and requires a very specific parser. But I have a number of other gripes which make PBN also flawed from an engineering perspective.

XSLT formatting to HTML and XHTML

All of the bridge hand articles on my site are now written in XML, and pre-generated as HTML via XSLT. You can see some Test Documents which show what the input and output look like.

The following examples will generate on the fly if you have a browser which implements XSLT - in this case, I've chosen to generate XHTML because Mozilla seems to have a few problems still.

If you have Internet Explorer 6.0 or later, or any Mozilla-based browser after Mozilla 1.0, you can view these examples.

Internet Explorer uses the associated XSL files to format the file on your end. To view the un-formatted XML, view the formatted document, then select "View/Source."

Netscape and Mozilla will eventually catch up with IE, and IE will eventually let you have several XSLT files to choose from. [ Netscape 6.0 seems to have limited ability with XSLT, but it tranforms my documents wrong. I.E. agrees with the Xalan Java XSLT, for example. ]

Server-Side Versions of the Examples

If you have an older browser, you can view the output from these examples with these links:

XML and JavaScript

If you have IE 6.0 or Mozilla 1.0 with JavaScript enabled, you can run my sample Deal Browser, which loads the set of deals in deals.xml and lets you scroll through them one at a time.

As an argument for using XML rather than PBN, I think this is a fairly convincing example - with PBN, a browser would have to use Java applet or a plug-in to load and parse the PBN file.

JavaScript can also be used to generate "smart" article sets. For example, see this non-framed version of my "Double Asymmetries" articles. In fact, this "book" is loaded all at once, but only one article at a time is viewed. It uses cookies to remember the last article you viewed, so that when you return later, it returns you to the last article you viewed (unless the articles have been modified.) You can imagine a similar approach for so-called "bridge movies."

Compare this with the framed version.

XSL:FO and PDF

XSL:FO is the "formatting objects" part of the XSL standard. It basically lets you describe documents meant to be printed. Once an XML document is converted to XSL:FO with XSLT, an XSL:FO documented can be converted to PDF or postscript or any other printable format. I've tried two FO implementations:

The PDF version of the Everybody Makes article shows some distinctly subtle formatting - played cards are not "removed" from the diagram, they are just indicated with a line through, smaller, and in a light font.

Download BridgeML (version 0.5)

BridgeML now has its own Google Code Project.

Read the latest README file.

Download BridgeML-0.5.zip

The latest version of BridgeML uses xsltproc, so you will need that program installed on your computer, if it is not there already. You need a recent version of the program, because some older versions had broken handling of EXSLT extensions.

Non-XML Bridge Publishing Notes

Here are some links to bridge web publishing notes which are independent of XML.

Thomas Andrews (xml@thomasoandrews.com.)
Copyright 2000-2005.