/** Read File **/
try{
rawXML = readWholeFile(source);
} catch (Exception ex){
throw new PageInitialisationException("Error while reading '" + source.getName() + "': " + ex.getMessage());
}
/** Replace Servervariables **/
try{
rawXML = sv.replaceAll(rawXML,false);
} catch (Exception ex){
throw new PageInitialisationException("Error while replacing ServerVariables in '" + source.getName() + "': " + ex.getMessage());
}
/** Parse XML File **/
try{
doc = readXML(rawXML);
} catch (Exception ex){
throw new PageInitialisationException("Error while parsing XML from '" + source.getName() + "': " + ex.getMessage());
}
//Replace sparql queries with xml-results
try{
if(model!=null)
replaceSparqlQueries(doc.getDocumentElement(), model);
} catch (Exception ex){
throw new PageInitialisationException("Error while replacing SPARQL-Queries in '" + source.getName() + "': " + ex.getMessage());
}
String ret = null;
//Replace sparql queries with xml-results
try{
ret = serializeXML(doc);
} catch (Exception ex){
throw new PageInitialisationException("Error while re-serialising parsed xml after inserting Serverparameters ans Sparql-Queries from '" + source.getName() + "': " + ex.getMessage());
}
return ret;
}