}
}
private void createNode(XMLEventWriter eventWriter, String loc, String priority) throws XMLStreamException
{
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
eventWriter.add(tab);
eventWriter.add(eventFactory.createStartElement("", "", "url"));
/*
Generate the location element
*/
eventWriter.add(end);
eventWriter.add(tab);
eventWriter.add(tab);
eventWriter.add(eventFactory.createStartElement("", "", "loc"));
Characters characters = eventFactory.createCharacters(loc);
eventWriter.add(characters);
eventWriter.add(eventFactory.createEndElement("", "", "loc"));
eventWriter.add(end);
/*
Add the last modification date of this page
*/
eventWriter.add(tab);
eventWriter.add(tab);
eventWriter.add(eventFactory.createStartElement("", "", "lastmod"));
/*
We need to use the W3C date time format here
*/
characters = eventFactory.createCharacters(
new SimpleDateFormat("yyyy-MM-dd").format(new Date(Long.parseLong(BUILD_BUNDLE.getString("build.date")))));
eventWriter.add(characters);
eventWriter.add(eventFactory.createEndElement("", "", "lastmod"));
eventWriter.add(end);
/*
Add the change frequency
*/
eventWriter.add(tab);
eventWriter.add(tab);
eventWriter.add(eventFactory.createStartElement("", "", "changefreq"));
characters = eventFactory.createCharacters("daily");
eventWriter.add(characters);
eventWriter.add(eventFactory.createEndElement("", "", "changefreq"));
eventWriter.add(end);
/*
Add the priority of this page
*/
eventWriter.add(tab);
eventWriter.add(tab);
eventWriter.add(eventFactory.createStartElement("", "", "priority"));
characters = eventFactory.createCharacters(priority);
eventWriter.add(characters);
eventWriter.add(eventFactory.createEndElement("", "", "priority"));
eventWriter.add(end);
eventWriter.add(tab);
eventWriter.add(eventFactory.createEndElement("", "", "url"));
eventWriter.add(end);
}