.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

The Star & the Crescent- Save $9.00
winSPWW2- Save $6.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening > Scenarios, Maps and Mods

Reply
 
Thread Tools Display Modes
  #11  
Old November 14th, 2007, 03:23 AM
Edi's Avatar

Edi Edi is offline
National Security Advisor
 
Join Date: Oct 2003
Location: Helsinki, Finland
Posts: 5,425
Thanks: 174
Thanked 695 Times in 267 Posts
Edi is on a distinguished road
Default Re: Spell Guide Beta-0

Burnsaber, actually I've had nothing to do with this. The reason you're seeing the true/false values in Finnish is that you're using a Finnish language version of Excel, it translates the formula and the output. Nifty little tool, this one. I couldn't have done that, since I'm not current on the intricacies of spell modding.
Reply With Quote
  #12  
Old November 14th, 2007, 03:26 AM

Snoddasmannen Snoddasmannen is offline
Private
 
Join Date: Nov 2007
Posts: 35
Thanks: 7
Thanked 20 Times in 5 Posts
Snoddasmannen is on a distinguished road
Default Re: Spell Guide Beta-0

Quote:
lch said:
First thing to do, serve the right content type. Currently the xmlspells.php script returns the Content-Type: text/html, while it should be text/xml. You can set the right content-type via header()
Ah, nice one lch! Fixed that, so now it ... kinda ... works in firefox. For some reason, firefox doesn't pick up on the fact that the replacement div has the 'spelldiv' id, so it isn't styled properly. And even worse, when it tries to replace spelldiv the next time, it simply fails since it can't find it But you can get a list now in firefox, though it doesn't look like much of a list, and you have to reload the page to do a second search.

Any ideas on what I could do to fix that would, yet again, be much appreciated.

jimkehn and DrPraetorious, are you having problems in Opera or are you using some other web browser? Obviously, for the 99% of the world who are not yet using Opera, the page has some problems for now
Reply With Quote
  #13  
Old November 14th, 2007, 06:42 AM
lch's Avatar

lch lch is offline
General
 
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
lch is on a distinguished road
Default Re: Spell Guide Beta-0

Quote:
Snoddasmannen said:
jimkehn and DrPraetorious, are you having problems in Opera or are you using some other web browser? Obviously, for the 99% of the world who are not yet using Opera, the page has some problems for now
If you care about your visitors at all you should either use a cross-browser solution like the last two mentioned in http://ajaxpatterns.org/Browser-Side...World_Examples or better yet change to server-side XSLT and a form.
__________________
Come to the Dom3 Wiki and help us to build the biggest Dominions-centered knowledge base on the net.
Visit my personal user page there, too!
Pretender file password recovery
Emergency comic relief
Reply With Quote
  #14  
Old November 14th, 2007, 09:20 AM
DrPraetorious's Avatar

DrPraetorious DrPraetorious is offline
Major General
 
Join Date: Feb 2005
Location: Lake of Hali, Aldebaran, OH
Posts: 2,474
Thanks: 51
Thanked 67 Times in 27 Posts
DrPraetorious is on a distinguished road
Default Re: Spell Guide Beta-0

"Exception while loading: SpellDiv has no properties."

IE just sits there slackjawed and drools, but that's not a surprise
__________________
If you read his speech at Rice, all his arguments for going to the moon work equally well as arguments for blowing up the moon, sending cloned dinosaurs into space, or constructing a towering *****-shaped obelisk on Mars. --Randall Munroe
Reply With Quote
  #15  
Old November 14th, 2007, 01:42 PM

Snoddasmannen Snoddasmannen is offline
Private
 
Join Date: Nov 2007
Posts: 35
Thanks: 7
Thanked 20 Times in 5 Posts
Snoddasmannen is on a distinguished road
Default Re: Spell Guide Beta-0

Quote:
lch said:
If you care about your visitors at all you should either use a cross-browser solution like the last two mentioned in http://ajaxpatterns.org/Browser-Side...World_Examples or better yet change to server-side XSLT and a form.
Hihi, that's a fair point!

My priority right now is learning and exploring some interesting web technologies. Using a pre-packaged framework is not very interesting for me since I wanted to start with the basics. Using server side XSLT is indeed something I have considered as a fallback, and I'll probably end up there if I find time/interest to finalize this thing.

Quote:

"Exception while loading: SpellDiv has no properties."

Yeah that's from firefox right? It's weird. Using the firefox dom inspector, I can clearly see the spell div, spell table and all the spells nicely tucked in there with the images and everything. But visually it still looks like it's just dumped the whole xml document in there without any xslt transformation. And getElementById('spelldiv') returns null ...
Reply With Quote
  #16  
Old November 14th, 2007, 02:28 PM
lch's Avatar

lch lch is offline
General
 
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
lch is on a distinguished road
Default Re: Spell Guide Beta-0

Quote:
Snoddasmannen said:
Yeah that's from firefox right? It's weird. Using the firefox dom inspector, I can clearly see the spell div, spell table and all the spells nicely tucked in there with the images and everything. But visually it still looks like it's just dumped the whole xml document in there without any xslt transformation.
I guess that's because you are overwriting the element in Code:
parent.replaceChild(result.firstChild,spellDiv);

instead of overwriting the innerHTML element or something like that. Usually Mozilla is the closest to implement the specifications, so I guess that you're doing it wrong.

Here's what the element looks like before the replace:

and here's what it looks like afterwards:
__________________
Come to the Dom3 Wiki and help us to build the biggest Dominions-centered knowledge base on the net.
Visit my personal user page there, too!
Pretender file password recovery
Emergency comic relief
Reply With Quote
  #17  
Old November 14th, 2007, 06:45 PM

Snoddasmannen Snoddasmannen is offline
Private
 
Join Date: Nov 2007
Posts: 35
Thanks: 7
Thanked 20 Times in 5 Posts
Snoddasmannen is on a distinguished road
Default Re: Spell Guide Beta-0

Hihi, actually you can make it look fine in firefox by opening firebug and having a look at the BODY tag's innerhtml attribute. Just doubleclick on it and leave the field without changing anything. I assume this forces an update of some internal structure and voila the table appears nicely. So obviously some FF quirk involved here.

There's probably an easy workaround to force it to do that without using firebug.

Apparently no support in FF2 yet for the nth-child-of css pseudoclass, so all the lines are white

By the way, it's quite likely that I'm doing some kind of corner case here which is poorly defined in the specs. Or at least working in a way which is not well explored or commonly used. Obviously firefox has excellent support for this kind of stuff in general.

EDIT: Added this line:
Code:
document.firstChild.innerHTML += "";


So now it actually works in firefox as well
Reply With Quote
  #18  
Old November 14th, 2007, 07:30 PM
lch's Avatar

lch lch is offline
General
 
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
lch is on a distinguished road
Default Re: Spell Guide Beta-0

This workaround resets the whole formular, though, all the values are reset to zero. Don't use workarounds as solution.

If you want to have it working in Mozilla, then you should have read how Mozilla handles these things first. Your first problem is already mentioned in there:
Quote:
Mozilla requires that you send the XML and XSLT files with an XML mimetype (text/xml or application/xml). This is the most common reason why XSLT won't run in Mozilla but will in Internet Explorer. Mozilla is strict in that way.
The second problem is that you're replacing a DOM node by something of a different type. If I am reading the last paragraph in that article right then you can probably use transformToFragment() to have it working correctly. You are trying to put a DOM document into another one, not good.
__________________
Come to the Dom3 Wiki and help us to build the biggest Dominions-centered knowledge base on the net.
Visit my personal user page there, too!
Pretender file password recovery
Emergency comic relief
Reply With Quote
  #19  
Old November 14th, 2007, 09:24 PM
jimkehn's Avatar

jimkehn jimkehn is offline
Second Lieutenant
 
Join Date: Mar 2007
Posts: 559
Thanks: 1
Thanked 0 Times in 0 Posts
jimkehn is on a distinguished road
Default Re: Spell Guide Beta-0

snoddasmannen, I get:

Exception while loading: [object error]
Reply With Quote
  #20  
Old November 15th, 2007, 03:17 AM

Snoddasmannen Snoddasmannen is offline
Private
 
Join Date: Nov 2007
Posts: 35
Thanks: 7
Thanked 20 Times in 5 Posts
Snoddasmannen is on a distinguished road
Default Re: Spell Guide Beta-0

Quote:
lch said:
The second problem is that you're replacing a DOM node by something of a different type. If I am reading the last paragraph in that article right then you can probably use transformToFragment() to have it working correctly. You are trying to put a DOM document into another one, not good.
Actually I'm putting the firstChild of a dom document, ie the spelldiv, into another document. The resulting dom tree is obviously correct, but Mozilla isn't updating it correctly for some reason.

Doesn't make any sense to me why I would need to specify the destination document of a node at the time of creation, but on the other hand XSLTProcessor is a mozilla invention so they can do whatever they want with it.

But enough whining, I switched to transformToFragment() and yay it seems to work even without the ugly workaround! Thanks lhc!

jimkehn, which browser are you using?
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 10:27 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.