Trong đoạn mã sau:java.io.IOException: Máy chủ trả lại mã phản hồi HTTP: 503 cho URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
private Document transformDoc(Source source) throws TransformerException, IOException {
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer =
factory.newTransformer(new StreamSource(xsltResource.getInputStream()));
JDOMResult result = new JDOMResult();
transformer.transform(source, result);
return result.getDocument();
}
tôi nhận được ngoại lệ này:
java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
các XHTML tôi dịch qua qua xsl là:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>Terms and Conditions</title>
</head>
<body>
<div>Test Content</div>
</body>
</html>
làm thế nào để ngăn chặn sự biến Xalan từ điện thoại cho hom e?
Bạn cần những điều sau đây để có được nó đúng 100%, nhưng điều đó liên kết mailing list là hữu ích nhất! SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware (true); spf.setValidating (false); // Tắt xác thực spf.setFeature ("http://apache.org/xml/features/nonvalidating/load-external-dtd", sai); XMLReader rdr = spf.newSAXParser(). GetXMLReader(); –