import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.nio.file.Files;
import java.nio.file.Path;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;

import velo.Velo;

import org.w3c.dom.Node;

/**
 * Décodeur Json.
 *
 * @author gwendal.letareau
 */
public abstract class DecoderJson {

	public static List<Velo> decoderXMLFromFile(File fichier) throws FileNotFoundException {
		
		try {
            File xmlFile = new File("chemin/vers/votre/fichier.xml");
            
            DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
            Document doc = dBuilder.parse(xmlFile);
            
            doc.getDocumentElement().normalize();
            
            System.out.println("Élément racine :" + doc.getDocumentElement().getNodeName());
            
            NodeList nodeList = doc.getElementsByTagName("votre_tag"); // Remplacez "votre_tag" par le nom du tag que vous souhaitez extraire
            
            for (int temp = 0; temp < nodeList.getLength(); temp++) {
                Node node = nodeList.item(temp);
                
                if (node.getNodeType() == Node.ELEMENT_NODE) {
                    System.out.println("\nÉlément :" + node.getNodeName());
                    System.out.println("Contenu :" + node.getTextContent());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

		
		
		
		return null;
	}
	
	public static List<Velo> decoderJsonFromString(String fichier) {
		
		
		
		return null;
	}
	
}
