Class DOMUtils
java.lang.Object
fr.opensagres.xdocreport.core.utils.DOMUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ElementgetFirstChildElementByTagName(Node parentNode, String elementName) Returns the first child element retrieved by tag name from the parent node and null otherwise.static Collection<Element>getFirstChildElementsByTagName(Node contextNode, String elementName) Returns list of the first child element retrieved by tag name from the parent node and null otherwise.static Documentload(InputStream stream) static Documentstatic voidsave(Node node, OutputStream out) static void
-
Constructor Details
-
DOMUtils
public DOMUtils()
-
-
Method Details
-
load
public static Document load(InputStream stream) throws ParserConfigurationException, SAXException, IOException -
load
public static Document load(String xml) throws ParserConfigurationException, SAXException, IOException -
save
- Throws:
TransformerException
-
save
- Throws:
TransformerException
-
getFirstChildElementByTagName
Returns the first child element retrieved by tag name from the parent node and null otherwise.- Parameters:
parentNode- parent node.elementName- element name to found.- Returns:
- the first child element
-
getFirstChildElementsByTagName
public static Collection<Element> getFirstChildElementsByTagName(Node contextNode, String elementName) Returns list of the first child element retrieved by tag name from the parent node and null otherwise.- Parameters:
parentNode- parent node.elementName- element name to found.- Returns:
- list of the first child element
-