Skip to main content

Bug Tracker

Side navigation

#6598 closed bug (patchwelcome)

Opened May 25, 2010 08:00PM UTC

Closed April 17, 2011 06:44PM UTC

TypeError: Result of expression 'div.style' [null] is not an object when loading using XSLT

Reported by: kevinpeno Owned by:
Priority: undecided Milestone:
Component: support Version: 1.4.4
Keywords: xml xsl xslt needsreview Cc:
Blocked by: Blocking:
Description

When loading jquery via an xslt page, Safari 4.0.4 (531.21.10), the latest windows build, throws the following error:

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

See attached files for test case.

Attachments (2)
  • simple-template.xsl (0.7 KB) - added by kevinpeno May 25, 2010 08:03PM UTC.

    Fixed invalid path to jquery

  • test.xml (0.1 KB) - added by kevinpeno May 25, 2010 08:00PM UTC.

    XML file a user would access

Change History (14)

Changed May 25, 2010 08:11PM UTC by kevinpeno comment:1

Also verified that this affects FF 3.6.3 as well. IE 6+ is not affected.

Changed May 27, 2010 08:09PM UTC by kevinpeno comment:2

I found a few more things through research today that I think should be taken into consideration when resolving this bug. Please see the references below:

Forum post with the same issue:

http://forum.jquery.com/topic/using-jquery-from-an-xslt-throws-error-is-undefined-after-that

2008 mailing list message regarding a fix to this issue:

http://groups.google.com/group/jquery-en/msg/a86c35b90d143c4f

GitHub submission containing a hack to workaround this issue until it is resolved:

http://gist.github.com/352210

Thanks!

Changed June 12, 2010 01:57AM UTC by dmethvin comment:3

component: unfiledmanipulation

Changed November 12, 2010 02:40AM UTC by snover comment:4

milestone: 1.4.3

Resetting milestone to future.

Changed November 17, 2010 04:14AM UTC by snover comment:5

keywords: → xml xslt
priority: → undecided

Changed November 21, 2010 02:18AM UTC by jitter comment:6

#4895 is a duplicate of this ticket.

Changed November 21, 2010 02:20AM UTC by jitter comment:7

version: 1.4.21.4.4

Changed November 21, 2010 04:11AM UTC by snover comment:8

keywords: xml xsltxml xslt needsreview

But does anyone care…?

Changed November 21, 2010 04:12AM UTC by snover comment:9

keywords: xml xslt needsreviewxml xsl xslt needsreview
summary: TypeError: Result of expression 'div.style' [null] is not an object.TypeError: Result of expression 'div.style' [null] is not an object when loading using XSLT

Changed November 29, 2010 05:03PM UTC by dvdckl comment:10

More details available in ticket 4264 (why are the older XSLT namespace bugs are being marked as duplicates of the newer ones?)

Changed November 30, 2010 08:25PM UTC by kevinpeno comment:11

Replying to [comment:8 snover]:

But does anyone care…?

I'll provide a patch as soon as I have some time. I assume that will expedite the resolution? Is there anything else I should supply with the patch that will help with getting this resolved and/or approved for a future release?

Replying to [comment:10 dvdckl]:

More details available in ticket 4264 (why are the older XSLT namespace bugs are being marked as duplicates of the newer ones?)

Hey! Thanks for the reference to your ticket (which is far more comprehensible than mine). I've altered my local copy of http://gist.github.com/352210 to add the code below and it resolves all errors with all browsers when using jQuery with namespaces (XHTML) and/or using XSLT. I did note, however, that, unlike you, I did not suffer from document.body issues in webkit browsers. This has likely been fixed recently because I recall having issues with them in the past regarding document.body.

Also, if you haven't, make sure you vote this ticket up ;)

// XSLT causes Gecko and Webkit to not set document.body
if( !document.body )
	document.body = document.documentElement.getElementsByTagName("body")[0];

Changed November 30, 2010 08:30PM UTC by kevinpeno comment:12

Also, doesn't this belong under support module?

Changed November 30, 2010 08:35PM UTC by rwaldron comment:13

Replying to [comment:11 kevinpeno]:

>Is there anything else I should supply with the patch that will help with getting this resolved and/or approved for a future release?

Adequate unit tests must be added to the jQuery Test Suite. Your tests must pass 100% in at least the following:

  • Chrome 5
  • Safari 3+
  • Firefox 3.0.12, 3.5, 3.6, 4
  • IE 6+
  • Opera 10.60+

Changed April 17, 2011 06:44PM UTC by john comment:14

component: manipulationsupport
resolution: → patchwelcome
status: newclosed

I don't think that this is something that we're going to reasonably fix. If a patch with a pull request is issued, pleased feel free to re-open this and we can take a look. Thanks!