Skip to content

Commit 7a4421f

Browse files
author
Sanders Kleinfeld
committed
Added support for embedded SVG via xs:import in htmlbook.xsd
1 parent 5ea3771 commit 7a4421f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

htmlbook.xsd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0"?>
2-
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" targetNamespace="http://www.w3.org/1999/xhtml" elementFormDefault="qualified" attributeFormDefault="unqualified">
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" targetNamespace="http://www.w3.org/1999/xhtml" elementFormDefault="qualified" attributeFormDefault="unqualified">
33

44
<xs:import namespace="http://www.w3.org/1998/Math/MathML" schemaLocation="mathml3/mathml3.xsd"/>
5+
<xs:import namespace="http://www.w3.org/2000/svg" schemaLocation="svg/SVG.xsd"/>
56

67
<xs:element name="html">
78
<xs:complexType>
@@ -1330,8 +1331,7 @@
13301331
<xs:element ref="ol"/>
13311332
<xs:element ref="p"/>
13321333
<xs:element ref="pre"/>
1333-
<!-- ToDo: Add separate schema for SVG ref here?
1334-
<xs:element ref="svg:svg"/> -->
1334+
<xs:element ref="svg:svg"/>
13351335
<xs:element ref="table"/>
13361336
<xs:element ref="ul"/>
13371337
<xs:element ref="video"/>

samples/test_schema.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml-model href="../htmlbook.xsd" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
21
<html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
32
xsi:schemaLocation="http://www.w3.org/1999/xhtml ../htmlbook.xsd"
43
xmlns="http://www.w3.org/1999/xhtml">
@@ -97,8 +96,12 @@ <h5>Test</h5>
9796
<img src="image.png" id="an_image" lang="en"/>
9897
</figure>
9998

99+
<!-- Some embedded MML -->
100100
<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>2</mn> <mo>+</mo> <mn>2</mn> <mo>=</mo> <mn>4</mn></math>
101101

102+
<!-- Some embedded SVG -->
103+
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="200"><desc>SVG content goes here...</desc></svg>
104+
102105
<!-- Oh boy, let's do a couple tables -->
103106
<!-- No <tbody> -->
104107
<table border="" id="skeleton_of_a_table" accesskey="A a d">

0 commit comments

Comments
 (0)