mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -55,8 +55,6 @@ public abstract class BaseTemplateRenderingEngine extends AbstractRenderingEngin
|
|||||||
{
|
{
|
||||||
private static final Log log = LogFactory.getLog(BaseTemplateRenderingEngine.class);
|
private static final Log log = LogFactory.getLog(BaseTemplateRenderingEngine.class);
|
||||||
|
|
||||||
public static final String NAME = "xsltRenderingEngine";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This optional {@link Map}<{@link String}, {@link Serializable}> parameter
|
* This optional {@link Map}<{@link String}, {@link Serializable}> parameter
|
||||||
* can be used to pass additional arguments to the templating engine when processing a
|
* can be used to pass additional arguments to the templating engine when processing a
|
||||||
|
@@ -1,26 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This file is part of Alfresco
|
||||||
* modify it under the terms of the GNU General Public License
|
*
|
||||||
* as published by the Free Software Foundation; either version 2
|
* Alfresco is free software: you can redistribute it and/or modify
|
||||||
* of the License, or (at your option) any later version.
|
* 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
|
||||||
* This program is distributed in the hope that it will be useful,
|
* (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
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* 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"
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.alfresco.repo.rendition.executer;
|
package org.alfresco.repo.rendition.executer;
|
||||||
|
@@ -52,6 +52,8 @@ import org.xml.sax.SAXException;
|
|||||||
*/
|
*/
|
||||||
public class XSLTRenderingEngine extends BaseTemplateRenderingEngine
|
public class XSLTRenderingEngine extends BaseTemplateRenderingEngine
|
||||||
{
|
{
|
||||||
|
public static final String NAME = "xsltRenderingEngine";
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(XSLTRenderingEngine.class);
|
private static final Log log = LogFactory.getLog(XSLTRenderingEngine.class);
|
||||||
|
|
||||||
private XSLTFunctions xsltFunctions;
|
private XSLTFunctions xsltFunctions;
|
||||||
@@ -138,7 +140,7 @@ public class XSLTRenderingEngine extends BaseTemplateRenderingEngine
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
log.warn("Received an exception from parseXMLDocument()", ex);
|
||||||
}
|
}
|
||||||
return d == null ? null : d.getDocumentElement();
|
return d == null ? null : d.getDocumentElement();
|
||||||
}
|
}
|
||||||
|
@@ -304,8 +304,7 @@ public class XSLTRenderingEngineTest extends BaseAlfrescoSpringTest
|
|||||||
"<xsl:preserve-space elements=\"*\"/>" +
|
"<xsl:preserve-space elements=\"*\"/>" +
|
||||||
|
|
||||||
"<xsl:variable name=\"all_docs\" select=\"alf:parseXMLDocuments('cm:content', 'path/to/xml/files')\"/>" +
|
"<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:template match=\"/\">" + "<xsl:for-each select=\"$all_docs//food\">"
|
||||||
+ "<xsl:value-of select=\"name\"/>" + "</xsl:for-each>" + "</xsl:for-each>" + "</xsl:template>" + "</xsl:stylesheet>";
|
+ "<xsl:value-of select=\"name\"/>" + "</xsl:for-each>" + "</xsl:template>" + "</xsl:stylesheet>";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user