Closed Bug 551654 Opened 14 years ago Closed 14 years ago

The EXSLT node-set function fails to convert number, boolean and string values to text nodes

Categories

(Core :: XSLT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: andreas.wictor, Assigned: andreas.wictor)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.3a3pre) Gecko/20100311 Minefield/3.7a3pre
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.3a3pre) Gecko/20100311 Minefield/3.7a3pre

There is a missing call to SetText in createTextNode

Reproducible: Always

Steps to Reproduce:
Use this html file

<html>
<head>
<title>exsl node-set bug</title>
</head>
<body>
<div id="result"></div>
<script type="text/javascript">
var xslStr =
'<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"' +
'                xmlns:exsl="http://exslt.org/common"' +
'                version="1.0">' +
'  <xsl:output method="html"/>' +
'  <xsl:template match="/">' +
'    <xsl:copy-of select="exsl:node-set(42)"/>' +
'  </xsl:template>' +
'</xsl:stylesheet>';

var parser = new DOMParser();
var xslDoc = parser.parseFromString(xslStr, "text/xml");
var xmlDoc = parser.parseFromString("<root/>", "text/xml");

var xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xslDoc);

var fragment = xsltProcessor.transformToFragment(xmlDoc, document);

document.getElementById("result").appendChild(fragment);
</script>
</body>
</html>

Actual Results:  
Displays a blank window

Expected Results:  
Should display the number 42
Attached patch Call SetText in createTextNode (obsolete) — Splinter Review
Attachment #431817 - Flags: review?(peterv)
Attachment #431817 - Attachment is obsolete: true
Attachment #443154 - Flags: review+
Attachment #431817 - Flags: review?(peterv)
I'll check this in.
Assignee: nobody → andreas.wictor
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
http://hg.mozilla.org/mozilla-central/rev/c8c9454755d3
http://hg.mozilla.org/mozilla-central/rev/8d0331c135da
http://hg.mozilla.org/mozilla-central/rev/bf614f5101e9
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: