order: Generate catalogue of items and prices.
This commit is contained in:
parent
4b5ab52612
commit
3e9d56071e
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,6 +9,7 @@ news/????/index.xsl
|
||||
news/*/.*.??.xml
|
||||
global/data/texts/.texts.??.xml
|
||||
global/data/topbanner/.topbanner.??.xml
|
||||
order/catalogue.xml
|
||||
.default.xsl
|
||||
.localmenu.*.xml
|
||||
.*.xmllist
|
||||
|
3
Makefile
3
Makefile
@ -155,3 +155,6 @@ localmenus: $(SUBDIRS)
|
||||
all: xmllists
|
||||
xmllists: $(SUBDIRS)
|
||||
tools/update_xmllists.sh
|
||||
|
||||
order/catalogue.xml: order/catalogue.xsl $(wildcard order/*/item*.xml)
|
||||
(echo -e "<?xml version=\"1.0\"?>\n<catalogue>"; xsltproc $^; echo "</catalogue>") > $@
|
||||
|
17
order/catalogue.xsl
Normal file
17
order/catalogue.xsl
Normal file
@ -0,0 +1,17 @@
|
||||
<?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" indent="yes" omit-xml-declaration="yes" />
|
||||
<xsl:template match="/itemset">
|
||||
<xsl:for-each select="item">
|
||||
<xsl:variable name="prefix"><xsl:value-of select="@id"/></xsl:variable>
|
||||
<xsl:variable name="price"><xsl:value-of select="@price"/></xsl:variable>
|
||||
<xsl:for-each select="available">
|
||||
<xsl:element name="item">
|
||||
<xsl:attribute name="id"><xsl:value-of select="$prefix"/><xsl:text>_</xsl:text><xsl:value-of select="@size"/></xsl:attribute>
|
||||
<xsl:attribute name="price"><xsl:value-of select="$price"/></xsl:attribute>
|
||||
</xsl:element>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
Loading…
Reference in New Issue
Block a user