3
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
5
xmlns="http://www.w3.org/1999/xhtml"
6
xmlns:gv="urn:graphviz"
9
<xsl:output method="html" />
11
<xsl:variable name="arguments" select="document('arguments.xml')" />
13
<xsl:template match="/">
16
<title>Node, Edge and Graph Attributes</title>
34
text-decoration: none;
39
text-decoration: underline;
48
bottom: 0px; /* IE doesn't use this */
49
height: expression(offsetParent.offsetHeight); /* only IE uses this */
59
right:0px; /* IE doesn't use this */
60
width: expression(offsetParent.offsetWidth-210); /* only IE uses this */
62
bottom: 0px; /* IE doesn't use this */
63
height: expression(offsetParent.offsetHeight); /* only IE uses this */
115
padding-bottom: 10px;
150
<xsl:text disable-output-escaping="yes">
151
var lastSelected = null;
153
function addClass (element, newClass)
157
var classes = element.className.split (" ");
158
for (var i = 0; i < classes.length; ++i)
159
if (classes [i] == newClass)
162
if (i == classes.length)
164
classes.push (newClass);
165
element.className = classes.join (" ");
170
function removeClass (element, oldClass)
174
var classes = element.className.split (" ");
175
for (var i = 0; i < classes.length; ++i)
176
if (classes [i] == oldClass)
178
classes.splice (i, 1);
179
element.className = classes.join (" ");
186
function select (selected)
188
if (selected != lastSelected)
190
// deselect the last selection
193
removeClass (document.getElementById ("index_" + lastSelected.replace (':', '_')), "index_selected");
194
removeClass (document.getElementById ("content_" + lastSelected.replace (':', '_')), "content_selected");
197
lastSelected = selected;
199
var selectedIndex = document.getElementById ("index_" + lastSelected.replace (':', '_'));
200
addClass (selectedIndex, "index_selected");
202
// ensure selected index is visible in indices source list
205
var indexTop = selectedIndex.offsetTop;
206
var indexBottom = indexTop + selectedIndex.offsetHeight;
207
var indicesTop = selectedIndex.offsetParent.scrollTop;
208
var indicesBottom = indicesTop + selectedIndex.offsetParent.offsetHeight;
209
if (indexBottom < indicesTop || indexTop > indicesBottom)
210
selectedIndex.scrollIntoView ();
213
// display the content associated with the selected index
214
addClass (document.getElementById ("content_" + lastSelected.replace (':', '_')), "content_selected");
222
// check if we navigated to a new internal location e.g. via the back button
223
// if so we need to update the selection
224
// NOTE: this means there are no real anchors in the HTML at all, we're just simulating them
225
var hash = window.location.hash;
226
if (hash && hash.charAt (0) == '#')
227
select (hash.substr (1));
229
select ("h:introduction");
233
function clicked (event)
235
// check to see if an internal link was clicked, if so we need to update the selection
236
// NOTE: this is not strictly necessary since hashed () will catch it but it helps with the responsiveness
237
var clickedElement = event.target;
239
clickedElement = event.srcElement;
240
switch (clickedElement.tagName)
244
var oldHref = window.location.href;
245
var oldHash = oldHref.indexOf ('#');
247
oldHash = oldHref.length;
249
var newHref = clickedElement.href;
250
var newHash = newHref.indexOf ('#');
252
newHash = newHref.length;
254
if (oldHref.substr (0, oldHash) == newHref.substr (0, newHash))
256
if (newHash < newHref.length)
257
select (newHref.substr (newHash + 1));
259
select ("h:introduction");
269
window.setInterval ("hashed ()", 1000);
276
<body onload="return loaded ()" onclick="return clicked (event)">
279
<!-- display all the attribute type names -->
280
<div class="heading">NOTES</div>
281
<xsl:for-each select="/xsd:schema/xsd:annotation[@id]">
282
<a id="index_h_{@id}" class="index note" href="#h:{@id}">
283
<xsl:value-of select="@id" />
287
<!-- display all the attribute names -->
288
<div class="heading">ATTRIBUTES</div>
289
<xsl:for-each select="/xsd:schema/xsd:attribute">
290
<a id="index_d_{@name}" class="index attr" href="#d:{@name}">
291
<xsl:value-of select="@name" />
295
<!-- display all the attribute type names -->
296
<div class="heading">TYPES</div>
297
<xsl:for-each select="/xsd:schema/xsd:simpleType">
298
<a id="index_k_{@name}" class="index type" href="#k:{@name}">
299
<xsl:value-of select="@name" />
308
<!-- note content -->
309
<xsl:for-each select="/xsd:schema/xsd:annotation[@id]">
310
<div id="content_h_{@id}" class="content">
312
<xsl:apply-templates select="xsd:documentation/*" mode="html" />
317
<!-- attribute content -->
318
<xsl:for-each select="/xsd:schema/xsd:attribute">
319
<div id="content_d_{@name}" class="content">
321
<!-- display the layouts this attribute applies to -->
322
<div class="heading">LAYOUTS</div>
324
<xsl:variable name="attributeLayouts" select="@gv:layouts" />
325
<xsl:for-each select="$arguments/xsd:schema/xsd:simpleType[@name='layout']/xsd:restriction/xsd:enumeration">
326
<span class="layout">
327
<xsl:attribute name="class">layout <xsl:if test="$attributeLayouts and not(contains(concat(' ',$attributeLayouts,' '),concat(' ',@value,' ')))">missing</xsl:if></xsl:attribute>
328
<xsl:value-of select="@value" />
330
<xsl:text> </xsl:text>
334
<!-- display the components this attribute is used by -->
335
<div class="heading">COMPONENTS</div>
337
<xsl:variable name="attributeName" select="@name" />
338
<xsl:for-each select="/xsd:schema/xsd:complexType">
340
<xsl:attribute name="class">comp <xsl:if test="not(xsd:attribute[@ref=$attributeName])">missing</xsl:if></xsl:attribute>
341
<xsl:value-of select="@name" />
343
<xsl:text> </xsl:text>
347
<!-- display the formats this attribute can output -->
348
<div class="heading">FORMATS</div>
351
<xsl:when test="@gv:formats">
352
<span class="format"><xsl:value-of select="@gv:formats" /></span>
355
<span class="format missing">all</span>
360
<!-- display the type of this attribute -->
361
<div class="heading">TYPE</div>
364
<xsl:when test="@type='xsd:anyURI'">
365
<span class="type">URL</span>
367
<xsl:when test="@type='xsd:boolean'">
368
<span class="type">bool</span>
370
<xsl:when test="@type='xsd:decimal'">
371
<span class="type">double</span>
373
<xsl:when test="@type='xsd:integer'">
374
<span class="type">int</span>
376
<xsl:when test="@type='xsd:string'">
377
<span class="type">string</span>
379
<xsl:when test="not(contains(@type,':'))">
380
<a class="type" href="#k:{@type}"><xsl:value-of select="@type" /></a>
385
<!-- display the attribute default or none if missing -->
386
<div class="heading">DEFAULT</div>
389
<xsl:when test="@default">
391
<xsl:value-of select="@default" />
395
<span class="val missing">none</span>
400
<!-- display the description from the documentation bits -->
401
<div class="heading">DESCRIPTION</div>
403
<xsl:apply-templates select="xsd:annotation/xsd:documentation/*" mode="html" />
409
<!-- attribute type content -->
410
<xsl:for-each select="/xsd:schema/xsd:simpleType">
411
<div id="content_k_{@name}" class="content">
413
<!-- display the values if this is an enumeration -->
414
<xsl:if test="xsd:restriction/xsd:enumeration">
415
<div class="heading">VALUES</div>
417
<xsl:for-each select="xsd:restriction/xsd:enumeration">
418
<span class="val"><xsl:value-of select="@value" /></span>
419
<xsl:text> </xsl:text>
424
<!-- display the description from the documentation bits -->
425
<div class="heading">DESCRIPTION</div>
427
<xsl:apply-templates select="xsd:annotation/xsd:documentation/*" mode="html" />
442
<xsl:template match="html:a[@rel='attr']" mode="html" xmlns:html="http://www.w3.org/1999/xhtml">
443
<a href="#d:{text()}" class="attr">
444
<xsl:apply-templates select="@*|node()" mode="html" />
448
<xsl:template match="html:a[@rel='type']" mode="html" xmlns:html="http://www.w3.org/1999/xhtml">
449
<a href="#k:{text()}" class="type">
450
<xsl:apply-templates select="@*|node()" mode="html" />
454
<xsl:template match="html:a[@rel='note']" mode="html" xmlns:html="http://www.w3.org/1999/xhtml">
455
<a href="#h:{text()}" class="note">
456
<xsl:apply-templates select="@*|node()" mode="html" />
460
<xsl:template match="@*|node()" mode="html">
462
<xsl:apply-templates select="@*|node()" mode="html" />
b'\\ No newline at end of file'