Project

Profile

Help

Bug #1640

closed

TypeError if xsl:output method="xml" is used for the boot stylesheet

Added by Manfred Staudinger over 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Start date:
2012-10-31
Due date:
% Done:

0%

Estimated time:
Platforms:

Description

If I use xsl:output method="xml" (either explicit or implicit) in the boot stylesheet (@test_br_1.xsl@) then a TypeError is thrown by the browser [1] as soon as the initializing Saxonce.nocache.js is executed. This is demonstrated by the attached test (@test_br.xml@).

If I change the output method to html (as shown in sample.boot.xsl [2]), then at least Saxon-CE works correct. But most browsers handle the line break elements (@
@) coming from the input or from the XSLT 1.0 stylesheet wrong: many line breaks get doubled, only Firefox seems to get this right. This too can be demonstrated with the attached test. Other self-closing elements may also cause problems.

Maybe I overlook something trivial. I'm not after any serialization and I can easily change my stylesheet to test anything you propose. What I can't change easily (at least in the short run) is the input XML (about 20.000 documents). For a workaround I used Saxon-CE with

<xsl:template match="html:br[preceding-sibling::node()[1][self::html:br]]" mode="init"/>

[1]

Platform Win32 System Windows XP

Opera Version 12.02 Build 1578

[27.10.2012 12:07:56] JavaScript -

http://test.rudolphina.org/RegestTest/test_br.xml

Event thread: DOMContentLoaded

Uncaught exception: TypeError: Cannot convert 'm.body' to object

Error thrown at line 14, column 114 in I() in

http://test.rudolphina.org/SaxonceDebug/Saxonce.nocache.js:

m.body.appendChild(a);

called from line 16, column 101 in () in

http://test.rudolphina.org/SaxonceDebug/Saxonce.nocache.js:

I();

Other browsers give simmiliar messages:

Firefox 16.0.2

TypeError: a.style is undefined

Saxonce.nocache.js Line: 14

Google Chrome Version 23.0.1271.52 beta-m

Uncaught TypeError: Cannot set property 'cssText' of null

Saxonce.nocache.js:14

Safari 5.0 (7533.16)

TypeError: Result of expression 'a.style' [null] is not an object.

Saxonce.nocache.js:14

[2] http://www.saxonica.com/ce/doc/starting/running/pi-sample.xml


Files

test_br.xml (426 Bytes) test_br.xml Manfred Staudinger, 2012-10-31 16:07
test_br_1.xsl (1.27 KB) test_br_1.xsl Manfred Staudinger, 2012-10-31 16:07
test_br_2.xsl (1.05 KB) test_br_2.xsl Manfred Staudinger, 2012-10-31 16:08

Please register to edit this issue

Also available in: Atom PDF