List of usage examples for javax.xml.xpath XPath evaluate
public String evaluate(String expression, InputSource source) throws XPathExpressionException;
From source file:org.apache.pdfbox.pdmodel.fdf.FDFAnnotationPolygon.java
private void initVertices(Element element) throws IOException, NumberFormatException { XPath xpath = XPathFactory.newInstance().newXPath(); try {/*from ww w. j a v a 2 s.c o m*/ String vertices = xpath.evaluate("vertices", element); if (vertices == null || vertices.isEmpty()) { throw new IOException("Error: missing element 'vertices'"); } String[] verticesValues = vertices.split(","); float[] values = new float[verticesValues.length]; for (int i = 0; i < verticesValues.length; i++) { values[i] = Float.parseFloat(verticesValues[i]); } setVertices(values); } catch (XPathExpressionException e) { LOG.debug("Error while evaluating XPath expression for polygon vertices"); } }