Commit 69a48c01 authored by Stephan Kreutzer's avatar Stephan Kreutzer

'sos-map-2' prototype added.

parent f656d87b
Stephan Kreutzer, Bahnhofstraße 71, 74321 Bietigheim-Bissingen, GERMANY (http://hypertext-systems.org, http://publishing-systems.org, https://skreutzer.de, <skreutzer@fsfe.org>).
This diff is collapsed.
The $/sos-map-2/sos-map-2.xml is generated via a XSLT transformation using the
$/sos_xml_to_graphml_1.xsl XSLT stylesheet on a SOS XML file.
The already existing file is based on $/../../examples/development_process_2.xml.
#!/bin/sh
java -cp ./xml_xslt_transformator_1 xml_xslt_transformator_1 jobfile_xml_xslt_transformator_1.xml resultinfo_xml_xslt_transformator_1.xml
<?xml version="1.0" encoding="UTF-8"?>
<xml-xslt-transformator-1-jobfile>
<job input-file="../../examples/development_process_2.xml" entities-resolver-config-file="./xml_xslt_transformator_1/entities/config_empty.xml" stylesheet-file="./sos_xml_to_graphml_1.xsl" output-file="./sos-map-2/sos-map-2.xml"/>
</xml-xslt-transformator-1-jobfile>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2019 Stephan Kreutzer
This file is part of SOS Map Prototype 2.
SOS Map Prototype 2 is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3 or any later version,
as published by the Free Software Foundation.
SOS Map Prototype 2 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License 3 for more details.
You should have received a copy of the GNU Affero General Public License 3
along with SOS Map Prototype 2. If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:sos="http://www.untiednations.com/SOS">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="/">
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd" xmlns:sos="http://www.untiednations.com/SOS">
<graph id="SOS" edgedefault="directed">
<key id="sos-poi-title" for="node" attr.name="label" attr.type="string"/>
<key id="sos-poi-text" for="node" attr.name="description" attr.type="string"/>
<xsl:apply-templates select="/sos:SOS/sos:POI"/>
<xsl:apply-templates select="/sos:SOS/sos:POI/sos:Parent"/>
</graph>
</graphml>
</xsl:template>
<xsl:template match="/sos:SOS/sos:POI">
<node id="{@ID}">
<!-- GraphML doesn't support semantics for the data of a node, so we keep SOS semantics. -->
<data key="sos-poi-title"><sos:Title><xsl:value-of select="./sos:Title//text()"/></sos:Title></data>
<data key="sos-poi-text"><sos:Text><xsl:value-of select="./sos:Text//text()"/></sos:Text></data>
</node>
</xsl:template>
<xsl:template match="/sos:SOS/sos:POI/sos:Parent">
<edge id="edge-{position()}" source="{@Parent-ID}" target="{../@ID}"/>
</xsl:template>
<xsl:template match="text()"/>
</xsl:stylesheet>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment