XSLT to process CBML


and output a special Reading View in HTML

preparing targets for internal links

(or your own project code, if not CBML)

It's always a namespace issue!

Check your XSLT root element! 


  • Is it set up to process your source file?

  • Look at your source file: Does it have a namespace (@xmlns) on its root element?


Your XSLT needs an


to read the source file!

If you don't add one, nothing will process!


Your XSLT should NOT have an


at ALL!

REMOVE it if it's there

or nothing will process!

Check your XSLT root element some more! 


  • What other namespaces are involved in your project?

  • If CBML, you have TWO namespaces to process: TEI and CBML. So add the @xmlns for CBML as well.

  • You also need an @xmlns for the output to be good xhtml (HTML in XML syntax).

Creating a reading view in HTML

  • Think about block elements like <section> and <div>
  • Use @class to classify the elements that share the same purpose.            
<section class="page"> 
   <div class="panel">
     <!-- contents of the panel 
         to output here -->

Setting up a reading view for internal links

Planting @id attributes for link targets

Choose your HTML output elements carefully! 

Is your output valid HTML? 

It's easy to nest elements that aren't good HTML syntax!


In our example, <figure> and <div> must not nest inside <p>


By Elisa Beshero-Bondar


section dividers for use in Zoom recordings on coding processes

  • 181