Can schemas help SVG interwork with other markup vocabularies?
MURATA Makoto (FAMILY Given)
International University of Japan
XHTMLXForms
SVGXML Events
Markup vocabularies mentioned in SVG specs XHTML MathML sXBL (formerly RCC) XForms XML Events SMIL XLink RDF user-defined vocabularies
XML source<?xml version="1.0"?><html xmlns="http://www.w3.org/1999/xhtml"> <head>
<title>Complex Compound Document</title> <style xml:space="preserve">div.attention{ font-size:small;color:red; } div.mathml_graph {background:white;border:gray solid 1px;float:right; width:5cm;margin:5px;text-align:center;} div.mathml_main {margin:50px}</style>
</head> <body bgcolor="#EEF">
<h1>Complex Compound Document</h1> <p>Various Vocabularies are packed in XHTML.</p> <table border="1" width="80%" align="center" style="background:#CFC">
<tr> <td>SVG</td> <td style="padding:5px;background:white">
<svg width="4cm" height="4cm" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
<path d="M 139.41666,24.729164 L 212.41666,250.72916 L 20.416656,110.729164 L 258.41666,110.729164 L 66.41666,250.72916 L 139.41666,24.729164" style="fill-rule:nonzero; fill:red; stroke:black; stroke-width:3" />
<path d="M 257.9375,130.5625 L 330.9375,356.5625 L 138.9375,216.5625 L 376.9375,216.5625 L 184.9375,356.5625 L 257.9375,130.5625" style="fill-rule:evenodd; fill:red; stroke:black; stroke-width:3" />
</svg> </td>
</tr>
SVG and sXBL<svg:svg xmlns:svg="http://www.w3.org/2000/svg" version="1.2" xmlns:xbl="http://www.w3.org/2004/xbl"> <svg:defs> <xbl:xbl> <xbl:definition element="red"> <xbl:template> <svg:text fill="red"><xbl:content/></svg:text> </xbl:template> </xbl:definition> </xbl:xbl> </svg:defs>
<red> Red text. </red>
</svg:svg>
Schemas and Schema Languages Schemas
A formal description of the syntax of a markup vocabulary
Schema languages DTD W3C XML Schema RELAX NG
Three reasons for using schemas To provide rigorous, concise, and
human-readable description of a markup vocabulary.
To determine whether an XML document is indeed written in that markup vocabulary [validation ].
To easily build application programs dedicated to that markup vocabulary [data binding ].
Schemas for non-monolithic documents We have an RNG schema for SVG2. We have an RNG schema for sXBL. Then, is it easy to create a schema for t
he combination of SVG2 and sXBL? Not really XHTML2 + XForms+ SVG + XML Events + s
XBL + SMIL is hoplessly difficult.
Requirements on validation#1 It should be possible to combine
schemas representing vocabularies easily.
It should be possible to divide non-monolithic documents into pieces and then validate each piece against one of the schemas. (divide-and-validate)
Do existing schema languages meet these requirements? No, you have to understand all
schemas very well and change them.
No, you have to validate the entire document against the combination of all schemas.
W3C XML Schema RELAX NG
Requirements on validation#2 It should be possible to use different sc
hema languages for different vocabularies
Validators for many schema languages should work together.
Do existing schema languages meet these requirements? No, you are forced to use one schema la
nguage No, you have to use one validator.
W3C XML Schema RELAX NG
Idea Schema authoring by combining subschemas
Each subschema is concerned with one (or a few) namespaces.
Different subschemas may be written in different schema languages.
Validation (Divide-and-validate) Divide a non-monolithic document into validation c
andidates. Different validation candidates are dispatched to di
fferent validators.
Processing model
schema
Non-monolithic document
Validation candidate
validator
DSDL-NVDL engine
DSDL-NVDL schema
SVG and sXBL<svg:svg xmlns:svg="http://www.w3.org/2000/svg" version="1.2" xmlns:xbl="http://www.w3.org/2004/xbl"> <svg:defs> <xbl:xbl> <xbl:definition element="red"> <xbl:template> <svg:text fill="red"><xbl:content/> </svg:text> </xbl:template> </xbl:definition> </xbl:xbl> </svg:defs>
<red> Red text. </red>
</svg:svg>
SVG only<svg:svg xmlns:svg="http://www.w3.org/2000/svg" version="1.2" xmlns:xbl="http://www.w3.org/2004/xbl"> <svg:defs> <xbl:xbl> <xbl:definition element="red"> <xbl:template> <svg:text fill="red"><xbl:content/> </svg:text> </xbl:template> </xbl:definition> </xbl:xbl> </svg:defs>
<red> Red text. </red>
</svg:svg>
sXBL only<svg:svg xmlns:svg="http://www.w3.org/2000/svg" version="1.2" xmlns:xbl="http://www.w3.org/2004/xbl"> <svg:defs> <xbl:xbl> <xbl:definition element="red"> <xbl:template> <svg:text fill="red"><xbl:content/> </svg:text> </xbl:template> </xbl:definition> </xbl:xbl> </svg:defs>
<red> Red text. </red>
</svg:svg>
User-defined vocabulary only<svg:svg xmlns:svg="http://www.w3.org/2000/svg" version="1.2" xmlns:xbl="http://www.w3.org/2004/xbl"> <svg:defs> <xbl:xbl> <xbl:definition element="red"> <xbl:template> <svg:text fill="red"><xbl:content/> </svg:text> </xbl:template> </xbl:definition> </xbl:xbl> </svg:defs>
<red> Red text. </red>
</svg:svg>
Document Schema Definition Languages1. Overview2. Regular-grammar-based validation -- RELAX NG3. Rule-based validation -- Schematron4. Namespace-based Validation Dispatching Language
-- NVDL5. Datatypes6. Path-based integrity constraints7. Character repertoire validation8. Declarative document architecture9. Datatype- and namespace-aware DTDs10. Validation management
History RELAX Namespace(2001)
JIS Technical Report ISO/IEC JTC1 Draft Technical Report
DSDL Part 4 Committee Draft (2002) Modular Namespaces by James Clark (2003) Namespace Switchboard by Rick Jelliffe (2003) Namespace Routing Language by James Clark
(2003) DSDL Part 4 Second Committee Draft (2004)
Plan Final Committee Draft (2004?) Final Draft International Standard
(2005?) International Standard (2005?)
Conclusion and Future Work If the namespace recommendation
is the first step, NVDL is the second step for the non-monolithic WWW.
Data binding for NVDL is strongly required.
Top Related