L&S update

I lumped fixes related from 
http://lists.w3.org/Archives/Public/www-dom-ts/2003Dec/0029.html and 
http://lists.w3.org/Archives/Public/www-dom-ts/2003Dec/0030.html as bug 
447 (http://www.w3.org/Bugs/Public/show_bug.cgi?id=447).  All of 
Xerces-J's current test failures appear to be legitimate implementation 
problems.

The bug report has blow-by-blow details of the changes. 

Of particular interest is a change in the base URL for http related 
tests.  The default base is now http://localhost:8080/webdav/ which can 
be overriden by specifying 
-Dorg.w3c.domts.httpbase=http://www.example.com/domts/ or similar.  This 
(hopefully) simplifies configuration of the supporting server.  All that 
should be necessary to use Tomcat should be to change the webdav folder 
to read-write in the web.xml file and to copy testpdf.pdf to the webdav 
directory.  DOMBuilderTest5 now checks that testpdf.pdf can be 
successfully parsed before specifying supported-doctypes-only, so 
testpdf.pdf has to be a valid XML file for the test to pass.  I've added 
testpdf.pdf (a duplicate of test0.xml) to the ls/files directory.

There were a few minor changes to the test framework, 
<createTempHttpURI/> and <createTempFileURI/> were replaced by 
<createTempURI scheme="file|http"/> and a scheme attribute was added to 
<getResourceURI/>.

Elana had complained about the file: URI's generated by 
File.toURI().toString() causing SystemId1 to fail.  The current Xerces-J 
CVS attempts the following around line 687 in 
org.apache.xml.serialize.DOMSerializerImpl

FileOutputStream fileOut = new FileOutputStream(new File(uri));

Where uri would be the value of LSOutput.getSystemId().

This code does not check the scheme of the URI before attempting to 
create a File object, so http: uri's should be expected to throw an 
exception and I see nothing in the JDK documentation that would lead me 
to believe that I should be able to pass a string containing a file: URL 
to new File().  If I replaced that line with the following JDK 1.4 
specific code:

URL parsedURL = new URL(uri);
if ("file".equals(parsedURL.getProtocol()) {
    fileOut = new FileOutputStream(new File(new URI(uri)));
} else {
    throw new Exception("unsupported scheme");
}

Xerces would then pass SystemId1.  If there are legitimate changes to 
make the generated URL's compatible with your file: URL parsing code 
that might be used by a non-public implementation, please provide a 
patch for org.w3c.domts.DOMTest.

SystemId2 would require filling in the else clause with something 
appropriate for HTTP URL's.

Received on Tuesday, 30 December 2003 02:20:18 UTC