Closed Bug 364525 Opened 19 years ago Closed 15 years ago

Summary of XML+XSLT page uses XSLTed content, not the XML

Categories

(Firefox Graveyard :: Microsummaries, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: pts+bmo, Unassigned)

References

()

Details

(Whiteboard: [microsummaries-feature-removal])

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1 A microsummary of an XML page with an XSLT stylesheet "acts on" the transformed page rather than the XML document that it's pointing to (i.e. in the microsummary's <transform>, XPath expressions match nodes generated by the stylesheet). This isn't what I expected, and I think it makes more sense for the microsummary to summarize the untransformed XML. The stylesheet isn't likely to change, and anyway, it shouldn't add any data worthy of being summarized to the original document. It's just a stylesheet, after all. This would also mean that the stylesheet wouldn't have to be downloaded, parsed, and applied, XPath expressions in the microsummary would be simpler, and the microsummary wouldn't have to change if the site style changes (it would have to change only if the XML file's format changes). Reproducible: Always Steps to Reproduce: 1. Go to my testcase URL. 2. Install the ms-expected.xml generator. 3. Try bookmarking sample-stuff.xml - notice that the microsummary is wrong. 4. Try bookmarking sample-stuff-ssf.xml - notice that it works. 5. Install the ms-works.xml generator. (Feel free to uninstall ms-expected.xml) 6. Try bookmarking sample-stuff.xml - notice that this works. 7. Try bookmarking sample-stuff-ssf.xml - notice that it doesn't work. Actual Results: sample-stuff.xml works with the ms-works.xml generator and not the ms-expected generator. Removing the stylesheet (sample-stuff-ssf.xml) breaks ms-works.xml, but not ms-expected.xml. Expected Results: ms-expected.xml should properly summarize sample-stuff.xml, sample-stuff-ssf.xml, and any sample-stuff.xml with any stylesheet. ms-works.xml should work on an HTML page, but should not work on either sample-stuff.xml. Also tested in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 GranParadiso/3.0a1 ID:2006120408 [cairo] with the same result. P.S. I'm not sure whether this is a minor bug or an enhancement - feel free to change it.
Thanks for the report and the detailed test case! I can reproduce this problem. Note that it only happens when you bookmark the page while the page is loaded into a tab. If you subsequently unload the page and then reload the live title via the "Reload Live Title" option on the bookmark's context menu, the live title updates to the correct value. This is happening because the microsummary service generates the microsummary against the transformed page when the page is loaded into a tab but the untransformed page downloaded via XMLHttpRequest (which doesn't apply XSLT stylesheets) when the page is not loaded into a tab. Since microsummary generators treat web pages as sources of data, perhaps the correct behavior is for such generators to operate on the untransformed page (except if bug 366746 is fixed, in which case they should operate on pages transformed by their transformational but not presentational stylesheets). Unfortunately, once Gecko transforms a page, its original XML is no longer available, so the microsummary service cannot access it if the user decides to bookmark the page. And fixing this would be hard, not least of all because this behavior serves the important goal of minimizing memory footprint. But it should be relatively easy for Gecko to identify pages that have been transformed with XSLT stylesheets so that the microsummary service can reload the original XML (just as View Source reloads the original source) when the user decides to bookmark such a page. I have filed bug 366749 on this functionality. Nevertheless, it's not actually clear to me that this would be the correct behavior. It may make sense for developer-built generators, but user-built generators (f.e. those created by a feature that allows users to point at some content on a page and tell Firefox to "watch it for changes") very specifically target transformed pages, not untransformed ones. And even developer-built generators might end up mostly targeting transformed pages if there were good visual tools for building such generators (like the Microsummary Generator Builder: https://addons.mozilla.org/firefox/3741/). So I'm inclined to say that generators should be operating on transformed pages, and XMLHttpRequest should transform the pages it downloads when instructed to do so by the microsummary service (filed as bug 366756). But I'm open to the opposite approach if there are considerations not brought up yet that would warrant taking it. Also cc:ing Dietrich Ayala, who has developed a number of generators, for his thoughts.
Status: UNCONFIRMED → NEW
Depends on: 366749, 366756
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
- BUGSPAM - Wontfixing all Microsummaries bugs, since the feature has been removed from the core product and previous versions won't get further fixes for it. If interested in supporting Microsummaries in your add-on, you're free to use our old microsummaries code and to search all previously open bugs by looking for [microsummaries-feature-removal] in the status whiteboard field.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
Whiteboard: [microsummaries-feature-removal]
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.