View unanswered posts | View active topics

Reply to topic  [ 14 posts ] 

Joined: Mon Jan 07, 2008 7:21 am
Posts: 109
Post language translation
Since upgrading to Win7(64bit) my language translation channels no longer work. Any suggestions (Kev)?

_________________
Booboo


Mon Aug 30, 2010 1:48 am
Profile
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2888
Location: Melbourne, Australia
Post Re: language translation
Booboo wrote:
Since upgrading to Win7(64bit) my language translation channels no longer work.

Yep, I had the same thing the other day. There wasn't anything in the event log, and I also tried changing the version of MSXML being used, to no avail.


Mon Aug 30, 2010 4:09 am
Profile WWW
User avatar

Joined: Mon Sep 08, 2008 3:16 pm
Posts: 223
Location: Elk Grove, California
Post Re: language translation
Without testing, I'm almost positive that the problem is that my XSLT file was written to use MSXML version 4 which was the version required by Awasu at the time this extension was written. To exasperate the problem, the line of code that instantiates MSXML 4 isn't in a try...catch block so there's no formal error handling/reporting. :oops:

Quick fix (for you)
  • Open the AutoTranslate.xsl file in a text editor, like Notepad.
  • Scroll down about 1/3 of the way to the code and find this line and change the 4 to 6:
    var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
  • Save the file.

Long-term fix (for me)
Update the AutoTranslate.xsl file on Awasu's Wiki to use MSXML 6 and wrap the line in a try...catch block logging an error event if MSXML 6 cannot be instantiated.


Tue Aug 31, 2010 11:54 am
Profile
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2888
Location: Melbourne, Australia
Post Re: language translation
kevotheclone wrote:
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");

Sigh... IIRC, I think I tried changing the "msxml2" to "msxml4" and "msxml6" :oops: We definitely need a new emoticon :facepalm:

Instead of logging to the event log, couldn't we insert the error message into the output? It doesn't even matter if we don't end up with valid XML - Awasu will complain about it and the user will be able to see the error message in the last feed. Or I could even add something so that if the feed XML contains something like, say, <awasu:errorMsg>Can't frob the foobar</awasu:errorMsg>, Awasu will show an error balloon and record it in the Error Log.


Tue Aug 31, 2010 12:00 pm
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2888
Location: Melbourne, Australia
Post Re: language translation
kevotheclone wrote:
Update the AutoTranslate.xsl file on Awasu's Wiki to use MSXML 6

Can we support both? MSXML6 is pre-installed on Vista and later, so go for that first and if it fails, try MSXML4.


Tue Aug 31, 2010 12:07 pm
Profile WWW
User avatar

Joined: Mon Sep 08, 2008 3:16 pm
Posts: 223
Location: Elk Grove, California
Post Re: language translation
Wow! You're too fast! Right after I wrote my post and the page refreshed to show the full thread, I noticed that you said that you already changed the version number so I never should have made that post. :oops: :oops: But I was hurrying off to work and didn't have time to edit it.

I just bought a shiny, new laptop with Windows 7 installed so I can actually try to test/resolve this issue... tonight.
I have some scripts that I can use to drive this process and test it outside of Awasu and I think I can cause the script debugger to run so I can step through the code (but I'm not sure, as this is JavaScript running within XSLT which is something I don't do too often]).

MSXML versions
"Can we support both? MSXML6 is pre-installed on Vista and later, so go for that first and if it fails, try MSXML4."
Yes I can loop through an array of ProgIDs and attempt to instantiate V6, if that fails attempt to instantiate v5, etc.

There's also a default version of MSXML that you can instantiate with the ProgID of "Msxml2.XMLHTTP".
You can check the value of this registry key to find out which version is the default:
HKEY_CLASSES_ROOT\Msxml2.XMLHTTP\CurVer

I did look at my Windows 7 laptop at home this morning and it looks like, as with previous editions of Windows, version 3 is the default. I think the simple HTTP call that make should work with version 3 to.

Error logging
"Instead of logging to the event log, couldn't we insert the error message into the output?"
I think I did try writing to STDERR, but I think that the WScript object wasn't valid within the context that the JavaScript code is running (embedded within XSLT). But that's a good idea I could add an error message that would invalidate the XML, I'll have to try that.

Reference material
If anyone is interested in JavaScript/VBScript and their ability to run outside of a web browser Windows Script 5.6 Documentation is helpful.
Also the MSXML SDK (third downloadable MSI file) contains information regarding embedding script within XSLT.


Tue Aug 31, 2010 1:19 pm
Profile
User avatar

Joined: Mon Sep 08, 2008 3:16 pm
Posts: 223
Location: Elk Grove, California
Post Re: language translation
I ran a quick test tonight on both of my PCs, Windows XP (desktop) and Windows 7 (laptop), both have IE8 installed, with every recommended update applied.

I downloaded this feed http://www.spiegel.de/schlagzeilen/tops/index.rss and saved it to a file so I'd have a consistent "snapshot" to work with.

I updated the Prog ID from 4 to 6 as previously mentioned.
I copied the RSS feed, AutoTranslate.xsl, and msxsl.exe to my USB thumb drive where I have Awasu running in portable mode.

I "unit tested" the AutoTranslate.xsl file on both PCs using Microsoft's msxsl.exe utility and saved the output to separate files. I compared the two files using WinMerge and they were identical.

I tried processing the "snapshot" Spiegel feed, as well as the live Spiegel RSS feed, on both PCs but in all (4) cases I'm getting a "Can't apply XSLT:" error message.

I'm running Awasu 2.4.3 Pro, build date: Aug 1 2010 (09:52).

It's getting late :sleepy:; I'll try some additional tests tomorrow such as adding a stylesheet declaration to the "snapshot" copy of the feed so that the processing can occur within IE8, maybe IE8 is the cause of the problem. I'll also expand the try...catch block to see if I can generate an error message. :asleep:


Wed Sep 01, 2010 3:51 am
Profile
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2888
Location: Melbourne, Australia
Post Re: language translation
I have a hunch about this, I reckon it's got something to do with security :-(

Stepping through the debugger, I'm getting a 0x80004005 returned (which doesn't tell me anything, I think it's a generic error code). Enabling AllowXsltScript gives me a 0x80020009 (which tells me even less) but it suggests that I'm on the right track. Removing the JavaScript and the 2 nodes that call it allow the XSLT to "work".

It also explains why changing the MSXML version in the XSLT file isn't having any effect since Awasu always uses MSXML6 to execute the XSL. But I can't seem to get it to work :-(

Any ideas...?


Wed Sep 01, 2010 8:08 am
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2888
Location: Melbourne, Australia
Post Re: language translation
I've got half-a-mind to go on another rant at Microsoft :mad: If there's a switch that needs to be set before you do something, and you try set that switch after you do that something, then if you returned a helpful error message, say, "This switch must be set before you frob the doo-hickey, that would be REALLY NICE, guys! :wall:

I've sent you guys out an interim build with a fix in it, and if you don't have MSXML4 currently installed, you'll also have to change the version number in the XSLT file, as kevotheclone described above.


Sat Sep 04, 2010 10:23 am
Profile WWW
User avatar

Joined: Mon Sep 08, 2008 3:16 pm
Posts: 223
Location: Elk Grove, California
Post Re: language translation
Thanks for doggedly pursuing this to its resolution. :clap:

I tested the update this update and it works perfectly! ::-):
I was worried that Microsoft's update had permantly banned scripting within XSLT, but thankfully that was not the case.

Order of setting properties
I seem to remember similar situation in Microsoft's ADO where one of the properties (CursorType, CursorLocation, IsolationLevel, LockType, or Mode) of either the ADO Connection object or the ADO Recordset object must be set after the .Open() method, not before; and it's not explicitly documented anywhere. I wasted a couple of hours trying to figure out why my code wouldn't work like a web site example. :wall:


Sun Sep 05, 2010 3:35 am
Profile

Joined: Mon Jan 07, 2008 7:21 am
Posts: 109
Post Re: language translation
Have installed the patch. All my language translation channels are up an running. Good work team.

Kev. Can it be configured so that the 'Items' are actually the URL of the translated item not the original??

_________________
Booboo


Tue Sep 28, 2010 9:57 am
Profile
User avatar

Joined: Mon Sep 08, 2008 3:16 pm
Posts: 223
Location: Elk Grove, California
Post Re: language translation
Booboo wrote:
Kev. Can it be configured so that the 'Items' are actually the URL of the translated item not the original??


Sure, it can. Great idea! I should have thought about that.

I've got a couple of other updates to make to the XSLT file as mentioned earlier ("loop through an array of ProgIDs, trying version 6, then 5, then 4... " and "improving the error logging"); as I make these updates I'll modify the feed item's URL so that they will be processed through Google's translation service.

In the meantime, you should set up the Google Translation Send to Tools mentioned on this Awasu wiki page: Google User Tools. This way you can achieve the same function you want right now by using this Send to Tool.


Tue Sep 28, 2010 11:37 pm
Profile

Joined: Mon Jan 07, 2008 7:21 am
Posts: 109
Post Re: language translation
I set up and am using the Google translation Send To tool - this works great :D BUT obviously not good for the readers of my reports :(

_________________
Booboo


Thu Sep 30, 2010 5:32 am
Profile
User avatar

Joined: Mon Sep 08, 2008 3:16 pm
Posts: 223
Location: Elk Grove, California
Post Re: language translation
Booboo wrote:
... BUT obviously not good for the readers of my reports :(

Great point! I've updated the AutoTranslate.xsl file and sent it to Taka for review and if all is well he will update Awasu's wiki with the new version soon.

Fingers crossed...


Fri Oct 01, 2010 3:25 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 14 posts ] 

Who is online
Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: