Node Templates

Steve Ball

$Id: node.html,v 1.9 2004/10/10 06:18:57 balls Exp $


Introduction

This stylesheet module provides functions for reporting on or manipulating nodes and nodesets.

Table of Contents

node:xpath - Returns an XPath location path
node:type - Return node type
node:copy - Copy Nodes

Name

node:xpath — Returns an XPath location path

Synopsis

<xsl:template name="node:xpath"><xsl:param name="node" select="."/>  ...</xsl:template>

This template returns an XPath location path that uniquely identifies the given node within the document.

Parameters
node

The node to create an XPath for. If this parameter is given as a nodeset, then the first node in the nodeset is used.

Returns

Returns an XPath location path as a string.



Name

node:type — Return node type

Synopsis

<xsl:template name="node:type"><xsl:param name="node" select="."/>  ...</xsl:template>

Returns the type of a node as a string.

Parameters
node

The node to get the type for. If this parameter is given as a nodeset, then the first node in the nodeset is used.

Returns

Returns node type as a string. Values returned are:

Element

element

Text Node

text

Comment

comment

Processing Instruction

processing instruction



Name

node:copy — Copy Nodes

Synopsis

<xsl:template name="node:copy"><xsl:param name="nodes" select="."/>  ...</xsl:template>

Makes a copy of the given nodes, including attributes and descendants.

Parameters
nodes

The nodes to copy.

Returns

Returns the copied nodes as a result tree fragment.