Implement dynamic generation of &base; entity for XML documents and

activate it instead of using a static &base;.  Since an .xml database file
(or an .xslt stylesheet file) is used from various directories, the static
&base; no longer works.

PR:	www/102331
This commit is contained in:
Hiroki Sato 2006-08-21 18:27:43 +00:00
parent e113013a13
commit 764a355ca7
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=28508
2 changed files with 19 additions and 1 deletions

View file

@ -108,6 +108,12 @@ WWW_LANGCODE?= ${_WWW_LANGCODE}
DOC_PREFIX!= ${REALPATH} ${DOC_PREFIX}
WEB_PREFIX!= ${REALPATH} ${WEB_PREFIX}
.if ${WWW_LANGCODE} == "en"
WEB_PREFIX_REL= ${.CURDIR:S,^${WEB_PREFIX},,:C,/[^/]+,/..,g:S,^/..,,:S,^/,,:S,^$,.,:S,^/..,,}
.else
WEB_PREFIX_REL= ${.CURDIR:S,^${WEB_PREFIX},,:C,/[^/]+,/..,g:S,^/..,,:S,^/,,:S,^$,.,}
.endif
.if !defined(URL_RELPREFIX)
URLS_ABSOLUTE= YES
.elif !defined(URLS_ABSOLUTE)

View file

@ -1,7 +1,9 @@
# doc.xml.mk
# $FreeBSD$
XML_CATALOG_FILES= file://${DOC_PREFIX}/${LANGCODE}/share/sgml/catalog.xml \
XML_CATALOG_FILES= file://${.OBJDIR}/catalog-cwd.xml \
file://${DOC_PREFIX}/${LANGCODE}/share/sgml/catalog.xml \
file://${DOC_PREFIX}/${LANGCODE}/share/sgml/catalog.xml \
file://${DOC_PREFIX}/share/sgml/catalog.xml \
file://${DOC_PREFIX}/share/sgml/catalog-common.xml \
file://${WEB_PREFIX}/${WWW_LANGCODE}/share/sgml/catalog.xml \
@ -29,6 +31,16 @@ XML_INCLUDES+= ${F}
.endif
.endfor
XML_INCLUDES+= ${.OBJDIR}/autogen.ent ${.OBJDIR}/catalog-cwd.xml
CLEANFILES+= ${.OBJDIR}/autogen.ent ${.OBJDIR}/catalog-cwd.xml
${.OBJDIR}/autogen.ent:
${ECHO_CMD} '<!ENTITY base "${WEB_PREFIX_REL}">' > ${.TARGET}
${.OBJDIR}/catalog-cwd.xml: ${WEB_PREFIX}/share/sgml/catalog-cwd.xml
${INSTALL} ${.ALLSRC} ${.TARGET}
DEPENDSET.DEFAULT+= wwwstd
# DEPENDSET: transtable ......................................................
_DEPENDSET.transtable= ${XML_TRANSTABLE} ${XSL_TRANSTABLE} \
${XSL_TRANSTABLE_MASTER} ${XSL_TRANSTABLE_COMMON}