Open
Bug 600819
Opened 15 years ago
Updated 3 years ago
XSLTProcessor fails when using stylesheet document with XUL namespace
Categories
(Core :: XSLT, defect)
Tracking
()
NEW
People
(Reporter: mash, Unassigned)
References
Details
Attachments
(1 file)
|
876 bytes,
text/html
|
Details |
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"/>
| Reporter | ||
Comment 1•15 years ago
|
||
Blocks Bug 546857?
Comment 2•15 years ago
|
||
Jonas, this needs to work from chrome, right?
Blocks: kill-remote-xul
Status: UNCONFIRMED → NEW
blocking2.0: --- → ?
Component: XML → XSLT
Ever confirmed: true
Keywords: regression
QA Contact: xml → xslt
Assignee: nobody → jonas
blocking2.0: ? → beta8+
Unless we hear of more people having problem with this, we'll unfortunately have to punt on this
Comment 5•15 years ago
|
||
Comment 6•15 years ago
|
||
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.*
Comment 7•15 years ago
|
||
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.
Comment 8•10 years ago
|
||
Reproducible
Version 46.0.1
Build ID 20160502172042
Version 50.0a1
Build ID 20160609064045
Keywords: regression
Comment 9•4 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee: jonas → nobody
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•