@Override
	public void label(String url, String outPath, String xpathExp)
	{
		if(!validFileName(url))
		{
			System.out.println("error: file in url has uncorrect postfix!");
			System.exit(-1);
		}
		
		XPathFactory xPathFactory = XPathFactory.newInstance();
		XPath xpath = xPathFactory.newXPath();
		XPathExpression expr;
		try {
			expr = xpath.compile(xpathExp);
			DOMParser parser = new DOMParser();
	        parser.setProperty("http://cyberneko.org/html/properties/default-encoding",this.encoding);
	        parser.parse(url);
	        Document doc = parser.getDocument();
	        
	        Node node = (Node) expr.evaluate(doc, XPathConstants.NODE);

	        FileWriter writer = new FileWriter(outPath);
			TransformerFactory.newInstance().newTransformer().transform(
	                new DOMSource(node), new StreamResult(writer));
			writer.close();
			
			
		} catch (XPathExpressionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SAXNotRecognizedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SAXNotSupportedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SAXException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (TransformerConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (TransformerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (TransformerFactoryConfigurationError e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

        
	}