org.omnaest.utils.xml
Class XMLHelper

java.lang.Object
  extended by org.omnaest.utils.xml.XMLHelper

public class XMLHelper
extends Object

XMLHelper for XPath or Document based helper methods.

Author:
Omnaest
See Also:
JAXBXMLHelper, XMLIteratorFactory, XMLNestedMapConverter

Nested Class Summary
static class XMLHelper.XSLTransformerConfiguration
          Configuration for an TransformerFactory
 
Constructor Summary
XMLHelper()
           
 
Method Summary
static Map<String,Object> newMapFromXML(CharSequence xmlContent)
          Facade for XMLNestedMapConverter.newMapFromXML(CharSequence)
static Node select(String xPathExpression, Node node)
          Similar to select(String, Node, ExceptionHandler)
static Node select(String xPathExpression, Node node, ExceptionHandler exceptionHandler)
          Allows to select sub Nodes by a given XPath expression
static void transform(StreamSource xslt, StreamSource xml, StreamResult result, ExceptionHandler exceptionHandler, XMLHelper.XSLTransformerConfiguration xslTransformerConfiguration)
          Uses the default TransformerFactory to transform the given xml StreamSource using the given xslt StreamSource into the StreamResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLHelper

public XMLHelper()
Method Detail

select

public static Node select(String xPathExpression,
                          Node node)
Similar to select(String, Node, ExceptionHandler)

Parameters:
xPathExpression -
node -
Returns:

select

public static Node select(String xPathExpression,
                          Node node,
                          ExceptionHandler exceptionHandler)
Allows to select sub Nodes by a given XPath expression

Parameters:
xPathExpression -
node - Node
exceptionHandler - ExceptionHandler
Returns:

newMapFromXML

public static Map<String,Object> newMapFromXML(CharSequence xmlContent)
Facade for XMLNestedMapConverter.newMapFromXML(CharSequence)

Parameters:
xmlContent -
Returns:
new nested Map

transform

public static void transform(StreamSource xslt,
                             StreamSource xml,
                             StreamResult result,
                             ExceptionHandler exceptionHandler,
                             XMLHelper.XSLTransformerConfiguration xslTransformerConfiguration)
Uses the default TransformerFactory to transform the given xml StreamSource using the given xslt StreamSource into the StreamResult

Parameters:
xslt - StreamSource
xml - StreamSource
result - StreamResult
exceptionHandler - ExceptionHandler
xslTransformerConfiguration - XMLHelper.XSLTransformerConfiguration


Copyright © 2013. All Rights Reserved.