From 75a18d202b53286e68a2e6674c9a34a9caa27627 Mon Sep 17 00:00:00 2001 From: milde Date: Wed, 6 Dec 2023 20:48:38 +0000 Subject: [PATCH] Validate and fix `docutils XML` output. Fix "xml" writer: The element must be empty (no whitespace allowed inside). Fix definition of in the DTD. does *not* take the basic attributes, instead a long list of custom ones similar to it's HTML role model. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@9497 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/docs/dev/testing.txt | 8 ++------ docutils/docs/ref/docutils.dtd | 23 ++++++++++++++-------- docutils/docutils/writers/docutils_xml.py | 2 +- .../expected/standalone_rst_docutils_xml.xml | 6 ++---- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/docutils/docs/dev/testing.txt b/docutils/docs/dev/testing.txt index 817f20733..b1382e5f4 100644 --- a/docutils/docs/dev/testing.txt +++ b/docutils/docs/dev/testing.txt @@ -286,9 +286,5 @@ actual output for validity and correctness, copy it to ``functional/expected/`` (overwriting the old expected output), and commit the change. -.. [#] The validity of `Docutils XML` can be tested with - ``xmllint .xml --valid --noout``. - - .. note: the ``--dtdvalid`` and ``--nonet`` options do not help override - a reference to the PUBLIC "docutils.dtd" if there is a local version - on the system (e.g. /usr/share/xml/docutils/docutils.dtd in Debian). +.. [#] `Docutils XML` can be validated with + ``xmllint --dtdvalid docs/ref/docutils.dtd --noout *.xml``. diff --git a/docutils/docs/ref/docutils.dtd b/docutils/docs/ref/docutils.dtd index 2ab5c87d4..58e2d1cc5 100644 --- a/docutils/docs/ref/docutils.dtd +++ b/docutils/docs/ref/docutils.dtd @@ -132,7 +132,7 @@ Internal reference to the `name` attribute of an element. On a resolve to either an internal or external reference. --> + " refname %refname.type; #IMPLIED "> @@ -167,8 +167,7 @@ resolve to either an internal or external reference. @@ -227,7 +226,7 @@ http://www.oasis-open.org/html/tm9901.htm). - + @@ -253,7 +252,7 @@ http://www.oasis-open.org/html/tm9901.htm). @@ -323,9 +322,17 @@ Eventual replacement for docinfo? --> - - - + + +