Copying source structures

When transforming XML documents into different XML documents, there may be times when some markup needs to be copied to the output without modification. Two instructions are available for specifying copy-through of XML constructs.

Copying document fragments

A document to be transformed may contain fragments that are to remain unchanged. The Copy Of element can be used to copy such structures directly to output. The Select attribute contains an expression to locate the fragment to copy-through. To copy the current element (and all its descendants), the expression needs to refer to the current element ('.'). For example, the source document may contain tabular structures that are already coded according to the HTML table ...

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.