Template classes
================

chameleon.core.template.Template
--------------------------------

  >>> from chameleon.core.template import Template
  >>> from chameleon.core.testing import mock_parser
  
  >>> print Template("""\
  ... <div xmlns="http://www.w3.org/1999/xhtml">
  ...   Hello World!
  ... </div>""", mock_parser)()
  <div>
    Hello World!
  </div>

chameleon.core.template.TemplateFile
------------------------------------

  >>> from chameleon.core.template import TemplateFile
  >>> from chameleon.core import tests
  >>> path = tests.__path__[0]
  >>> t = TemplateFile(path+'/helloworld.pt', mock_parser)
  >>> print t()
  <div>
    Hello World!
  </div>

  >>> import os
  >>> t.filename.startswith(os.sep)
  True

XInclude support
----------------

  >>> template = TemplateFile(path+"/xinclude1.pt", mock_parser)
  >>> print template()
  <div>
    <div>
    <span>Hello, world!</span>
    </div>
  </div>

  >>> from cPickle import dumps, loads
  >>> for key, bct in template.registry.items():
  ...     template.registry[key] = loads(dumps(bct))

  >>> print template()
  <div>
    <div>
    <span>Hello, world!</span>
    </div>
  </div>
