You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/04/09 23:22:18 UTC

DO NOT REPLY [Bug 7894] New: - document function and uri's beginning with slash

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7894>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7894

document function and uri's beginning with slash

           Summary: document function and uri's beginning with slash
           Product: XalanJ2
           Version: CurrentCVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: egami@dimensional.com


If the uri specified in the document() function begins with '/', it is taken to 
be an absolute uri when it shouldn't.  For example, when the base uri is 
http://someserver/path/file.xsl, the function document
('/otherpath/otherfile.xsl') should look for the 
uri "http://someserver/otherpath/otherfile.xsl" but instead it looks 
for "/otherpath/otherfile.xsl" which is taken to be a file on the local system.

It looks like the issue is in org.apache.xalan.xsltc.dom.LoadDocument.  Instead 
of checking to see if the uri starts with a slash (other checks seem valid) and 
then just concating the base and the uri, it should skip the check.  Also, 
simply concating the results will not yield the correct results, so perhaps 
creating a java.net.URL from the base, and then using this to construct another 
URL for the result would be the easiest:
    java.net.URL url1 = new java.net.URL(base);
    java.net.URL url2 = new java.net.URL(url1, uri);
    uri = url2.toString()