Processing instructions

An XML processing instruction can be created using the Processing Instruction element. It has a Name attribute to hold the name of the target application (which becomes the first word in the processing instruction). The content of the element becomes the actual instruction. On output, the start-tag becomes '<?' and the end-tag becomes '?>':

   <page-break/>
<template match="page-break">
  <processing-instruction name="ACME">
    {new page}
  </processing-instruction>
</template>


   <?ACME {new page}?>
				

As a processing instruction ends with the characters '?>', it is illegal for the text in the instruction to contain this sequence of characters. An error may be reported if they occur.

Copying-through processing instructions

Processing ...

Get XSL companion, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.