3 # $Date: 2007-03-23 14:57:22 -0700 (Fri, 23 Mar 2007) $
7 # ------------------------------------------------------------------
8 # ** Makefile.paramDoc - create param.xsl files w/ embedded doc **
9 # ------------------------------------------------------------------
11 PARAMFILES = $(wildcard ../../*/param.xsl)
12 PARAMFILESDOCD = $(foreach base,$(basename $(PARAMFILES)),$(base).docd.xsl)
17 COPYDOC := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
18 xmlns:doc="http://docbook.org/ns/docbook" \
20 <xsl:template match="*[local-name() = 'param']"> \
21 <xsl:call-template name="copy-xsl-source"/> \
23 <xsl:template match="*[local-name() = 'attribute-set']"> \
24 <xsl:call-template name="copy-xsl-source"/> \
26 <xsl:template name="copy-xsl-source"> \
29 select="concat('../../params/',@name,'.xml')"/> \
30 <xsl:apply-templates select="document($$source)/*[local-name() = 'refentry']"/> \
32 <xsl:apply-templates select="@* | node()"/> \
35 <xsl:template match="node() | @*"> \
37 <xsl:apply-templates select="@* | node()"/> \
40 <xsl:template match="*[local-name() = 'refentry']"> \
41 <xsl:text>&\#x0a;</xsl:text> \
42 <doc:refentry id="{@*[local-name() = 'id']}"> \
43 <xsl:apply-templates/> \
45 <xsl:text>&\#x0a;</xsl:text> \
47 <xsl:template match="*[local-name() = 'refsynopsisdiv']"/> \
50 all: $(PARAMFILESDOCD)
53 @echo '$(COPYDOC)' | $(XSLT) $(XSLTFLAGS) - $< > $@
56 @echo $(PARAMFILESDOCD)
59 $(RM) $(PARAMFILESDOCD)