Skip to content
Snippets Groups Projects
Commit 98eba9e700ed authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

backport ocy's branch

No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="*">
<xsl:param name="indent" select="''"/>
<xsl:call-template name="write-element">
<xsl:with-param name="indent" select="$indent"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="ecriture">
<xsl:param name="indent" select="''"/>
<xsl:call-template name="write-element">
<xsl:with-param name="indent" select="$indent"/>
</xsl:call-template>
<xsl:if test="following-sibling::ecriture">
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="@*">
<xsl:text> </xsl:text>
<xsl:value-of select="name()"/>
<xsl:text>="</xsl:text>
<xsl:value-of select="."/>
<xsl:text>"</xsl:text>
</xsl:template>
<xsl:template match="text()">
<xsl:if test="normalize-space(.)">
<xsl:value-of select="."/>
</xsl:if>
</xsl:template>
<xsl:template name="write-element">
<xsl:param name="indent" select="''"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="$indent"/>
<xsl:text>&lt;</xsl:text>
<xsl:value-of select="name()"/>
<xsl:apply-templates select="@*">
<xsl:sort select="name()"/>
</xsl:apply-templates>
<xsl:if test="not(*|text())">
<xsl:text>/</xsl:text>
</xsl:if>
<xsl:text>></xsl:text>
<xsl:if test="*|text()">
<xsl:apply-templates select="*|text()">
<xsl:with-param name="indent" select="concat($indent,' ')"/>
</xsl:apply-templates>
<xsl:if test="*">
<xsl:text>
</xsl:text>
<xsl:value-of select="$indent"/>
</xsl:if>
<xsl:text>&lt;/</xsl:text>
<xsl:value-of select="name()"/>
<xsl:text>></xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
......@@ -25,6 +25,8 @@
"""display a list of entities by calling their <item_vid> view
"""
self.w(u'<?xml version="1.0" encoding="%s"?>\n' % self._cw.encoding)
self.w(u'<?xml-stylesheet href="%saccounting-entries.xsl" '
u'rel="stylesheet" type="text/xsl"?>\n' % self._cw.datadir_url)
self.w(u'<ecritures>\n')
for i in xrange(self.cw_rset.rowcount):
self.cell_call(i, 0)
......@@ -49,6 +51,8 @@
"""display a list of entities by calling their <item_vid> view
"""
self.w(u'<?xml version="1.0" encoding="%s"?>\n' % self._cw.encoding)
self.w(u'<?xml-stylesheet href="%saccounting-entries.xsl" '
u'rel="stylesheet" type="text/xsl"?>\n' % self._cw.datadir_url)
self.w(u'<ecritures>\n')
for i in xrange(self.cw_rset.rowcount):
self.cell_call(i, 0)
......
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