Booboo
Posts: 109
Joined: Mon Jan 07, 2008 7:21 am

Postby Booboo » Mon Aug 30, 2010 1:48 am

Since upgrading to Win7(64bit) my language translation channels no longer work. Any suggestions (Kev)?
Booboo

User avatar
support
Site Admin
Posts: 2927
Joined: Fri Feb 07, 2003 8:48 am
Location: Melbourne, Australia
Contact:

Postby support » Mon Aug 30, 2010 4:09 am

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.

User avatar
kevotheclone
Posts: 233
Joined: Mon Sep 08, 2008 3:16 pm
Location: Elk Grove, California

Postby kevotheclone » Tue Aug 31, 2010 11:54 am

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.

User avatar
support
Site Admin
Posts: 2927
Joined: Fri Feb 07, 2003 8:48 am
Location: Melbourne, Australia
Contact:

Postby support » Tue Aug 31, 2010 12:00 pm

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.

User avatar
support
Site Admin
Posts: 2927
Joined: Fri Feb 07, 2003 8:48 am
Location: Melbourne, Australia
Contact:

Postby support » Tue Aug 31, 2010 12:07 pm

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.

User avatar
kevotheclone
Posts: 233
Joined: Mon Sep 08, 2008 3:16 pm
Location: Elk Grove, California

Postby kevotheclone » Tue Aug 31, 2010 1:19 pm

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.

User avatar
kevotheclone
Posts: 233
Joined: Mon Sep 08, 2008 3:16 pm
Location: Elk Grove, California

Postby kevotheclone » Wed Sep 01, 2010 3:51 am

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:

User avatar
support
Site Admin
Posts: 2927
Joined: Fri Feb 07, 2003 8:48 am
Location: Melbourne, Australia
Contact:

Postby support » Wed Sep 01, 2010 8:08 am

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...?

User avatar
support
Site Admin
Posts: 2927
Joined: Fri Feb 07, 2003 8:48 am
Location: Melbourne, Australia
Contact:

Postby support » Sat Sep 04, 2010 10:23 am

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.

User avatar
kevotheclone
Posts: 233
Joined: Mon Sep 08, 2008 3:16 pm
Location: Elk Grove, California

Postby kevotheclone » Sun Sep 05, 2010 3:35 am

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:

Booboo
Posts: 109
Joined: Mon Jan 07, 2008 7:21 am

Postby Booboo » Tue Sep 28, 2010 9:57 am

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

User avatar
kevotheclone
Posts: 233
Joined: Mon Sep 08, 2008 3:16 pm
Location: Elk Grove, California

Postby kevotheclone » Tue Sep 28, 2010 11:37 pm

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.

Booboo
Posts: 109
Joined: Mon Jan 07, 2008 7:21 am

Postby Booboo » Thu Sep 30, 2010 5:32 am

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

User avatar
kevotheclone
Posts: 233
Joined: Mon Sep 08, 2008 3:16 pm
Location: Elk Grove, California

Postby kevotheclone » Fri Oct 01, 2010 3:25 am

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...


Return to “Awasu - Extensions”

Who is online

Users browsing this forum: No registered users and 8 guests