diff --git a/test.py b/test.py index 81e0e360..d6fd14e2 100644 --- a/test.py +++ b/test.py @@ -14,7 +14,7 @@ from xml2rfc.writers.base import default_options, BaseV3Writer, RfcWriterError from xml2rfc.writers import DatatrackerToBibConverter from xml2rfc.writers.text import MAX_WIDTH -from xml2rfc.utils import strip_link_attachments +from xml2rfc.utils import strip_link_attachments, strip_svg_scripts from xml2rfc.util.file import can_access, FileAccessError try: @@ -567,6 +567,7 @@ def test_get_font_family(self): def test_set_font_family(self): input_svg = lxml.etree.fromstring(''' + foobar @@ -578,6 +579,7 @@ def test_set_font_family(self): ''') expected_svg = lxml.etree.tostring(lxml.etree.fromstring(''' + foobar @@ -1163,7 +1165,7 @@ def test_allowed_access_template(self): access_templates=True)) -class StripLinkAttachmentsTest(unittest.TestCase): +class SanitizeTest(unittest.TestCase): def setUp(self): self.options = copy.deepcopy(default_options) @@ -1194,6 +1196,32 @@ def test_strips_attachement(self): self.assertNotIn("/etc/passwd", xml_str) self.assertNotIn("/home/vader/ds-1/schematics", xml_str) + def test_strip_svg(self): + self.options.allow_local_file_access = False + svg_with_scripts = lxml.etree.fromstring(''' + + + + + + + + foobar +''') + expected_svg = lxml.etree.fromstring(''' + + + + + foobar +''') + + strip_svg_scripts(svg_with_scripts) + + sanitized = lxml.etree.tostring(svg_with_scripts) + expected = lxml.etree.tostring(expected_svg) + self.assertEqual(sanitized, expected) + if __name__ == '__main__': unittest.main() diff --git a/xml2rfc/data/SVG-1.2-RFC.rnc b/xml2rfc/data/SVG-1.2-RFC.rnc deleted file mode 100644 index 040151f1..00000000 --- a/xml2rfc/data/SVG-1.2-RFC.rnc +++ /dev/null @@ -1,1666 +0,0 @@ -#--- SVG 1.2 RFC rnc schema; Nevil Brownlee, Tue Jan 16 2018 (NZDT) - -default namespace = "http://www.w3.org/2000/svg" -namespace xlink = "http://www.w3.org/1999/xlink" - -rfc-color = ( # SVG-1.2-RFC doesn't allow "color or grey-scale" - "black" | "white" | "#000000" | "#FFFFFF" | "#ffffff" | - "currentColor" | "inherit" ) - -start = svg - -svg = - element svg { - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit"}?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute width { xsd:string }?, - attribute height { xsd:string }?, - attribute preserveAspectRatio { - xsd:string { pattern = "\s*(none|xMidYMid)\s*(meet)?\s*" } - }?, - attribute viewBox { text }?, - attribute version { - xsd:string "1.0" | xsd:string "1.1" | xsd:string "1.2" - }?, - attribute baseProfile { - xsd:string "none" - | xsd:string "tiny" - | xsd:string "basic" - | xsd:string "full" - }?, - attribute snapshotTime { xsd:string "none" | xsd:string }?, - (desc - | svgTitle - | path - | rect - | circle - | line - | ellipse - | polyline - | polygon - | solidColor - | textArea - | \text - | g - | defs - | use - | a)* - } - -desc = - element desc { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - ((attribute display { - "inline" - | "block" - | "list-item" - | "run-in" - | "compact" - | "marker" - | "table" - | "inline-table" - | "table-row-group" - | "table-header-group" - | "table-footer-group" - | "table-row" - | "table-column-group" - | "table-column" - | "table-cell" - | "table-caption" - | "none" - | "inherit" - }?, - attribute visibility { "visible" | "hidden" | "collapse" | "inherit" }?, - attribute image-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?, - attribute shape-rendering { - "auto" - | "optimizeSpeed" - | "crispEdges" - | "geometricPrecision" - | "inherit" - }?, - attribute text-rendering { - "auto" - | "optimizeSpeed" - | "optimizeLegibility" - | "geometricPrecision" - | "inherit" - }?, - attribute buffered-rendering { - "auto" | "dynamic" | "static" | "inherit" - }?) - & (attribute viewport-fill { "none" | rfc-color }?, - attribute viewport-fill-opacity { "inherit" | xsd:string }?)), - text - } - -svgTitle = - element title { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - ((attribute display { - "inline" - | "block" - | "list-item" - | "run-in" - | "compact" - | "marker" - | "table" - | "inline-table" - | "table-row-group" - | "table-header-group" - | "table-footer-group" - | "table-row" - | "table-column-group" - | "table-column" - | "table-cell" - | "table-caption" - | "none" - | "inherit" - }?, - attribute visibility { "visible" | "hidden" | "collapse" | "inherit" }?, - attribute image-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?, - attribute shape-rendering { - "auto" - | "optimizeSpeed" - | "crispEdges" - | "geometricPrecision" - | "inherit" - }?, - attribute text-rendering { - "auto" - | "optimizeSpeed" - | "optimizeLegibility" - | "geometricPrecision" - | "inherit" - }?, - attribute buffered-rendering { - "auto" | "dynamic" | "static" | "inherit" - }?) - & (attribute viewport-fill { "none" | rfc-color }?, - attribute viewport-fill-opacity { "inherit" | xsd:string }?)), - text - } - -path = - element path { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - attribute d { xsd:string }?, - attribute pathLength { xsd:string }?, - (desc - | svgTitle)* - } - -rect = - element rect { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - attribute x { xsd:string }?, - attribute y { xsd:string }?, - attribute width { xsd:string }?, - attribute height { xsd:string }?, - attribute rx { xsd:string }?, - attribute ry { xsd:string }?, - (desc - | svgTitle)* - } - -circle = - element circle { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - attribute cx { xsd:string }?, - attribute cy { xsd:string }?, - attribute r { xsd:string }?, - (desc - | svgTitle)* - } - -line = - element line { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - attribute x1 { xsd:string }?, - attribute y1 { xsd:string }?, - attribute x2 { xsd:string }?, - attribute y2 { xsd:string }?, - (desc - | svgTitle)* - } - -ellipse = - element ellipse { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - attribute rx { xsd:string }?, - attribute ry { xsd:string }?, - attribute cx { xsd:string }?, - attribute cy { xsd:string }?, - (desc - | svgTitle)* - } - -polyline = - element polyline { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - attribute points { xsd:string }?, - (desc - | svgTitle)* - } - -polygon = - element polygon { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - attribute points { xsd:string }?, - (desc - | svgTitle)* - } - -solidColor = - element solidColor { - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - (desc - | svgTitle)* - } - -textArea = - element textArea { - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - attribute x { xsd:string }?, - attribute y { xsd:string }?, - attribute width { xsd:string | "auto" }?, - attribute height { xsd:string | "auto" }?, - (tspan - | desc - | svgTitle - | tspan_2 - | text - | a_2)+ - } - -\text = - element text { - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - attribute x { xsd:string }?, - attribute y { xsd:string }?, - attribute rotate { xsd:string }?, - (desc - | svgTitle - | tspan_2 - | text - | a_2)+ - } - -g = - element g { - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - (desc - | svgTitle - | path - | rect - | circle - | line - | ellipse - | polyline - | polygon - | solidColor - | textArea - | \text - | g - | defs - | use - | a)* - } - -defs = - element defs { - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - (desc - | svgTitle - | path - | rect - | circle - | line - | ellipse - | polyline - | polygon - | solidColor - | textArea - | \text - | g - | defs - | use - | a)* - } - -use = - element use { - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute transform { xsd:string | "none" }?, - attribute xlink:show { "embed" }?, - attribute xlink:actuate { "onLoad" }?, - attribute xlink:type { "simple" }?, - attribute xlink:role { xsd:anyURI | xsd:string }?, - attribute xlink:arcrole { xsd:anyURI | xsd:string }?, - attribute xlink:title { text }?, - attribute xlink:href { xsd:anyURI | xsd:string }?, - attribute x { xsd:string }?, - attribute y { xsd:string }?, - (desc - | svgTitle)* - } - -a = - element a { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - attribute transform { xsd:string | "none" }?, - attribute xlink:show { "new" | "replace" }?, - attribute xlink:actuate { "onRequest" }?, - attribute xlink:type { "simple" }?, - attribute xlink:role { xsd:anyURI | xsd:string }?, - attribute xlink:arcrole { xsd:anyURI | xsd:string }?, - attribute xlink:title { text }?, - attribute xlink:href { xsd:anyURI | xsd:string }?, - attribute target { - "_replace" | "_self" | "_parent" | "_top" | "_blank" | xsd:Name - }?, - (desc - | svgTitle - | path - | rect - | circle - | line - | ellipse - | polyline - | polygon - | solidColor - | textArea - | \text - | g - | defs - | use)* - } - -tspan = - element tspan { - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute x { xsd:string }?, # For SVG-1.2-RFC - attribute y { xsd:string }?, - (tbreak - | desc - | svgTitle - | tspan_2 - | text - | a_2)+ - } - -tspan_2 = - element tspan { - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - attribute x { xsd:string }?, # For SVG-1.2-RFC - attribute y { xsd:string }?, - (desc - | svgTitle - | tspan_2 - | text - | a_2)+ - } - -a_2 = - element a { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }?, - ((attribute fill-opacity { "inherit" | xsd:string }?, - attribute stroke-opacity { "inherit" | xsd:string }?) - & (attribute fill { "none" | rfc-color }?, - attribute fill-rule { "inherit" | "nonzero" | "evenodd" }?, - attribute stroke { rfc-color }?, - attribute stroke-dasharray { "inherit" | "none" | xsd:string }?, - attribute stroke-dashoffset { "inherit" | xsd:string }?, - attribute stroke-linecap { - "butt" | "round" | "square" | "inherit" - }?, - attribute stroke-linejoin { - "miter" | "round" | "bevel" | "inherit" - }?, - attribute stroke-miterlimit { "inherit" | xsd:string }?, - attribute stroke-width { "inherit" | xsd:string }?, - attribute color { rfc-color }?, - attribute color-rendering { - "auto" | "optimizeSpeed" | "optimizeQuality" | "inherit" - }?) - & attribute vector-effect { - "none" | "non-scaling-stroke" | "inherit" - }? - & (attribute direction { "ltr" | "rtl" | "inherit" }?, - attribute unicode-bidi { - "normal" | "embed" | "bidi-override" | "inherit" - }?) - & (attribute solid-color { rfc-color }?, - attribute solid-opacity { "inherit" | xsd:string }?) - & (attribute display-align { - "auto" | "before" | "center" | "after" | "inherit" - }?, - attribute line-increment { "auto" | "inherit" | xsd:string }?) - & (attribute stop-color { rfc-color }?, - attribute stop-opacity { "inherit" | xsd:string }?) - & (attribute font-family { "serif" | "sans-serif" | "monospace" - | "inherit" }?, - attribute font-size { "inherit" | xsd:string }?, - attribute font-style { - "normal" | "italic" | "oblique" | "inherit" - }?, - attribute font-variant { "normal" | "small-caps" | "inherit" }?, - attribute font-weight { - "normal" - | "bold" - | "bolder" - | "lighter" - | "inherit" - }?, - attribute text-anchor { - "start" | "middle" | "end" | "inherit" - }?, - attribute text-align { - "start" | "center" | "end" | "inherit" - }?)), - attribute transform { xsd:string | "none" }?, - attribute xlink:show { "new" | "replace" }?, - attribute xlink:actuate { "onRequest" }?, - attribute xlink:type { "simple" }?, - attribute xlink:role { xsd:anyURI | xsd:string }?, - attribute xlink:arcrole { xsd:anyURI | xsd:string }?, - attribute xlink:title { text }?, - attribute xlink:href { xsd:anyURI | xsd:string }?, - attribute target { - "_replace" | "_self" | "_parent" | "_top" | "_blank" | xsd:Name - }?, - (desc - | svgTitle - | tspan_2 - | text)+ - } - -tbreak = - element tbreak { - (attribute id { xsd:NCName } - | attribute xml:id { xsd:NCName })?, - attribute xml:base { xsd:anyURI | xsd:string }?, - attribute xml:lang { xsd:language? }?, - attribute class { xsd:NMTOKENS }?, - attribute role { xsd:string }?, - attribute rel { xsd:string }?, - attribute rev { xsd:string }?, - attribute typeof { xsd:string }?, - attribute content { xsd:string }?, - attribute datatype { xsd:string }?, - attribute resource { xsd:string }?, - attribute about { xsd:string }?, - attribute property { xsd:string }?, - attribute xml:space { "default" | "preserve" }? - } - -#--- End of SVG 1.2 RFC rnc schema diff --git a/xml2rfc/data/SVG-1.2-RFC.rng b/xml2rfc/data/SVG-1.2-RFC.rng deleted file mode 100644 index 3c90e7a3..00000000 --- a/xml2rfc/data/SVG-1.2-RFC.rng +++ /dev/null @@ -1,7460 +0,0 @@ - - - - - - - black - white - #000000 - #FFFFFF - #ffffff - currentColor - inherit - - - - - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - - - - - - - - - - \s*(none|xMidYMid)\s*(meet)?\s* - - - - - - - - - - 1.0 - 1.1 - 1.2 - - - - - - - none - tiny - basic - full - - - - - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - - inline - block - list-item - run-in - compact - marker - table - inline-table - table-row-group - table-header-group - table-footer-group - table-row - table-column-group - table-column - table-cell - table-caption - none - inherit - - - - - - - visible - hidden - collapse - inherit - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - auto - optimizeSpeed - crispEdges - geometricPrecision - inherit - - - - - - - auto - optimizeSpeed - optimizeLegibility - geometricPrecision - inherit - - - - - - - auto - dynamic - static - inherit - - - - - - - - - none - - - - - - - - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - - inline - block - list-item - run-in - compact - marker - table - inline-table - table-row-group - table-header-group - table-footer-group - table-row - table-column-group - table-column - table-cell - table-caption - none - inherit - - - - - - - visible - hidden - collapse - inherit - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - auto - optimizeSpeed - crispEdges - geometricPrecision - inherit - - - - - - - auto - optimizeSpeed - optimizeLegibility - geometricPrecision - inherit - - - - - - - auto - dynamic - static - inherit - - - - - - - - - none - - - - - - - - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - - - - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - - - - - - - - - - - - - auto - - - - - - - - auto - - - - - - - - - - - - - - - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - none - - - - - - embed - - - - - onLoad - - - - - simple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - none - - - - - - - new - replace - - - - - - onRequest - - - - - simple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _replace - _self - _parent - _top - _blank - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - none - - - - - - - - inherit - nonzero - evenodd - - - - - - - - - - - - inherit - none - - - - - - - - inherit - - - - - - - - butt - round - square - inherit - - - - - - - miter - round - bevel - inherit - - - - - - - inherit - - - - - - - - inherit - - - - - - - - - - - - - auto - optimizeSpeed - optimizeQuality - inherit - - - - - - - - none - non-scaling-stroke - inherit - - - - - - - - ltr - rtl - inherit - - - - - - - normal - embed - bidi-override - inherit - - - - - - - - - - - - - - inherit - - - - - - - - - - auto - before - center - after - inherit - - - - - - - auto - inherit - - - - - - - - - - - - - - - inherit - - - - - - - - - - serif - sans-serif - monospace - inherit - - - - - - - inherit - - - - - - - - normal - italic - oblique - inherit - - - - - - - normal - small-caps - inherit - - - - - - - normal - bold - bolder - lighter - inherit - - - - - - - start - middle - end - inherit - - - - - - - start - center - end - inherit - - - - - - - - - - none - - - - - - - new - replace - - - - - - onRequest - - - - - simple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _replace - _self - _parent - _top - _blank - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - preserve - - - - - - - diff --git a/xml2rfc/data/reference.rnc b/xml2rfc/data/reference.rnc index fc6cb68e..e6b7fd47 100644 --- a/xml2rfc/data/reference.rnc +++ b/xml2rfc/data/reference.rnc @@ -734,7 +734,15 @@ attribute originalSrc { text }?, (text* | svg) } - include "SVG-1.2-RFC.rnc" + namespace svg = "http://www.w3.org/2000/svg" + any = element * { + attribute * { text }*, + (text | any)* + } + svg = element svg:svg { + attribute * { text }*, + any*, + } sourcecode = element sourcecode { diff --git a/xml2rfc/data/reference.rng b/xml2rfc/data/reference.rng index 956aaa0b..364629e8 100644 --- a/xml2rfc/data/reference.rng +++ b/xml2rfc/data/reference.rng @@ -1639,7 +1639,33 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml2rfc/data/referencegroup.rng b/xml2rfc/data/referencegroup.rng index 5ebd8c9d..874dcea8 100644 --- a/xml2rfc/data/referencegroup.rng +++ b/xml2rfc/data/referencegroup.rng @@ -1661,7 +1661,33 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml2rfc/data/v3.rnc b/xml2rfc/data/v3.rnc index d2dfcc26..c9cd70e6 100644 --- a/xml2rfc/data/v3.rnc +++ b/xml2rfc/data/v3.rnc @@ -871,7 +871,15 @@ attribute originalSrc { text }?, (text* | svg) } - include "SVG-1.2-RFC.rnc" + namespace svg = "http://www.w3.org/2000/svg" + any = element * { + attribute * { text }*, + (text | any)* + } + svg = element svg:svg { + attribute * { text }*, + any*, + } sourcecode = element sourcecode { diff --git a/xml2rfc/data/v3.rng b/xml2rfc/data/v3.rng index 34e60c57..0411a68a 100644 --- a/xml2rfc/data/v3.rng +++ b/xml2rfc/data/v3.rng @@ -1877,7 +1877,33 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml2rfc/data/xml2rfc-v3-emacs-nxml.rnc b/xml2rfc/data/xml2rfc-v3-emacs-nxml.rnc index 0456bff2..d6c8cd94 100644 --- a/xml2rfc/data/xml2rfc-v3-emacs-nxml.rnc +++ b/xml2rfc/data/xml2rfc-v3-emacs-nxml.rnc @@ -804,7 +804,15 @@ attribute originalSrc { text }?, (text* | svg | xinclude ) } - include "SVG-1.2-RFC.rnc" + namespace svg = "http://www.w3.org/2000/svg" + any = element * { + attribute * { text }*, + (text | any)* + } + svg = element svg:svg { + attribute * { text }*, + any*, + } sourcecode = element sourcecode { diff --git a/xml2rfc/parser.py b/xml2rfc/parser.py index 4dac21d1..4902193e 100644 --- a/xml2rfc/parser.py +++ b/xml2rfc/parser.py @@ -758,9 +758,9 @@ def getpis(self): def sanitize(self): """ Sanitize the document """ - # Strip link attachments xml2rfc.utils.strip_link_attachments(self.tree) - + xml2rfc.utils.strip_svg_scripts(self.tree) + def validate(self, dtd_path=None): """ Validate the document with its default dtd, or an optional one diff --git a/xml2rfc/templates/doc.xml b/xml2rfc/templates/doc.xml index 750fa30b..4e2a3696 100644 --- a/xml2rfc/templates/doc.xml +++ b/xml2rfc/templates/doc.xml @@ -92,7 +92,7 @@
Schema Version 3 Elements {% for element in elements %} - {% if not element.deprecated %} + {% if not element.deprecated and not ":" in element.tag %}
<{{element.tag}}> {% if element.new %} (New){% endif %} {% if element.description %} @@ -273,9 +273,9 @@ - + diff --git a/xml2rfc/templates/doc.yaml b/xml2rfc/templates/doc.yaml index b7bed35b..f67a5659 100644 --- a/xml2rfc/templates/doc.yaml +++ b/xml2rfc/templates/doc.yaml @@ -123,7 +123,7 @@ artwork: \' - The use of SVG in Internet-Drafts and RFCs is covered in much more - detail in . + detail in . - 'The above methods for inclusion of SVG art can also be used for including text artwork, but using a data: URI is probably confusing diff --git a/xml2rfc/utils.py b/xml2rfc/utils.py index fd67c3ac..28698dc2 100644 --- a/xml2rfc/utils.py +++ b/xml2rfc/utils.py @@ -367,9 +367,37 @@ def strip_link_attachments(tree): Find link tags with rel="attachment". """ for attachment in tree.xpath('//link[@rel="attachment"]'): - xml2rfc.log.warn(f"Removed {attachment}. link relationships type attachment is not allowed.") - attachment.getparent().remove(attachment) + p = attachment.getparent() + xml2rfc.log.warn(f"Removed link relationship of type attachment from <{p.tag}>.") + p.remove(attachment) +def strip_svg_scripts(tree): + """ + Find any scripts in SVG images and remove them. + """ + # Only look at the local name, ignoring case for forbidden elements. + lcname = "translate(local-name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" + for forbid in ["script", "iframe", "frame", "foreignobject", "link"]: + for e in tree.xpath(f'//svg:svg//*[{lcname} = "{forbid}"]', namespaces=namespaces): + p = e.getparent() + xml2rfc.log.warn(f"Removed {e.tag} element from {p.tag}. SVG cannot contain these elements.") + p.remove(e) + css_url = re.compile(r"""url\(['"]?[^#]""", flags=re.IGNORECASE) + for e in tree.xpath(f'//svg:svg//*[{lcname} = "style"]', namespaces=namespaces): + if css_url.search(e.text) is not None: + p = e.getparent() + xml2rfc.log.warn(f"Removed {e.tag} element from {p.tag}. This appears to contain url().") + p.remove(e) + for e in tree.xpath(f'//svg:svg//*[@*[starts-with(local-name(), "on")]]', namespaces=namespaces): + for a in e.attrib.keys(): + if a[:2] == 'on': + xml2rfc.log.warn(f"Removed attribute {e.tag}@{a}. SVG cannot contain scripts.") + e.attrib.pop(a) + for e in tree.xpath(f'//svg:svg//*[@*[{lcname} = "href"]]', namespaces=namespaces): + for name, value in e.attrib.items(): + if name.lower() == "href" and value[0] != "#": + xml2rfc.log.warn(f"Removed attribute {e.tag}@{name}. Cannot reference external entities.") + e.attrib.pop(name) # ---------------------------------------------------------------------- # Unicode operations diff --git a/xml2rfc/writers/base.py b/xml2rfc/writers/base.py index 53dd77b7..73172ace 100644 --- a/xml2rfc/writers/base.py +++ b/xml2rfc/writers/base.py @@ -1656,7 +1656,7 @@ def get_element_tags(): elements = v3_schema.xpath("/x:grammar/x:define/x:element", namespaces=namespaces) for element in elements: name = element.get('name') - if not name in tags: + if name is not None and not name in tags: tags.add(name) return tags diff --git a/xml2rfc/writers/doc.py b/xml2rfc/writers/doc.py index 9916955f..2873b96d 100644 --- a/xml2rfc/writers/doc.py +++ b/xml2rfc/writers/doc.py @@ -69,13 +69,15 @@ def get_elements(self): rnc.render(self.v3_schema.getroot()) for element in edefs: ename = element.get('name') + if ename is None or ":" in ename: + continue is_new = self.rfc7991_schema.xpath("/x:grammar/x:define/x:element[@name='%s']" % ename, namespaces=namespaces) == [] e = {'attributes': [], 'children': [], 'rnc': [], 'parents': [], 'new': is_new, } elements[ename] = e #debug.show('ename') for a in element.xpath('.//x:attribute', namespaces=namespaces): aname = a.get('name') - if aname in ignored_attributes: + if aname is None or aname in ignored_attributes: continue adict = {'name': aname} e['attributes'].append(adict) @@ -139,7 +141,10 @@ def process(self): element_list.sort(key=lambda x: x['tag']) for d in element_list: - d.update(elements[d['tag']]) + tag = d['tag'] + if tag is None or ":" in tag: + continue + d.update(elements[tag]) # --- Command-line options information for the template context --- @@ -244,7 +249,7 @@ def __init__(self, **kwargs): if 'deprecated' in kwargs: self.deprecated = kwargs.pop('deprecated') def render(self, e): - if e.tag in [lxml.etree.Comment, ]: + if e.tag in [lxml.etree.Comment, ]: return '' tag = e.tag.replace('{http://relaxng.org/ns/structure/1.0}', '') if hasattr(self, tag): @@ -252,6 +257,14 @@ def render(self, e): return func(e) else: raise NotImplementedError('%s()' % tag) + def name_and_children(self, e): + name = e.get('name') + cc = e.getchildren() + if len(cc) > 0 and cc[0].tag == "anyName": + return ('*', cc[1:]) + return (name, cc) + def anyName(self, e): + return '' # see name_and_children() above def zeroOrMore(self, e): cc = e.getchildren() sub = ', '.join(filter(None, [ self.render(c) for c in cc ])) @@ -314,18 +327,16 @@ def define(self, e): sub = ',\n'.join(filter(None, [ self.render(c) for c in cc ])) return '%s =\n %s\n' % (txt, sub) def element(self, e): - name = e.get('name') - cc = e.getchildren() + name, cc = self.name_and_children(e) sub = ',\n '.join(filter(None, [ self.render(c) for c in cc ])) txt = 'element %s {\n %s\n }\n' % (name, sub) txt = re.sub(r'(\n[ \t]*)+\n', '\n', txt) return txt def attribute(self, e): txt = '' - name = e.get('name') nsa = 'http://relaxng.org/ns/compatibility/annotations/1.0' default = e.get('{%s}defaultValue' % nsa, None) - cc = e.getchildren() + name, cc = self.name_and_children(e) sub = ', '.join(filter(None, [ self.render(c) for c in cc ])) if cc else 'text' if len(cc)==1 and re.match(r'\(.*\)$', sub): sub = sub[1:-1]