Here you can find the source of getFirstImageTransformElement(final Document doc)
Parameter | Description |
---|---|
doc | the section XML Document |
public static Element getFirstImageTransformElement(final Document doc)
//package com.java2s; //License from project: GNU General Public License import org.w3c.dom.*; public class Main { /**/* ww w. jav a 2 s .c o m*/ * Finds the first Transform Element with an Image child node. * @param doc the section XML Document * @return the first Transform Element with an Image child node. */ public static Element getFirstImageTransformElement(final Document doc) { final NodeList transforms = doc.getElementsByTagName("Transform"); for (int i = 0; i < transforms.getLength(); ++i) { final Element transform = (Element) transforms.item(i); final NodeList children = transform.getChildNodes(); for (int j = 0; j < children.getLength(); ++j) { if (children.item(j).getNodeName().equals("Image")) { return transform; } } } return null; } }