throws FileNotFoundException, IOException, DOMException, TransformerException,
TransformerConfigurationException, MalformedURLException {
Transformer oTransformer;
StreamResult oStreamResult;
StreamSource oStreamSrcXML;
StringWriter oStrWritter;
File oXMLFile,oXSLFile;
InputStream oXMLStream = null;
String sTransformed;
StringBuffer oPostTransform;
String sKey;
String sMedia;
String sXSLFile;
Object sVal;
Page oCurrentPage;
int iCloseHead, iOpenBody, iCloseBody;
int iReaded;
char CharBuffer[] = new char[8192];
String sCharBuffer;
long lElapsed = 0;
final String sSep = System.getProperty("file.separator");
if (DebugFile.trace) {
lElapsed = System.currentTimeMillis();
DebugFile.writeln("Begin Pageset.buildPageForEdit(" + sBasePath + "," + sOutputPath + "," + sCtrlPath + "," + sMenuPath + ")");
DebugFile.incIdent();
}
FileSystem oFS = new FileSystem();
if (!sBasePath.endsWith(sSep)) sBasePath += sSep;
String sWebServer = oEnvironmentProps.getProperty("webserver", "");
if (DebugFile.trace && sWebServer.length()==0) DebugFile.writeln("WARNING: webserver property not set at EnvironmentProperties");
if (!sWebServer.endsWith("/")) sWebServer+="/";
// Posicionarse en el nodo de contenedores
Node oContainers = oMSite.seekChildByName(oMSite.getRootNode().getFirstChild(), "containers");
if (oContainers==null) {
if (DebugFile.trace)
DebugFile.writeln("ERROR: <containers> node not found.");
throw new DOMException(DOMException.NOT_FOUND_ERR, "<containers> node not found");
}
// Cagar el stream de datos XML una sola vez
if (DebugFile.trace)
DebugFile.writeln("new FileInputStream(" + (sURI.startsWith("file://") ? sURI.substring(7) : sURI) + ")");
// Para cada contenedor (página) realizar la transformación XSLT
oCurrentPage = this.page(sPageGUID);
oXMLFile = new File (sURI.startsWith("file://") ? sURI.substring(7) : sURI);
if (!oXMLFile.exists()) {
if (DebugFile.trace) DebugFile.decIdent();
throw new FileNotFoundException("PageSet.buildPageForEdit() File not found "+sURI);
}
oXMLStream = new FileInputStream(oXMLFile);
oStreamSrcXML = new StreamSource(oXMLStream);
// Asignar cada stream de salida a su stream temporal
oStrWritter = new StringWriter();
oStreamResult = new StreamResult(oStrWritter);