I am getting the following few lines in the output when transformation is done.
HTTP/1.1 200 OK
Content-Length: 0
Date: Sat, 22 Sep 2001 01:35:02 GMT
Server: Apache Tomcat/4.0-rc2 (HTTP/1.1 Connector)
This happens for tomcat 4.0-rc2. The dtd for this xml file is at
"http://sardinia:8080/JAXPREP/publishers.dtd"
I am including some code for your reference. I am also attaching the output file
generated.
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(true);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
Document document = docBuilder.parse(new File( "publish2.xml"));
DOMSource domSource= new DOMSource(document);
Transformer transformer = tfactory.newTransformer();
transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC ,
"-//mkrishna mohan//DTD//music pub//EN/");
transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM ,
"http://sardinia:8080/publishers.dtd");
transformer.setOutputProperty(OutputKeys.INDENT , "yes");
FileOutputStream fos = new FileOutputStream("doctype.out");
transformer.transform(domSource, new StreamResult(fos));
============================
To reproduce,
Use the following URL: "http://sardinia:8080/JAXPREP/familytree.dtd" and read from the input stream to get response headers instead of an EOF. The "publishers.dtd" version works, however. Using a host of "skyblue" also works because the webserver is an older version of Tomcat.
###@###.### 2001-09-27
HTTP/1.1 200 OK
Content-Length: 0
Date: Sat, 22 Sep 2001 01:35:02 GMT
Server: Apache Tomcat/4.0-rc2 (HTTP/1.1 Connector)
This happens for tomcat 4.0-rc2. The dtd for this xml file is at
"http://sardinia:8080/JAXPREP/publishers.dtd"
I am including some code for your reference. I am also attaching the output file
generated.
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(true);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
Document document = docBuilder.parse(new File( "publish2.xml"));
DOMSource domSource= new DOMSource(document);
Transformer transformer = tfactory.newTransformer();
transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC ,
"-//mkrishna mohan//DTD//music pub//EN/");
transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM ,
"http://sardinia:8080/publishers.dtd");
transformer.setOutputProperty(OutputKeys.INDENT , "yes");
FileOutputStream fos = new FileOutputStream("doctype.out");
transformer.transform(domSource, new StreamResult(fos));
============================
To reproduce,
Use the following URL: "http://sardinia:8080/JAXPREP/familytree.dtd" and read from the input stream to get response headers instead of an EOF. The "publishers.dtd" version works, however. Using a host of "skyblue" also works because the webserver is an older version of Tomcat.
###@###.### 2001-09-27
- duplicates
-
JDK-4507412 HttpURLConnection Keep-Alive fails for requests that return content-length 0
-
- Closed
-