Header and Footer Fragments

Another common use case for fragments is for common headers/footers. For more information on headers/footers please refer to the Structure Guide. For example, the following code creates a footer, and includes it in this document:

document.xml

<?xml version="1.0" encoding="utf-8" ?>
<document xmlns="http://resources.qdexapps.com/schema/v1/QDocument.xsd" name="myDocument">

<!-- Meta Data -->
<metadata>
  <title>Fragments</title>
  <creator>Peter Martin</creator>
  <abstract>An example document that illustrates how to include fragments in a document.</abstract>
</metadata>

<footer>
  <include src="fragment2.xml"/>
</footer>

fragment2.xml

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns="http://resources.qdexapps.com/schema/v1/QDocument.xsd">
    <p>
      <style>
        <foreground color="red"/>
        <horizontalAlignment>center</horizontalAlignment>
        <textAlignment>center</textAlignment>
      </style>
        This is my footer. It lives in a fragment
    </p>
</fragment>

Which looks like the following when the document is rendered

 
header-footer-fragment.jpg