Commit 3a7ec909 authored by Nicolas Delaby's avatar Nicolas Delaby

2008-01-07 Nicolas

Add new XSL stylesheet for ERP5 OOo Templates which able to transform any CDATA section, tagged with 'TALES' in style name, into attribute tal:content

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18610 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1b6e4230
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="DTMLDocument" module="OFS.DTMLDocument"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>ERP5OOoTemplate_ooo2zpt</string> </value>
</item>
<item>
<key> <string>_vars</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>globals</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>raw</string> </key>
<value> <string encoding="cdata"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>\n
<!--\n
##############################################################################\n
#\n
# Copyright (c) 2008 Nexedi SA and Contributors. All Rights Reserved.\n
# Nicolas Delaby <nicolas@nexedi.com>\n
#\n
# WARNING: This program as such is intended to be used by professional\n
# programmers who take the whole responsability of assessing all potential\n
# consequences resulting from its eventual inadequacies and bugs\n
# End users who are looking for a ready-to-use solution with commercial\n
# garantees and support are strongly adviced to contract a Free Software\n
# Service Company\n
#\n
# This program is Free Software; you can redistribute it and/or\n
# modify it under the terms of the GNU General Public License\n
# as published by the Free Software Foundation; either version 2\n
# of the License, or (at your option) any later version.\n
#\n
# This program is distributed in the hope that it will be useful,\n
# but WITHOUT ANY WARRANTY; without even the implied warranty of\n
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
# GNU General Public License for more details.\n
#\n
# You should have received a copy of the GNU General Public License\n
# along with this program; if not, write to the Free Software\n
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
#\n
##############################################################################\n
-->\n
<xsl:stylesheet version="1.0"\n
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\n
xmlns:office="http://openoffice.org/2000/office"\n
xmlns:style="http://openoffice.org/2000/style"\n
xmlns:text="http://openoffice.org/2000/text"\n
xmlns:table="http://openoffice.org/2000/table"\n
xmlns:draw="http://openoffice.org/2000/drawing"\n
xmlns:fo="http://www.w3.org/1999/XSL/Format"\n
xmlns:xlink="http://www.w3.org/1999/xlink"\n
xmlns:number="http://openoffice.org/2000/datastyle"\n
xmlns:svg="http://www.w3.org/2000/svg"\n
xmlns:chart="http://openoffice.org/2000/chart"\n
xmlns:dr3d="http://openoffice.org/2000/dr3d"\n
xmlns:math="http://www.w3.org/1998/Math/MathML"\n
xmlns:form="http://openoffice.org/2000/form"\n
xmlns:script="http://openoffice.org/2000/script"\n
xmlns:dc="http://purl.org/dc/elements/1.1/"\n
xmlns:meta="http://openoffice.org/2000/meta"\n
xmlns:config="http://openoffice.org/2001/config"\n
xmlns:help="http://openoffice.org/2000/help"\n
xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:i18n="http://xml.zope.org/namespaces/i18n"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">\n
\n
<!--This stylesheet transform any CDATA section, tagged with TALES in style name, into attribute tal:content-->\n
\n
<xsl:template match="/">\n
<xsl:copy select=".">\n
<xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()"/>\n
</xsl:copy>\n
</xsl:template>\n
\n
<xsl:template match="*|@*|text()|processing-instruction()|comment()">\n
<xsl:copy select=".">\n
<xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()"/>\n
</xsl:copy>\n
</xsl:template>\n
\n
<xsl:template match="*[contains(@*[local-name()=\'style-name\'], \'TALES\')]">\n
<xsl:choose>\n
<xsl:when test="not(text())">\n
<xsl:copy select=".">\n
<xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()" mode="TALES"/>\n
</xsl:copy>\n
</xsl:when>\n
<xsl:otherwise>\n
<xsl:copy select=".">\n
<xsl:attribute name="tal:content">\n
<xsl:apply-templates select="text()"/>\n
</xsl:attribute>\n
<xsl:apply-templates select="*|@*|processing-instruction()|comment()" mode="TALES"/>\n
</xsl:copy>\n
</xsl:otherwise>\n
</xsl:choose>\n
</xsl:template>\n
\n
<!-- MODE TALES -->\n
\n
<xsl:template match="*|@*|text()|processing-instruction()|comment()" mode="TALES">\n
<xsl:copy select=".">\n
<xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()" mode="TALES"/>\n
</xsl:copy>\n
</xsl:template>\n
\n
<xsl:template match="*[local-name()=\'p\']" mode="TALES">\n
<xsl:copy select=".">\n
<xsl:attribute name="tal:content">\n
<xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()" mode="TALES"/>\n
</xsl:attribute>\n
</xsl:copy>\n
</xsl:template>\n
</xsl:stylesheet>\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2008-01-07 Nicolas
Add new XSL stylesheet for ERP5 OOo Templates which able to transform any CDATA section, tagged with 'TALES' in style name, into attribute tal:content
2007-11-29 yusei 2007-11-29 yusei
* Membership criteria list in Predicate_view is sorted. Please use revision 17909 or newer version of CMFCategory. * Membership criteria list in Predicate_view is sorted. Please use revision 17909 or newer version of CMFCategory.
......
661 663
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment