Open Bug 600819 Opened 15 years ago Updated 3 years ago

XSLTProcessor fails when using stylesheet document with XUL namespace

Categories

(Core :: XSLT, defect)

x86
macOS
defect

Tracking

()

Tracking Status
blocking2.0 --- .x+
status2.0 --- wanted

People

(Reporter: mash, Unassigned)

References

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b7pre) Gecko/20100929 Firefox/4.0b7pre Build Identifier: const domSerializer = Cc["@mozilla.org/xmlextras/xmlserializer;1"].getService(Ci.nsIDOMSerializer); function dumpXML(aMessage, aXML) dump(aMessage + ": " + domSerializer.serializeToString(aXML) + "\n\n"); function getXMLFromString(aXMLString) { let domParser = Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser); try { /* let systemPrincipal = Cc["@mozilla.org/scriptsecuritymanager;1"] .getService(Ci.nsIScriptSecurityManager) .getSystemPrincipal(); domParser.init(systemPrincipal); */ domParser.init(); } catch (e) {} return domParser.parseFromString(aXMLString, "text/xml"); } //const XMLNS = "http://www.w3.org/1999/xhtml";// <-- no error const XMLNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";// <-- error let ss = getXMLFromString('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="' + XMLNS + '"><xsl:template match="*"><vbox/></xsl:template></xsl:stylesheet>'); dumpXML("stylesheet", ss); let source = getXMLFromString('<data/>'); dumpXML("source", source); let xsltProcessor = Cc["@mozilla.org/document-transformer;1?type=xslt"].createInstance(Ci.nsIXSLTProcessor); xsltProcessor.importStylesheet(ss); try { let result = xsltProcessor.transformToDocument(source); dumpXML("result", result); } catch (e) { dump("error: " + e + "\n"); } Reproducible: Always Actual Results: error: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIXSLTProcessor.transformToDocument]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: file:///Users/.../components/test.js :: <TOP_LEVEL> :: line ..." data: no] Expected Results: result: <?xml version="1.0" encoding="UTF-8"?> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>
Blocks Bug 546857?
Jonas, this needs to work from chrome, right?
Status: UNCONFIRMED → NEW
blocking2.0: --- → ?
Component: XML → XSLT
Ever confirmed: true
Keywords: regression
QA Contact: xml → xslt
Assignee: nobody → jonas
blocking2.0: ? → beta8+
Not critical for beta8.
blocking2.0: beta8+ → beta9+
Unless we hear of more people having problem with this, we'll unfortunately have to punt on this
blocking2.0: beta9+ → .x
status2.0: --- → wanted
Attached file Test page
I get same error for both web page (please see 'Test page' attached) and chrome (NS_ERROR_UNEXPECTED exception). 1. Doesn't work for FF 4.* (last tests were done on the following: Mozilla/5.0 (Windows NT 6.1; rv:2.0b11) Gecko/20100101 Firefox/4.0b11) 2. Works for FF 2.* and 3.*
Web page case can be skipped since there is no exception after adding domain to whitelist. But there is still exception when running from chrome and output nodes have xul namespace: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIXSLTProcessor.transformToDocument]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: chrome://.../content/t.js :: <TOP_LEVEL> :: line 8" data: no] XUL namespace can be defined stylesheet and it works to match input XUL nodes. Exception is thrown if output nodes need to be with XUL namespace.
Reproducible Version 46.0.1 Build ID 20160502172042 Version 50.0a1 Build ID 20160609064045
Keywords: regression

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: jonas → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: