Social forum

XSL enabling

 
Picture of diwakar moorthy
XSL enabling
by diwakar moorthy - Wednesday, 6 June 2007, 10:45 AM
 
hello there,
I'm a newbie, i was going through the readme section in the newly posted module. how can i enable XSL for my moodle. my php version is 5.0.5
i do have '--with-dom-xslt' '--with-dom-exslt' but not --with-xsl

thanks
diwakar
Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Wednesday, 6 June 2007, 11:51 AM
 
That's odd, the PHP website says that the module these options relate to is not included with PHP 5. I've just pulled down the source code release for PHP 5.0.5 from the archive and that only has --with-xsl.

If you're using a pre-compiled binary of PHP, it's possible that the packager decided to patch in the older library instead of using the one that comes with PHP 5, I can think of no other explanation.

The module itself works by detecting the XSL methods which are installed on your system rather than looking at the version of PHP you have so as long as you have one of the supported methods installed, the precise version and options used for compiling PHP shouldn't matter. So I suggest you just give it a go and see what happens.
Picture of diwakar moorthy
Re: XSL enabling
by diwakar moorthy - Wednesday, 6 June 2007, 12:31 PM
 

I gave it a shot, but after adding a new xml file for configuration i get this error. i have posted a ticket to my hosting server about enabling XML will have to wait and see.

Not Found

The requested URL /error_page500.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.



Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Wednesday, 6 June 2007, 1:22 PM
 
Well it looks to me like the error handling mechanism on your server is broken, so they will need to fix this first.

You'll need more than just the XML support, XSL is an extra that won't necessarily come with the XML stuff by default. However, if you were seeing those dom compile options, the XSL support probably is there, it's just not the version you would expect.

Missing XSL support should no longer generate a server error, you will get a message telling you that XSL has not been found. Therefore I suspect the error you are seeing is being caused by something else. Ideally I would need to see the apache error log to work out what is going on.
Picture of diwakar moorthy
Re: XSL enabling
by diwakar moorthy - Wednesday, 6 June 2007, 1:52 PM
 
here are the following errors:

error: file is writable by others: (/home/XXXXXX/public_html/moodle/mod/autoview/view.php)

Premature end of script headers: /home/XXXXXXX/public_html/moodle/mod/autoview/view.php)

I some how want this module to work i have pinned my hopes on it.

thanks



Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Wednesday, 6 June 2007, 3:52 PM
 
The first error looks like a file permissions problem on the webserver. I'm assuming your server must have some kind of security setting which i'm not using because our system dosn't complain about files being writable by other users.

I'm guessing that you've managed to put the files in with some kind of group/all users write permission, there's nothing I can do to stop this since it's really down to the way your server and user account is set up. If you unziped the archive on a windows box and then transferred it across to a linux/unix server through samba, then this can sometimes do some funny things to the file permissions. If you unzipped directly on the server at the command prompt then I would not normally expect group/all user write access to be set unless you've changed the defaults on your account.

If you have shell access, you could try going to the moodle/mod dir and executing

chmod -R og-w autoview

If you can't do this you need to find some way to change the permissions of the file to remove group/all users write permission.

The second problem may be being triggered by the first if there is a security system which is blocking execution of the page if the permissions don't fit what is allowed, so get the first problem fixed and see if the second goes away.
Picture of diwakar moorthy
Re: XSL enabling
by diwakar moorthy - Thursday, 7 June 2007, 6:33 AM
 
Hello Tim,

How you doing? i have changed all the file and folder permission. Now there is no 404 error. but when click on autoview presenter i get a blank screen with update autoview, and click to edit button, when i click edit button i again get a blank a screen with a divider in between. do u think it's to do with XSL enabling thing i have been trying to figure that out.
thanks
diwakar
Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Thursday, 7 June 2007, 10:53 AM
 
If XSL hasn't been found then there ought to be a message in the screen saying :

Warning : No suitable XSL parser has been found. Please update your PHP with XSL support enabled. Please see the ReadMe file in the autoview module

If you are not seeing this then the error could be something else, however, since we've already established that the XSL setup on your server isn't what would be expected for PHP 5 it's possible that some of the XSL methods are missing, but not the ones that are being tested for to determin the instalation type.

I really need you to find the relevant error message(s) in the apache log file or this is going to be impossible to track down.
Picture of diwakar moorthy
Re: XSL enabling
by diwakar moorthy - Thursday, 7 June 2007, 12:40 PM
 
Hello Tim,
I think the source of error would be XML configuration. when i opened the module in IE i got an JS error. when i opened the page in editor mode i found the following having an error...
function saveXMLConfig()
{
var data=""; if
(typeof(btoa)=="undefined") data=encodeBase64(parent.videoframe.exportXMLConfig("")); else
data=btoa(parent.videoframe.exportXMLConfig(""));

and when i opened the config file that i had uploaded in beginning i got this error.

XML Parsing Error: no element found
Location: http://moodle.XXXXXXX.com/file.php/2/TESTING/testing.xml
Line Number 1,
Column 56:<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-------------------------------------------------------^

and i found the following in the error log:
File does not exist: /home/xxxxxxxx/public_html/moodle/404.shtml
File does not exist: /home/xxxxxxxx/public_html/moodle/mod/podcast/publication/6/rss5.
I'll see if this thing works otherwise i'm gonna get all my video and slides converted to flash and play it on the web.
thanks tim you have been helpful already.
diwakar

Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Thursday, 7 June 2007, 2:07 PM
 
I'm somewhat mystified where this has come from :

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

The autoview editor generates the following header for it's XML files :

<?xml version="1.0" encoding="UTF-8"?>

without the standalone bit and UTF is in captitals. Where did the XML file you are using come from ? You shouldn't have needed to upload anything, AutoView will generate a new XML file for you using the filename you supply in the configuration.

The messages in the error log don't relate to the AutoView module. However, whoever is running the server really needs to fix the broken error handler methods.
Picture of ilias choutopoulos
Re: XSL enabling
by ilias choutopoulos - Thursday, 7 June 2007, 2:41 PM
 
hello again,I'm experiencing exactly the same thing. I've installed the latest version of autoview and the only thing that is written in my access log files is this. This is a process of adding an autoview activity for a course and after I hit update I get the same blank screen.

192.168.0.12 - - [07/Jun/2007:16:35:28 +0300] "GET /lib/editor/htmlarea/lang/en.php HTTP/1.1" 200 2493
192.168.0.12 - - [07/Jun/2007:16:35:43 +0300] "POST /course/mod.php HTTP/1.1" 200 214
192.168.0.12 - - [07/Jun/2007:16:35:44 +0300] "GET /mod/autoview/view.php?id=4 HTTP/1.1" 200 421
192.168.0.12 - - [07/Jun/2007:16:35:44 +0300] "GET /mod/autoview/view.php?id=4&frameset=false&edit= HTTP/1.1" 200 5049
192.168.0.12 - - [07/Jun/2007:16:35:44 +0300] "GET /mod/autoview/autoview.php?l=3&edit= HTTP/1.1" 200 1

I'm not getting any messages in error.log of httpd. I'm also letting autoview to create the XML file, I just give it the name.

One more thing, do have to have files uploaded ? because I don't (i got the directory created though). I believe I should see the autoview interface even if there's not anything uploaded on the server, right ? mixed

this is a screenshot of what i'm getting

s1vi2.jpg


Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Thursday, 7 June 2007, 3:53 PM
 
You should see some buttons on the left and an autoview stub in the main frame. There is an occasional problem with the buttons on the left not coming up, but a reload/refresh usually fixes this. What you ought to get after switching on editing is in the attached image.

You don't need anything uploaded to see the initial screen.

A couple of things to check :

1) That looks like firefox (I think I recognise the developer toolbar). Can you check the error console to see if there are any interesting javascript error messages ?

2) If you do a view source on the main frame and the left hand frame what do you get. Is the page blank or do you get some code ?

Note : The feedback from both of you is very much appreciated. I'm currently re-writing the module add/update page which I think might have been a bit confusing regarding the XML file. Hopefully if a few more people join in soon, I can get all the bugs worked out of the module and provide a stable release.

Picture of ilias choutopoulos
Re: XSL enabling
by ilias choutopoulos - Thursday, 7 June 2007, 4:15 PM
 
I believe I found the error at last. At the JS error console I get

parent.videoframe.exportXMLConfig is not a function
http://192.168.0.12/mod/autoview/avedit/editor.js line 482

either the code is messed up or i'm doing something terribly wrong ..i believe it's the second big grin
Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Thursday, 7 June 2007, 5:38 PM
 
This method is called by the editor window when you exit the page (there is an onUnload event call in the page body), so if for some reason the AutoView code hasn't been loaded properly in the browser window, this error will be generated when you leave the autoview page or switch of the editing mode.

This method will also be called elsewhere in the editor code, but only in response to user actions, which you can't be doing because you haven't got a working editor interface yet.

However, the fact that you are seeing this error means that the XSL stuff should all be working correctly, you couldn't possibly be getting errors from editor.js if it wasn't.

Can you check that all of the directories and files are readable by the webserver user, this looks like one of the key javascript files isn't being loaded, which means that either the file is unreadable, it's missing or i've got something wrong in the code which links to it. One of the things i'm working on for the next version is a test page which will check the XSL support and check that all of the files are readable and can be loaded.

Perhaps you could double check the javascript errors with the following sequence :

1) Go to the course home page which lists an instance of autoview.
2) Open the error console and clear all the errors
3) Open the autoview instance
4) Note any errors which may have occured and clear the error console
5) Switch on the editing mode
6) Check again for errors
Picture of ilias choutopoulos
Re: XSL enabling
by ilias choutopoulos - Thursday, 7 June 2007, 6:16 PM
 
1st Scenario - Viewing an Autoview Activity

1st step: Access the autoview activity - no error
2nd step: Switch on Edit view - no error
3rd step: Switch off Eddit view - 1 error

- parent.videoframe.exportXMLConfig is not a function http://192.168.0.12/mod/autoview/avedit/editor.js

2nd Scenario - Adding an Autoview Activity

1st step: Add autoview activity (display form to enter name and xml file) - 4 errors

- Unknown property 'filter'. Declaration dropped.
http://192.168.0.12/lib/editor/htmlarea/htmlarea.css
- Error in parsing value for property '-moz-opacity'. Declaration dropped.
http://192.168.0.12/lib/editor/htmlarea/htmlarea.css
- Expected color but found 'FieldFace'. Error in parcing value for property 'background'. Declaration dropped.
http://192.168.0.12/lib/editor/htmlarea/htmlarea.css
- document.form.name.focus is not a function
http://192.168.0.52/course/mod.php?id=2&section=0&sesskey=cVTEgn95S2&add=autoview

2nd step: Updating the details - no errors
3rd step: Switch on Edit view - no errors
4th step: Switch off Edit view - 1 error

- parent.videoframe.exportXMLConfig is not a function http://192.168.0.12/mod/autoview/avedit/editor.js

As you can see I'm getting the same error when switching off the editor.
I'm sure those other 3 erros haven't got anything to do with autoview, i'm not certain about the 4th one though. I've also given full permissions (777) to /moodle/mod/autoview folder but still.
Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Thursday, 7 June 2007, 7:02 PM
 
The exportXMLConfig error you are seeing is consistent with one of the javascript source files not being loaded by the browser.

I've just put an updated version of the module in the download area. This version aside from a few bug fixes also contains a test page which will check the XSL installation and go through a list of every file used by the AutoView module and check that it is present and readable. The test page is unlinked but you find it by pointing your browser at mod/autoview/test.php within your moodle installation.

If this shows that everything is OK, then we need to try and work out why the browser isn't loading the javascript source, there could be several reasons for this :

1) You have a rather paranoid security setup that is somehow blocking some of the javascript files from being loaded.
2) Strange proxy behaviour (only if you are behind a proxy server). Our proxy has a tendancy to serve out 404 errors for about 24 hours after a missing file/permissions problem has been fixed.
3) There is a bug in the module which means that it's giving the browser the wrong URL for the javascript file. Have a look at the source of the large frame on the right and see if the javascript script links for extension.js and autoview.js are pointing to the right place. (If you want to save the source of this page and email it to me, feel free).
Picture of diwakar moorthy
Re: XSL enabling
by diwakar moorthy - Friday, 8 June 2007, 5:18 AM
 
Hello Tim,
i have installed the new version of autoview. i had to change the file & folder permission. Now i get this message:
Warning : No suitable XSL parser has been found. Please update your PHP with XSL support enabled. Please see the ReadMe file in the autoview module directory for more information on how to do this
and the following in error console when i create the autoview module..


Error: document.form.name.focus is not a function
Source File: http://xxxxxxxxxxxxx/course/mod.php?id=2&section=1&sesskey=7RHp05u2Xp&add=autoview
Line: 70
Warning: Unknown property 'filter'. Declaration dropped.
Source File: http://XXXXXXXXXXX/lib/editor/htmlarea/htmlarea.css
Line: 45
Warning: Error in parsing value for property '-moz-opacity'. Declaration dropped.
Source File: http://xxxxxxxxxxxxxx/lib/editor/htmlarea/htmlarea.css
Line: 46
Warning: Expected color but found 'FieldFace'. Error in parsing value for property 'background'. Declaration dropped.
Source File: http://xxxxxxxxxxxxx/lib/editor/htmlarea/htmlarea.css
Line: 65



Picture of ilias choutopoulos
Re: XSL enabling
by ilias choutopoulos - Friday, 8 June 2007, 8:25 AM
 
Warning : No XSLT Processors have been found

This is the message i'm getting from test.php, so I guess I have no XSLT support, everything else says 'OK'.

It's strange though cause phpinfo(); shows that xslt module is enabled mixed





Picture of diwakar moorthy
Re: XSL enabling
by diwakar moorthy - Friday, 8 June 2007, 9:21 AM
 
Hello Ilias,
I have asked my server admin, they says its impossible for them to configure the php with XSL support neither from my side or their side as they are hosting several other customers site as well.
i'm gonna convert all the video and ppt to flash and put them in html, that seems to be the only option.
thanks
diwakar
Picture of ilias choutopoulos
Re: XSL enabling
by ilias choutopoulos - Friday, 8 June 2007, 9:34 AM
 
Thanks for your reply. I got access in my own web server as I'm trying to configure this locally but I cannot use any other version of PHP cause our main server is using PHP 4.3.9 and I have to make this work with CentOS 4.4,PHP4.3.9,Apache2 and PostgreSQL 7.4 first, before I upload it on our primary server.
Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Friday, 8 June 2007, 10:58 AM
 
Tell them it shouldn't have any effect on their other customers. On a standard linux server setup using the distro supplied binaries it's just another rpm/deb file. Takes a minute or two to install.
Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Friday, 8 June 2007, 11:35 AM
 
The test.php does a test for the methods being used in the module, so if it's coming up as a fail that must mean either they are missing or the xsl methods in the php version you are using are different from any of the ones i'm using.

When you are looking at the phpinfo() are you just checking configure options I indicated in the readme ? I've had another look at this page and there should also be an xsl or xslt block near the bottom of the phpinfo() page giving you the library versions.

One other thought has just occured to me, are you using the php/apache binaries that are supplied with CentOS ?
I think the XSL stuff for PHP is in a separate rpm file to the main install, i've discovered that the configure command shown in phpinfo() will still show the XSL support as being enabled even when this rpm is not installed. I suppose this is because everything is built together and then split up as separate rpm's later on.

I've done a quick dig and I think you need to have the php-domxml rpm installed (it's got a dependency for libxslt). Check for that rpm and if it's missing I think we have found the problem.
Picture of ilias choutopoulos
Re: XSL enabling
by ilias choutopoulos - Friday, 8 June 2007, 3:09 PM
 
It's ALIVE! it was the php-domxml extension module :D Cool! On Monday I'll start playing with it and give you feed back.
Picture of Tim Williams
Re: XSL enabling
by Tim Williams - Friday, 8 June 2007, 3:46 PM
 
Phewww..... I'll make sure to update the readme for the next release so that other people know to look for missing packages if they are using pre-built php installations.