php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44024 Can't call instanciated objects methods from stylesheets
Submitted: 2008-02-02 13:31 UTC Modified: 2008-03-26 20:07 UTC
From: locutus dot unimatrix01 at gmail dot com Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 5.2CVS-2008-02-02 (snap) OS: ubuntu 7.10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: locutus dot unimatrix01 at gmail dot com
New email:
PHP Version: OS:

 

 [2008-02-02 13:31 UTC] locutus dot unimatrix01 at gmail dot com
Description:
------------
$ php -v
PHP 5.2.3-1ubuntu6.3 (cli) (built: Jan 10 2008 09:38:41) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Using XSLTProcessor::registerPHPFunctions(), i can call static methods, but not normal ones.

In the source linked with my bug report i made two version of the call to the normal method, one with '>' and one with '>', that's because i'm not really sure how xslt handle special chars in attributes.

You may need to know that this code is actually executed in a php script i'm writing as an apache handler for an xml document i use as a website template, here is the relevant part of my virtual host:

Alias /uis /usr/share/uis/
Action uis-processor /uis/uis.php
AddHandler uis-processor .uis
DirectoryIndex index.uis

Reproduce code:
---------------
You can get the code at this url: http://daffy.vuegate.net/php/register_php_functions.phps

Expected result:
----------------
This is the static method.
This is the normal method.
This is the normal method.

Actual result:
--------------
Warning: XSLTProcessor::transformToXml() [function.XSLTProcessor-transformToXml]: Unable to call handler $test_instance->normal_method() in /usr/share/uis/uis.php on line 56

Warning: XSLTProcessor::transformToXml() [function.XSLTProcessor-transformToXml]: xmlXPathCompiledEval: evaluation failed in /usr/share/uis/uis.php on line 56

Warning: XSLTProcessor::transformToXml() [function.XSLTProcessor-transformToXml]: runtime error: file /usr/share/uis/ line 21 element value-of in /usr/share/uis/uis.php on line 56

Warning: XSLTProcessor::transformToXml() [function.XSLTProcessor-transformToXml]: XPath evaluation returned no result. in /usr/share/uis/uis.php on line 56

This is the static method.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-26 20:07 UTC] rrichards@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

only functions and static methods can be called
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 02:01:24 2019 UTC