2. Entities and XIncludes

Entities: at the top of the file

<!DOCTYPE TEI.2 [
<!ENTITY ThisYear "2009">
]>
and then
<p>We'll party like it's &ThisYear;</p>

We'll party like it's 2009

XInclude: In a separate file called ‘disclaimer.xml’, we write

<p>Usual disclaimers apply.</p>
and then say
<include
	xmlns="http://www.w3.org/2001/XInclude"
	href="disclaimer.xml"/>
noting that the included file must be well-formed XML (ie have a single root element).

Usual disclaimers apply

Partial XInclude:

<include xmlns="http://www.w3.org/2001/XInclude" href="strings.xml#xpointer(//seg[@n='thisYear'])"/>
2009

Using PI:

<?string thisYear?>

Up: Contents Previous: 1. RSS Next: 3. Tables