Generating Temporary IDs for Nodes

The generate-id() function, defined in the XSLT recommendation, generates temporary IDs for nodes.

Caution

 

The ID generated by the generate-id() function is not an object ID. The value generated by the generate-id() function is guaranteed to be the same only during an XSL transformation. If the source document changes, the value for this ID can change.

Format

The format for the generate-id() function is as follows:

string generate-id(node-set?)
               

            

The generate-id() function returns a string that uniquely identifies the node in node-set that is first in document order. This string starts with xln and ends with eight hexadecimal digits. Syntactically, the string is an XML name.

If the node-set argument is empty, the generate-id() function returns an empty string. If you omit the node-set argument, the generate-id() function generates a temporary ID for the context node.

XML Whitepapers

Learn how XML can help you meet your business objectives by reading free XML Whitepapers covering XML, XML Schema, XQuery, SQL/XML, and FIXML technolgies employed in real world case studies.

Using Stylus Studio's Database-to-XML Editor to Query and Update Relational Databases using SQL/XML

Watch and learn how easy it is to define relational-to-XML mappings for getting XML out of relational databases and updating databases from XML using industry-standard SQL/XML extensions and Stylus Studio's DB-to-XML data-source editor.

Create XML Schema from XML Content

Create XML Schema from XML Content by auto-generating an XML Schema with Stylus Studio.

XQuery Functions - User Defined Functions in XQuery

Dr. Michael Kay's tutorial entitled: 'Defining your own Functions in XQuery' explains how to write powerful User Defined Functions in XQuery.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member