Customized output for different media made easy with XML

Now that many publications are online, does it still make sense to have them identical? For many publishers, the cost of printing has meant that some content is not as rich as it could be.  However, when a publication is reproduced online, the enriched content can be easily added back since the online document doesn’t have the same space limitations.

Let me give you an example of what I’m talking about and how it can be a simple matter to achieve, when the source is in XML.

Here is some sample XML:

<TABLEOFCASES>
<ENTRY>
<CASE><SOC>Wolf v. Wolf</SOC>, <CITATIONS>41 R.F.L. (3d) 391, 1992 RoweBC 562 (S.C.)</CITATIONS></CASE>
<PAGES>301, 336</PAGES>

</ENTRY>
<ENTRY>
<CASE><SOC>Wong v. Yee</SOC>, <CITATIONS>2004 RoweBC 153, 2004 BCSC 113 (Master)</CITATIONS></CASE>
<PAGES>228, 234, 317</PAGES>
</ENTRY>
<ENTRY>
<CASE><SOC>Wood v. Legge</SOC>, <CITATIONS>2004 RoweNS 380, 2004 NSFC 12, 11 R.F.L. (6th) 171, 227 N.S.R. (2d) 74, 720 A.P.R. 74 (Fam. Ct.)</CITATIONS></CASE>
<PAGES>20, 269</PAGES>

</ENTRY>
</TABLEOFCASES>

In print you may not want the potentially extensive citation information and only want the case name (aka Style of Cause), so the printed output may look like this:

Wolf v. Wolf……………………………………………………………………….. 301, 336

Wong v. Yee………………………………………………………………… 228, 234, 317

Wood v. Legge……………………………………………………………………… 20, 269

However, online you want to provide additional information for your readers

Wolf v. Wolf, 41 R.F.L. (3d) 391, 1992 RoweBC 562 (S.C.)…………………….. 301, 336

Wong v. Yee, 2004 RoweBC 153, 2004 BCSC 113 (Master)……………. 228, 234, 317

Wood v. Legge, 2004 RoweNS 380, 2004 NSFC 12, 11 R.F.L.
(6th) 171, 227 N.S.R. (2d) 74, 720 A.P.R. 74 (Fam. Ct.)…………….20, 269

So what is involved in generating the different outputs? Nothing more than a 1 line change to the XSLT that generates the output.

This block:

<xsl:for-each select=”CASE/SOC“>
<fo:inline>
<xsl:apply-templates/>
</fo:inline>
</xsl:for-each>

becomes:

<xsl:for-each select=”CASE“>
<fo:inline>
<xsl:apply-templates/>
</fo:inline>
</xsl:for-each>

This simple change will add all the citation information back in and make for a happier online user.

Simple things like adding more content to your online documents can help speed the transition to a fully online subscriber-base and bring the day of eliminating expensive printing and distribution costs one step closer.

BTW, with just a few more tiny changes, this program could use parameters to determine the correct output, but that is for another post.

Take care,
Keith Matthew
“Think simple, achieve more”

Comments are closed.