You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2020/11/18 19:18:59 UTC
[tomcat] 02/02: Bug 64931 - Implement validation of changelog.xml
file at build time.
This is an automated email from the ASF dual-hosted git repository.
kkolinko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 07607ca50a00e0224510b776023ad7b6a8d6f648
Author: Konstantin Kolinko <kk...@apache.org>
AuthorDate: Wed Nov 18 20:28:56 2020 +0300
Bug 64931 - Implement validation of changelog.xml file at build time.
Validation is performed against an inline DTD.
---
build.xml | 5 +++++
webapps/docs/changelog.xml | 49 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+)
diff --git a/build.xml b/build.xml
index 1ab4af5..50b4948 100644
--- a/build.xml
+++ b/build.xml
@@ -1258,6 +1258,11 @@
<target name="build-docs" depends="compile-prepare" description="Builds all documentation from XML sources">
+ <!-- Validation of changelog.xml -->
+ <xmlvalidate
+ file="webapps/docs/changelog.xml"
+ />
+
<copy todir="${tomcat.build}/webapps">
<fileset dir="webapps">
<include name="docs/images/**"/>
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5afb18b..ab7e51f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -17,6 +17,55 @@
-->
<!DOCTYPE document [
<!ENTITY project SYSTEM "project.xml">
+
+ <!-- DTD is used to validate changelog structure at build time. BZ 64931. -->
+
+ <!ELEMENT document (project?, properties, body)>
+ <!ATTLIST document url CDATA #REQUIRED>
+
+ <!-- body and title are used both in project.xml and in this document -->
+ <!ELEMENT body ANY>
+ <!ELEMENT title (#PCDATA)>
+
+ <!-- Elements of project.xml -->
+ <!ELEMENT project (title, logo, body)>
+ <!ATTLIST project name CDATA #REQUIRED>
+ <!ATTLIST project href CDATA #REQUIRED>
+
+ <!ELEMENT logo (#PCDATA)>
+ <!ATTLIST logo href CDATA #REQUIRED>
+
+ <!ELEMENT menu (item+)>
+ <!ATTLIST menu name CDATA #REQUIRED>
+
+ <!ELEMENT item EMPTY>
+ <!ATTLIST item name CDATA #REQUIRED>
+ <!ATTLIST item href CDATA #REQUIRED>
+
+ <!-- Elements of this document -->
+ <!ELEMENT properties (title, no-comments) >
+ <!ELEMENT no-comments EMPTY>
+
+ <!ELEMENT section (subsection)*>
+ <!ATTLIST section name CDATA #REQUIRED>
+ <!ATTLIST section rtext CDATA #IMPLIED>
+
+ <!ELEMENT subsection (changelog+)>
+ <!ATTLIST subsection name CDATA #REQUIRED>
+
+ <!ELEMENT changelog (add|update|fix|scode)*>
+ <!ELEMENT add ANY>
+ <!ELEMENT fix ANY>
+ <!ELEMENT scode ANY>
+ <!ELEMENT update ANY>
+
+ <!ELEMENT bug (#PCDATA)>
+
+ <!-- Random HTML markup tags. Add more here as needed. -->
+ <!ELEMENT a (#PCDATA)>
+ <!ATTLIST a href CDATA #REQUIRED>
+
+ <!ELEMENT code (#PCDATA)>
]>
<?xml-stylesheet type="text/xsl" href="tomcat-docs.xsl"?>
<document url="changelog.html">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org