Commit 2557379c authored by Stephan Kreutzer's avatar Stephan Kreutzer

Attempt to fix violation of validity: no support for complex data attached to a node in GraphML.

parent f1d8f8e1
......@@ -20,7 +20,7 @@ along with SOS Map Prototype 2. If not, see <http://www.gnu.org/licenses/>.
<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">
<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">
<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"/>
<graph id="SOS" edgedefault="directed">
......@@ -32,9 +32,13 @@ along with SOS Map Prototype 2. If not, see <http://www.gnu.org/licenses/>.
<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>
<!--
GraphML doesn't support semantics for the data of a node, just this generic mechanism. Writing
our own schema as suggested in http://graphml.graphdrawing.org/primer/graphml-primer.html#EXT
isn't cool and the official standard lacks support for a complex type with lax validation.
-->
<data key="sos-poi-title"><xsl:value-of select="./sos:Title//text()"/></data>
<data key="sos-poi-text"><xsl:value-of select="./sos:Text//text()"/></data>
</node>
</xsl:template>
......
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