Copyright (C) 2025 The Meme Factory, Inc. https://karlpinc.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/. Karl O. Pinc kop@karlpinc.com There, that set it up so we can have comments. From: http://www.dpawson.co.uk/xsl/index.html http://www.dpawson.co.uk/xsl/sect2/comments.html#d2747e112 If this were not "top level" we'd have to also have somewhere in here. The topmost 2 lines are basic and required Header Information. This stylesheet is used by the Makefile to generate SQL comments from the docbook text. Bugs: Instead of importing the docbook xsl and using it to process the content of the comment, we kludge it and assume there's only xref elements in the comment content. Since we don't have a namespace for docbook4, this is how we know to do it. Establish m4 macros. Do this inside a comment, because the m4 macros tend to generate spurious whitespace. And perhaps other content we don't want in our xsl. We want text output Apply all the templates By default, do not output text nodes Output the xreflabel when that's what we want to see (get_xreflabel mode) Mode for processing comments (isok_comment mode) Output the xreflabel attribute value for xref elements Do output text when we're in our special mode, otherwise ignore all elements and just get their text. The table comments get the table name from the xreflabel attribute of the enclosing section. COMMENT ON TABLE IS $isok_comment$ $isok_comment$; The column comments get the column name from the xreflabel attribute of the enclosing section, and the table name from the xref attribute of that section's enclosing section. COMMENT ON COLUMN . IS $isok_comment$ $isok_comment$;