Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.openfuxml.addon.wiki.media.chart.factory;
 
 import  org.jdom2.Document;
 import  org.jdom2.Element;
 import  org.jdom2.JDOMException;
 import  org.jdom2.xpath.XPath;
 import  org.slf4j.Logger;
 import  org.slf4j.LoggerFactory;
 
public class AbstractChartFactory
	final static Logger logger = LoggerFactory.getLogger(AbstractChartFactory.class);
	protected double getChartValue(String xpString type, Document doc)
	{
		double value=0;
		try
		{
			XPath xPath = XPath.newInstance(xp+"[@type='"+type+"']");
			Element element = (Element)xPath.selectSingleNode(doc);
			value = new Double(element.getTextTrim());
		}
		catch (JDOMException e) {.error("",e);}
		return value;
	}
New to GrepCode? Check out our FAQ X