Closed Bug 306439 Opened 19 years ago Closed 19 years ago

document('') not handled properly in XSLT, causes hang when loading via http

Categories

(Core :: XSLT, defect)

defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 205778

People

(Reporter: camillo.lugaresi, Assigned: peterv)

References

()

Details

(Keywords: hang)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

The test stylesheet uses "document('')" in an XPath expression to access nodes
inside the stylesheet itself. This is a common technique also used in XSLT
implementations of EXSLT functions (eg
http://www.exslt.org/date/functions/month-name/date.month-name.template.xsl).
It works fine in Firefox if the XML document is loaded from the filesystem
(file: url). However, when loading from a web server (http: url), Firefox hangs.

Reproducible: Always

Steps to Reproduce:
1. load the xml test case in Firefox from a web server (not from  the file system)

Actual Results:  
Firefox (1.0.6) hanged. I also tried with Camino (0.8.4, 0.9.2a, nightly) and it
also hanged.

Expected Results:  
It should display a web page with two paragraphs, the first containing the text
"test.xml" (loaded from the xml file), the second containing the text "test.xsl"
(loaded from the xsl stylesheet using document('')). This is what happens when
the test xml is loaded from the file system, but not when it is loaded from a
web server.

The hang might be related to bug 226425, which describes a hang or crash when
document() is used to load a missing document (404). However, this is NOT
necessarily the same bug: the problem here seems to be that using document('')
does not load the stylesheet itself as it should; if what happens is that
Firefox does not find the file and crashes, as in bug 226425, that is a
consequence of this bug, not the same problem.

The use of document('') to refer to the root node of the XSLT stylesheet being
processed is described in http://www.w3.org/TR/xslt#document
I attached the test case so that it will be available in the event that the
online test goes offline (not my server). To test, put test.xml and test.xsl on
a web server and load test.xml from the server. If you load test.xml from the
local file system, it will render properly without hanging.
Assignee: nobody → peterv
Component: General → XSLT
Keywords: hang
OS: MacOS X → All
Product: Firefox → Core
QA Contact: general → keith
Hardware: Macintosh → All
Version: unspecified → Trunk
Related to bug 279869 -> bug 205778?

*** This bug has been marked as a duplicate of 205778 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: