A few minor corrections to XSLT rendering engine code discovered while writing the related wiki page

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19685 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Brian Remmington
2010-03-31 08:19:30 +00:00
parent dd47d11ea7
commit 4f9f63ac01
4 changed files with 17 additions and 24 deletions

View File

@@ -55,8 +55,6 @@ public abstract class BaseTemplateRenderingEngine extends AbstractRenderingEngin
{
private static final Log log = LogFactory.getLog(BaseTemplateRenderingEngine.class);
public static final String NAME = "xsltRenderingEngine";
/**
* This optional {@link Map}<{@link String}, {@link Serializable}> parameter
* can be used to pass additional arguments to the templating engine when processing a

View File

@@ -1,26 +1,20 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have received a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.rendition.executer;

View File

@@ -52,6 +52,8 @@ import org.xml.sax.SAXException;
*/
public class XSLTRenderingEngine extends BaseTemplateRenderingEngine
{
public static final String NAME = "xsltRenderingEngine";
private static final Log log = LogFactory.getLog(XSLTRenderingEngine.class);
private XSLTFunctions xsltFunctions;
@@ -138,7 +140,7 @@ public class XSLTRenderingEngine extends BaseTemplateRenderingEngine
}
catch (Exception ex)
{
log.warn("Received an exception from parseXMLDocument()", ex);
}
return d == null ? null : d.getDocumentElement();
}

View File

@@ -304,8 +304,7 @@ public class XSLTRenderingEngineTest extends BaseAlfrescoSpringTest
"<xsl:preserve-space elements=\"*\"/>" +
"<xsl:variable name=\"all_docs\" select=\"alf:parseXMLDocuments('cm:content', 'path/to/xml/files')\"/>" +
"<xsl:template match=\"/\">" + "<xsl:for-each select=\"$all_docs\">" + "<xsl:for-each select=\"food\">"
+ "<xsl:value-of select=\"name\"/>" + "</xsl:for-each>" + "</xsl:for-each>" + "</xsl:template>" + "</xsl:stylesheet>";
"<xsl:template match=\"/\">" + "<xsl:for-each select=\"$all_docs//food\">"
+ "<xsl:value-of select=\"name\"/>" + "</xsl:for-each>" + "</xsl:template>" + "</xsl:stylesheet>";
}