Xsl Generate-id Key Example

-->

The list of tutorials related to oXygen XML Editor. XSLT function: string generate-id (node-set?) Standard excerpt: The generate-id function returns a string that uniquely identifies the node in the argument node-set that is first in document order. The unique identifier must consist of ASCII alphanumeric characters and must start with an alphabetic character. Q&A for Work. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information.

Returns a string that uniquely identifies the node in the node-set argument that is first in document order.

Remarks

The generate-id function returns a string that uniquely identifies the node in the argument node-set that is first in document order. The unique identifier must consist of ASCII alphanumeric characters and must start with an alphabetic character. Thus, the string is syntactically an XML name. Examples (xslt. See Group XML elements by key using XSLT. Method Overview. XSLT v1.0 does not include any explicit support for grouping, however it is possible to achieve the same effect through creative use of the key and generate-id functions. This is called the Muenchian Method after its inventor Steve Muench.

The unique identifier must consist of ASCII alphanumeric characters and must start with an alphabetic character. Thus, the string is syntactically an XML name. There is no guarantee that a generated unique identifier will be distinct from any unique IDs specified in the source document. If the node-set argument is empty, the empty string is returned. If the argument is omitted, it defaults to the context node.

Example

XML File (data.xml)

XSLT File (sample.xsl)

This is the formatted output:

When you click the left button in Internet Explorer, an alert box displays 'IDAHAGJD'.

When you click the right button in Internet Explorer, an alert box displays 'IDAPAGJD'.

Notice that the ID value is generate at run-time. Therefore, the specific values may vary in different invocation of the transformation.

This is the processor output:

<html>

<body><button>Gambardella, Matthew</button>

Microsoft office 2010 mac product key generator. <button>Ralls, Kim</button></body>

</html>

Xslt Template Examples

See Also

Xsl Stylesheet Example

Reference