local menu fix in pathnames

svn path=/trunk/; revision=32241
This commit is contained in:
paul 2015-10-29 15:43:28 +00:00
parent 6765915aa7
commit 41fc6afd81
2 changed files with 23 additions and 48 deletions

View File

@ -24,7 +24,7 @@ SELECT := '<localmenu.*</localmenu>'
STYLESHEET := ./tools/buildmenu.xsl
FIND := ./\(.*/\)*\(.*\)\.\([a-z][a-z]\)\.xhtml:[ \t]*\(.*\)
REPLACE := <menuitem language="\3"><dir>\1</dir><link>\2.html</link>\4</menuitem>
REPLACE := <menuitem language="\3"><dir>/\1</dir><link>\2.html</link>\4</menuitem>
sources := $(shell grep -l -R --include='*.xhtml' $(SELECT) . )
@ -32,7 +32,7 @@ sources := $(shell grep -l -R --include='*.xhtml' $(SELECT) . )
localmenus: localmenuinfo.en.xml
localmenuinfo.en.xml: $(sources)
localmenuinfo.en.xml: $(sources) $(STYLESHEET)
echo \<localmenuset\> > $(HELPERFILE)
grep -R --include='*.xhtml' $(SELECT) .| sed -e 's,$(FIND),$(REPLACE),' >> $(HELPERFILE)
echo \</localmenuset\> >> $(HELPERFILE)

View File

@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="localmenuset">
<!-- Top level element of the local menu is "localmenuset" -->
<xsl:element name="localmenuset">
@ -16,32 +14,22 @@
<xsl:element name="menu">
<xsl:attribute name="dir">
<xsl:value-of select="dir" />
</xsl:attribute>
<xsl:attribute name="dir"><xsl:value-of select="dir" /></xsl:attribute>
<xsl:attribute name="set">
<xsl:choose>
<xsl:when test="localmenu/@set">
<xsl:value-of select="localmenu/@set" />
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose><xsl:when test="localmenu/@set">
<xsl:value-of select="localmenu/@set" />
</xsl:when><xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise></xsl:choose>
</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="localmenu/@id" />
</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="localmenu/@id" /></xsl:attribute>
<xsl:attribute name="style">
<xsl:choose>
<xsl:when test="localmenu/@style">
<xsl:value-of select="localmenu/@style" />
</xsl:when>
<xsl:otherwise>
<xsl:text>default</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose><xsl:when test="localmenu/@style">
<xsl:value-of select="localmenu/@style" />
</xsl:when><xsl:otherwise>
<xsl:text>default</xsl:text>
</xsl:otherwise></xsl:choose>
</xsl:attribute>
<xsl:value-of select="link" />
@ -52,41 +40,28 @@
<!-- In "translate" each available tranlation is described in "lang_part" -->
<xsl:element name="translate">
<xsl:for-each select="/localmenuset/menuitem">
<xsl:element name="lang_part">
<xsl:attribute name="dir">
<xsl:value-of select="dir" />
</xsl:attribute>
<xsl:attribute name="dir"><xsl:value-of select="dir" /></xsl:attribute>
<xsl:attribute name="set">
<xsl:choose>
<xsl:when test="localmenu/@set">
<xsl:value-of select="localmenu/@set" />
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose><xsl:when test="localmenu/@set">
<xsl:value-of select="localmenu/@set" />
</xsl:when><xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise></xsl:choose>
</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="localmenu/@id" />
</xsl:attribute>
<xsl:attribute name="language">
<xsl:value-of select="@language" />
</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="localmenu/@id" /></xsl:attribute>
<xsl:attribute name="language"><xsl:value-of select="@language" /></xsl:attribute>
<xsl:value-of select="localmenu" />
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>