Skip to content
Tim L edited this page May 10, 2015 · 45 revisions

What is first

  • vsr2.xsl discusses the first half of the vsr2grph visual strategy API.

What we will cover

This page describes the second half of the vsr2grph visual strategy API, which addresses creating different target concrete graphical formats. The decoupled nature of the vsr2grph API allows visual strategies to be written independent of the target graphical format, and vice versa.

Let's get to it!

The following illustration shows the minimal coupling between a visual strategy and an implementation for a target concrete graphical format.

2y.xsl flowing to 2x.xsl and back

We have implementations for four target concrete graphical formats. They are shown below sorted from most mature to least.

Set some namespaces:

<xsl:transform version="2.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xd="http://www.pnp-software.com/XSLTdoc"
   xmlns="http://graphml.graphdrawing.org/xmlns/graphml"
   xmlns:graphml="http://graphml.graphdrawing.org/xmlns/graphml"
   xmlns:y="http://www.yworks.com/xml/graphml"
   xmlns:xfm="transform namespace"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" indent="yes"/>

The view-id function determines graphical-side identities of content-side identities.

<xsl:function name="vsr:view-id">
   <xsl:param name="id"/>

2graffle

2graffle.xsl implements the OmniGraffle concrete target graphical format.

See also 2graffle.xsl

2svg

2svg.xsl

Places svg:metadata onto each svg:g that it creates (here).

What is next