import org.apache.xml.serialize.XMLSerializer;
import org.w3c.dom.Document;
import org.w3c.tidy.Tidy;
import org.apache.xml.serialize.XMLSerializer;
import org.w3c.dom.Document;
import org.w3c.tidy.Tidy;
-import org.wamblee.io.FileResource;
-import org.wamblee.xml.DOMUtility;
-import org.wamblee.xml.XSLT;
+import org.wamblee.xml.DomUtils;
+import org.wamblee.xml.XslTransformer;
* @param aXslt
* XSLT used to convert the response.
*/
protected AbstractPageRequest(int aMaxTries, int aMaxDelay,
* @param aXslt
* XSLT used to convert the response.
*/
protected AbstractPageRequest(int aMaxTries, int aMaxDelay,
*/
protected Document executeMethod(HttpClient aClient, HttpMethod aMethod)
throws IOException, TransformerException {
*/
protected Document executeMethod(HttpClient aClient, HttpMethod aMethod)
throws IOException, TransformerException {
try {
aMethod = executeWithRedirects(aClient, aMethod);
byte[] xhtmlData = getXhtml(aMethod);
try {
aMethod = executeWithRedirects(aClient, aMethod);
byte[] xhtmlData = getXhtml(aMethod);
-
- Document transformed = new XSLT().transform(xhtmlData,
- new FileResource(new File(_xslt)));
+
+ Document transformed = _transformer.transform(xhtmlData,
+ _transformer.resolve(_xslt));
ByteArrayOutputStream os = new ByteArrayOutputStream();
Transformer transformer = TransformerFactory.newInstance()
.newTransformer();
ByteArrayOutputStream os = new ByteArrayOutputStream();
Transformer transformer = TransformerFactory.newInstance()
.newTransformer();
LOG.debug("Transformed result is \n" + os.toString());
return transformed;
} catch (TransformerConfigurationException e) {
LOG.debug("Transformed result is \n" + os.toString());
return transformed;
} catch (TransformerConfigurationException e) {
// in a system wide way.
ByteArrayOutputStream os = new ByteArrayOutputStream();
Document w3cDoc = tidy.parseDOM(aMethod.getResponseBodyAsStream(), os);
// in a system wide way.
ByteArrayOutputStream os = new ByteArrayOutputStream();
Document w3cDoc = tidy.parseDOM(aMethod.getResponseBodyAsStream(), os);
LOG.debug("Content of response is \n" + os.toString());
ByteArrayOutputStream xhtml = new ByteArrayOutputStream();
LOG.debug("Content of response is \n" + os.toString());
ByteArrayOutputStream xhtml = new ByteArrayOutputStream();