copy-of

The copy-of makes a deep copy including all descendant nodes specified by the associated XPath expression.

Syntax
<copy-of> ::= "copy-of" <quote> <xpath expression> <quote>
Options

None.

Elements

None.

Examples

For example.

stylesheet { version "1.0" match using "scripts" scope "buildPagesList.properties" { copy-of "." } }

compiles to

<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="scripts" mode="buildPagesList.properties"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet>

which copies all the descendant nodes and attributes of the node <pcms:scripts>

Errors

The common error is forgetting a quote round the expression

stylesheet { version "1.0" // Pass through (written so that can be expanded later more easily). match using "scripts" scope "buildPagesList.properties" { copy-of ". } }

which will give

**** (105) Unexpected symbol ". } } " found in "copy-of" in line 8 Check spelling, missing expression, bracket or quote? **** (136) Unmatched brackets in 1 Too many open brackets?
Copyright 2024 Hugh Field-Richards. All Rights Reserved.