From 10510e60c2f5b5e3a3cc9c54d5a8d38ea6288b1a Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Tue, 11 Jun 2024 18:17:59 +0200 Subject: Makefile: Check if /guide/@self agrees with the document path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ulrich Müller --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 1bfa86e..8f3014e 100644 --- a/Makefile +++ b/Makefile @@ -89,6 +89,13 @@ install: all validate: devbook.rng @xmllint --noout --quiet --relaxng $< $(XMLS) + @# Check if /guide/@self agrees with the document path + @for file in $(XMLS); do \ + self=$$(xmllint --quiet --xpath 'string(/guide/@self)' $${file}); \ + if test "$${self}text.xml" != "$${file#./}"; then \ + echo "$${file}: bad self attribute '$${self}'"; exit 1; \ + fi; \ + done @echo "xmllint validation successful" %.rng: %.rnc -- cgit v1.2.3-65-gdbad