While a lot of things are already covered by xep.dtd, some more complex
requirements from XEP-0001 need to be checked manually currently. This is
error-prone and should be automated as far as feasible.
Work Proposal
Create a command-line utility which takes a single XEP filename as input (stdin won't work, see below)
Validate the input file against the following criteria
Optional: Check DTD conformance against xep.dtd
If the filename matches xep-[0-9]{4}.xml: check that the number in the filename equals /xep/header/number (XPath)
If the filename does not match xep-[0-9]{4}.xml, check:
That the /xep/header/status (XPath) is ProtoXEP
That the /xep/header/number (XPath) is literally XXXX
That the name does not start with xep-[0-9]
Check that /xep/header/status (XPath) is a defined status (see tools/xeplib.py for an enum)
Check that /xep/header/type (XPath) is defined in XEP-0001
If the XEP number is less than 400, also accept some legacy values. To find which, see which you encounter in the XEP numbers below 400 :-).
Check that /xep/header/approver (XPath) is either Board or Council
Check that the version numbers in the revision blocks are descending (from top to bottom in the document)
If the approver (see above) is Board, enforce that /xep/header/type is not Standards Track.
Check that it uses the xep.xsl XML stylesheet.
Check that it includes the correct legal notice (either by checking for the entity reference, or by checking the content)
Summary
While a lot of things are already covered by
xep.dtd
, some more complex requirements from XEP-0001 need to be checked manually currently. This is error-prone and should be automated as far as feasible.Work Proposal
Validate the input file against the following criteria
Optional: Check DTD conformance against
xep.dtd
If the filename matches
xep-[0-9]{4}.xml
: check that the number in the filename equals/xep/header/number
(XPath)If the filename does not match
xep-[0-9]{4}.xml
, check:/xep/header/status
(XPath) is ProtoXEP/xep/header/number
(XPath) is literallyXXXX
xep-[0-9]
Check that
/xep/header/status
(XPath) is a defined status (seetools/xeplib.py
for an enum)Check that
/xep/header/type
(XPath) is defined in XEP-0001Check that
/xep/header/approver
(XPath) is either Board or CouncilCheck that the version numbers in the revision blocks are descending (from top to bottom in the document)
If the approver (see above) is Board, enforce that
/xep/header/type
is notStandards Track
.Check that it uses the
xep.xsl
XML stylesheet.Check that it includes the correct legal notice (either by checking for the entity reference, or by checking the content)