You need a parser. While the JDK has the Documentparser, he is legacy and hitched to the Swing Apis.
My recommendation would be Jsoup
// Trate exceções no código real
File input = new File("/tmp/input.xhtml");
Document doc = Jsoup.parse(input, "UTF-8");
Elements labels = doc.select("p|inputText[label]");
// todos os inputs que possuem um label
for (Element label : labels) {
String sLabel = label.attr("label");
System.out.println("Label: " + sLabel);
}
I am assuming that you will extract the Labels directly from the Facelets code, but if you need to extract the generated html just adapt the code accordingly.
Macario, you have a source code facelets (xhtml) and want to extract certain tags, that’s it?
– Anthony Accioly
@Anthonyaccioly that there! To be more precise, I wanted to extract the tags from certain components to get their Abels and generate a properties file. Understand?
– Macario1983