-
Notifications
You must be signed in to change notification settings - Fork 3
2grph.xsl
- vsr2.xsl discusses the first half of the vsr2grph visual strategy API.
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.
The following illustration shows the minimal coupling between a visual strategy and an implementation for a target concrete graphical format.
We have implementations for four target concrete graphical formats. They are shown below sorted from most mature to least.
- 2graffle
- 2svg.xsl
- 2graphml.xsl
- 2graphviz.xsl
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.xsl implements the OmniGraffle concrete target graphical format.
- It captures control of the initial XSL transformation here (with
<xsl:template match="/">
). - It includes a pointer to its GRDDL transformation by inserting a "hidden" graphical element here; a graphic is used to survive "pass-through" editing. A pointer cannot be placed in the top-level document because they do not survive pass through editing with the native application (though, we do it anyway).
- It defers to the custom visual strategy processing at this point. The visual strategy implementation is responsible for walking the input format, determining the visual mapping, and calling the vsr2grph API node and edge creation templates. Any of the seven default visual strategies in src/xsl/from can be used, or a custom visual strategy can be added to suit new visual mappings or new input vocabularies. 2graffle.xsl includes 2graffle5.xsl with this import statement to provide the OmniGraffle implementation for the three vsr2grph API functions:
See also 2graffle.xsl
Places svg:metadata onto each svg:g that it creates (here).
- The output of the vsr2grph process enables Recovering Data from View.