Class XsltUtils
- java.lang.Object
-
- org.ikasan.component.converter.xml.util.XsltUtils
-
public class XsltUtils extends java.lang.ObjectThis class provides a range of static XSLT utility methods. Currently, this class has the following methods:-- serialize - This method returns string of the specified node set.
- Author:
- Ikasan Development Team
-
-
Constructor Summary
Constructors Constructor Description XsltUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringserialize(org.w3c.dom.NodeList nodeset)Returns string by serializing the specified node set.
-
-
-
Method Detail
-
serialize
public static java.lang.String serialize(org.w3c.dom.NodeList nodeset) throws javax.xml.transform.TransformerFactoryConfigurationError, javax.xml.transform.TransformerExceptionReturns string by serializing the specified node set.# ============================================= # Stylesheet for serialize() # ============================================= <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xslt" xmlns:utils="xalan://com.mizuho.cmi.london.core.shared.xalan.utils.XsltUtils" version="1.0" exclude-result-prefixes="xalan utils"> <xsl:output method="xml" encoding="UTF-8" cdata-section-elements="item" indent="yes" xalan:indent-amount="2"/> <xsl:template match="/"> <xsl:element name="root"> <xsl:for-each select="/root/data"> <xsl:element name="item"> <xsl:value-of select="utils:serialize(.)"/> </xsl:element> </xsl:for-each> </xsl:element> </xsl:template>- Parameters:
nodeset- is the node set to be serialized.- Returns:
- the string.
- Throws:
javax.xml.transform.TransformerFactoryConfigurationError- if an error creatingTransformeroccurs.javax.xml.transform.TransformerException- if an error while serializingnodesetoccurs.
-
-