<meta content="StarSuite 8 (Linux)" name="GENERATOR">
<meta content="*" name="AUTHOR">
<meta content="20071029;11490000" name="CREATED">
<meta content="Seaman Wang" name="CHANGEDBY">
<meta content="20080123;17212300" name="CHANGED">
<style type="text/css">
<!--
@page { size: 21cm 29.7cm; margin: 2cm }
P { margin-bottom: 0.21cm }
-->
</style>
<meta content="text/html; charset=utf-8" http-equiv="CONTENT-TYPE"> <meta content="StarSuite 8 (Linux)" name="GENERATOR"> <meta content="*" name="AUTHOR"> <meta content="20071029;11490000" name="CREATED"> <meta content="Seaman Wang" name="CHANGEDBY"> <meta content="20080123;17212300" name="CHANGED">xsd定义:<style type="text/css"><!-- @page { size: 21cm 29.7cm; margin: 2cm } PRE.western { font-family: "Cumberland", "Courier New", monospace } PRE.cjk { font-family: "方正宋体", monospace } PRE.ctl { font-family: "方正宋体", monospace } P { margin-bottom: 0.21cm } --></style> graphml+xlink.xsd
<?xmlversion="1.0"encoding="UTF-8"?>
<xs:schema
targetNamespace="http://graphml.graphdrawing.org/xmlns"
xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
>

<xs:importnamespace="http://www.w3.org/1999/xlink"
schemaLocation="xlink.xsd"/>

<xs:redefine
schemaLocation="http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<xs:attributeGroupname="node.extra.attrib">
<xs:attributeGroupref="node.extra.attrib"/>
<xs:attributeref="xlink:href"use="optional"/>
</xs:attributeGroup>
</xs:redefine>

</xs:schema>
例子
<?xmlversion="1.0"encoding="UTF-8"?>
<graphmlxmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
graphml+xlink.xsd">
<graphedgedefault="directed">
<nodeid="n0"xlink:href="http://graphml.graphdrawing.org"/>
<nodeid="n1"/>
<edgesource="n0"target="n1"/>
</graph>
</graphml>
Complex Type扩展
<meta content="text/html; charset=utf-8" http-equiv="CONTENT-TYPE"> <meta content="StarSuite 8 (Linux)" name="GENERATOR"> <meta content="*" name="AUTHOR"> <meta content="20071029;11490000" name="CREATED"> <meta content="Seaman Wang" name="CHANGEDBY"> <meta content="20080123;17363500" name="CHANGED">xsd定义: <style type="text/css"> <!-- @page { size: 21cm 29.7cm; margin: 2cm } PRE.western { font-family: "Cumberland", "Courier New", monospace } PRE.cjk { font-family: "方正宋体", monospace } PRE.ctl { font-family: "方正宋体", monospace } P { margin-bottom: 0.21cm } --> </style>
<?xmlversion="1.0"encoding="UTF-8"?>
<xs:schema
targetNamespace="http://graphml.graphdrawing.org/xmlns"
xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
>

<xs:importnamespace="http://www.w3.org/2000/svg"
schemaLocation="svg.xsd"/>

<xs:redefine
schemaLocation="http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<xs:complexTypename="data-extension.type">
<xs:complexContent>
<xs:extensionbase="data-extension.type">
<xs:sequence>
<xs:elementref="svg:svg"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:redefine>

</xs:schema>
例子:
<?xmlversion="1.0"encoding="UTF-8"?>
<graphmlxmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
graphml+svg.xsd">
<keyid="k0"for="node">
<default>
<svg:svgwidth="5cm"height="4cm"version="1.1">
<svg:desc>Defaultgraphicalrepresentationfornodes
</svg:desc>
<svg:rectx="0.5cm"y="0.5cm"width="2cm"height="1cm"/>
</svg:svg>
</default>
</key>
<keyid="k1"for="edge">
<desc>Graphicalrepresentationforedges
</desc>
</key>
<graphedgedefault="directed">
<nodeid="n0">
<datakey="k0">
<svg:svgwidth="4cm"height="8cm"version="1.1">
<svg:ellipsecx="2cm"cy="4cm"rx="2cm"ry="1cm"/>
</svg:svg>
</data>
</node>
<nodeid="n1"/>
<edgesource="n0"target="n1">
<datakey="k1">
<svg:svgwidth="12cm"height="4cm"viewBox="001200400">
<svg:linex1="100"y1="300"x2="300"y2="100"
stroke-width="5"/>
</svg:svg>
</data>
</edge>
</graph>
</graphml>
GraphML的扩展是基于xml的扩展方式,通过增加namespace的引用就可以容易地扩展GraphML,包括xml属性的扩展和Complex Type的扩展。
属性扩展<meta content="text/html; charset=utf-8" http-equiv="CONTENT-TYPE"> <meta content="StarSuite 8 (Linux)" name="GENERATOR"> <meta content="*" name="AUTHOR"> <meta content="20071029;11490000" name="CREATED"> <meta content="Seaman Wang" name="CHANGEDBY"> <meta content="20080123;17212300" name="CHANGED">xsd定义:<style type="text/css"><!-- @page { size: 21cm 29.7cm; margin: 2cm } PRE.western { font-family: "Cumberland", "Courier New", monospace } PRE.cjk { font-family: "方正宋体", monospace } PRE.ctl { font-family: "方正宋体", monospace } P { margin-bottom: 0.21cm } --></style> graphml+xlink.xsd






















例子












Complex Type扩展
<meta content="text/html; charset=utf-8" http-equiv="CONTENT-TYPE"> <meta content="StarSuite 8 (Linux)" name="GENERATOR"> <meta content="*" name="AUTHOR"> <meta content="20071029;11490000" name="CREATED"> <meta content="Seaman Wang" name="CHANGEDBY"> <meta content="20080123;17363500" name="CHANGED">xsd定义: <style type="text/css"> <!-- @page { size: 21cm 29.7cm; margin: 2cm } PRE.western { font-family: "Cumberland", "Courier New", monospace } PRE.cjk { font-family: "方正宋体", monospace } PRE.ctl { font-family: "方正宋体", monospace } P { margin-bottom: 0.21cm } --> </style>



























例子:





































