| ZVON > Graphotron > Graphotron Reference |
| Intro / Search / ZVON |
| | >> graphotron << | daVinci | vcg | dot | tutorial | download | about | |
| Namespace | http://zvon.org/graphotron |
|---|---|
| Element | key |
| Description | The element is used to declare keys and its usage is equivalent to xsl:key from XSLT Recommendation. It can be used via key() function in all attributes accepting XPath and also in templates inside script if its type is set to "xslt". |
| Attributes | match [ required ] an XPath selecting nodes to be covered by the key name [ required ] the name of the key use [ required ] the value to be used for comparison |
| Parents | graphotron |
| Related: |
XSLT Reference - xsl:key
XLab - key |
|
XML Source
<source> <prefix id="1">A</prefix> <prefix id="0">B</prefix> <A/> <AA/> <AAA/> <AAAA/> <AAAAA/> <AAAAAA/> </source> |
Graphotron Source
<graphotron version="1.0" xmlns="http://zvon.org/graphotron" > <key name="pref" match="prefix" use="@id"/> <vertex match="/*/*"> <name select="key('pref',string-length(name()) mod 2)"/> </vertex> <edge match="//*[string-length(name()) mod 2 = 0]" select="//*[string-length(name()) mod 2 = 0]"/> <edge match="//*[string-length(name()) mod 2 = 1]" select="//*[string-length(name()) mod 2 = 1]"/> </graphotron> |
Display