Skip to content
Snippets Groups Projects
Commit f57273e2 authored by Frank Steinberg's avatar Frank Steinberg
Browse files

Track date, author and source in XML files.

parent 448c86a3
No related branches found
No related tags found
No related merge requests found
......@@ -84,19 +84,19 @@ f.write('<styleguide xmlns="http://heimbrauconvention.de/bjcp-styleguide/2015">\
f.write('<!-- snippet supplied by %s from %s at %s -->\n' % (user, addr, time))
if level == 1:
f.write(' <category id="%s">\n' % id)
f.write(' <%s>%s</%s>\n' % (elem, data, elem))
f.write(' <%s date="%s" author="%s" source="%s">%s</%s>\n' % (elem, time, user, addr, data, elem))
f.write(' </category>\n')
elif level == 2:
f.write(' <category id="%s">\n' % id1)
f.write(' <subcategory id="%s">\n' % id)
f.write(' <%s>%s</%s>\n' % (elem, data, elem))
f.write(' <%s date="%s" author="%s" source="%s">%s</%s>\n' % (elem, time, user, addr, data, elem))
f.write(' </subcategory>\n')
f.write(' </category>\n')
elif level == 3:
f.write(' <category id="%s">\n' % id1)
f.write(' <subcategory id="%s">\n' % id2)
f.write(' <subcategory id="%s">\n' % id)
f.write(' <%s>%s</%s>\n' % (elem, data, elem))
f.write(' <%s date="%s" author="%s" source="%s">%s</%s>\n' % (elem, time, user, addr, data, elem))
f.write(' </subcategory>\n')
f.write(' </subcategory>\n')
f.write(' </category>\n')
......
......@@ -42,7 +42,7 @@
<xsd:element name="category">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string" minOccurs="0"/>
<xsd:element name="name" type="Text" minOccurs="0"/>
<xsd:element name="description" type="Description" minOccurs="0"/>
<xsd:element name="entry-instructions" type="Text" minOccurs="0"/>
<xsd:element ref="subcategory" minOccurs="0" maxOccurs="unbounded"/>
......@@ -60,7 +60,7 @@
<xsd:element name="subcategory">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string" minOccurs="0"/>
<xsd:element name="name" type="Text" minOccurs="0"/>
<xsd:element name="description" type="Description" minOccurs="0"/>
<xsd:element name="overall-impression" type="Text" minOccurs="0"/>
<xsd:element name="aroma" type="Text" minOccurs="0"/>
......@@ -105,6 +105,9 @@
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="p"/>
</xsd:choice>
<xsd:attribute name="date" type="xsd:string"/>
<xsd:attribute name="author" type="xsd:string"/>
<xsd:attribute name="source" type="xsd:string"/>
</xsd:complexType>
<xsd:element name="tags">
......@@ -309,6 +312,9 @@
<xsd:element name="u" type="xsd:string"/>
<xsd:element ref="a"/>
</xsd:choice>
<xsd:attribute name="date" type="xsd:string"/>
<xsd:attribute name="author" type="xsd:string"/>
<xsd:attribute name="source" type="xsd:string"/>
</xsd:complexType>
......
......@@ -58,9 +58,9 @@
<xsl:value-of select="local-name(.)"/>
</xsl:variable>
<xsl:element name="{$name}">
<xsl:apply-templates select="@*"/>
<xsl:choose>
<xsl:when test="(../@id = $snippetid) and ($snippetnode/bjcp:*[local-name(.)=$name])">
<xsl:apply-templates select="$snippetnode/bjcp:*[local-name(.)=$name]/@*"/>
<xsl:apply-templates select="$snippetnode/bjcp:*[local-name(.)=$name]/bjcp:* | $snippetnode/bjcp:*[local-name(.)=$name]/text()"/>
</xsl:when>
<xsl:otherwise>
......
......@@ -149,9 +149,9 @@
<xsl:value-of select="local-name(.)"/>
</xsl:variable>
<xsl:element name="{local-name(.)}">
<xsl:apply-templates select="@*"/>
<xsl:choose>
<xsl:when test="dyn:evaluate($p)">
<xsl:apply-templates select="dyn:evaluate($p)/@*"/>
<xsl:apply-templates select="dyn:evaluate($p)/bjcp:* | dyn:evaluate($p)/text()"/>
</xsl:when>
<xsl:otherwise>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment