aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes XML DOM is  not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "XML DOM is  not working" Watch "XML DOM is  not working" New topic
Author

XML DOM is not working

Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

Hi,

I am using windows 7 ultimate and I am leraning XML DOM in these days. But by XML DOM file is not working. I saved the XML file as "EMP.xml" and save the javascript file which has the DOM objects as "EMP.html". Please have a look at the following codes

EMP.xml






EMP.html



I tried this in IE, FF, Opera, Google crome but nothing happened. No errors, just an empty page. Please help me

Thanks


Are you better than me? Then please show me my mistakes..
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

Well first of all (because of the use of Active-X) I wouldn't expect this to have a chance of working in any browser except IE.

And let me also point out that "EMP.xml" is extremely ambiguous -- you have tens of thousands of directories on your machine and it could be in any of them. However what really counts -- if IE's security even permits it to be accessed at all -- is whether it's in the current working directory of the browser. Which you don't know what that is.

Let me move this to the HTML/Javascript forum because the issues are mostly about Javascript.
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

I also think that they may not working in other browsers, but this is a XML DOM issue, which is XML DOM object used inside javascript. So, anyone can help me please?
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

Can someone help me please?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

Yohan Weerasinghe wrote:Are you better than me? Then please show me my mistakes...


I thought I did. Or at least suggested them. But you've basically just blown that off and insisted it's something to do with the DOM.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
As Paul said ActiveX is IE only
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

OK guys, but the problem is, as mentioned, I am a XML learner. And this is 100% pure code from my book. This code worked in SOME machines of my university(YES IE ONLY). BOTH XML and JAVASCRIPT are 100% purely extracted from the book. Why it is not working IN my machine? However this didn't work in many machines there too
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

Works in some IE installations but not in others? Most likely security settings, then.

As for learning XML, I wouldn't consider Active-X a useful tool for that. More of a distraction, really, as you can see from the problems you are encountering which have nothing to do with XML. Learning about browser security could certainly be useful, but if your goal is to learn about XML my suggestion would be to declare this exercise finished and move on to the next chapter of your book.
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

Seriously yes This is 100% crazy.. But unfortunately this is in my degree program and will definitely pop up in my exam as well as in XML project..oh mannn
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

I am sure Active-X is an outdated technology. if that is not working with other browsers, who need to use that?
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 535
    
    3
To make it work, first thing you can try is to replace the progid to a version independent one. Not that it is a very good thing to do, but with your simple kind of exercise and without broader picture of the technology in mind, do this to start with.
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

g tsuji wrote:To make it work, first thing you can try is to replace the progid to a version independent one. Not that it is a very good thing to do, but with your simple kind of exercise and without broader picture of the technology in mind, do this to start with.


Thanks for the reply. But still no good.

Is there is any error with this code?
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 535
    
    3
Then you look at the ie's security zone setting. Click out Tools->Internet Options, and tab to Security. Click on the custom level button and scroll the window to the setting called "Run ActiveX Controls and Plug-ins". Select the radio button "enable".
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

g tsuji wrote:Then you look at the ie's security zone setting. Click out Tools->Internet Options, and tab to Security. Click on the custom level button and scroll the window to the setting called "Run ActiveX Controls and Plug-ins". Select the radio button "enable".

Many thanks for your reply. But still no good. Seems like this is some kind of outdated technology. Anyway, are you using W7 and if, is this is working in your machine?
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 535
    
    3
It is funny to hear insisting activex is an out-dated technology so lightly as if it is already nothing no more. If you think so, making it work is of no value, so why looking? why not join the camp with the easy slogan of "using a real browser"? (Check if msxml2 is installed at all, probing the registry to ascertain what kinds of vesion are installed side-by-side... etc. Then have a check on UAC might have a bearing as well...)
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

Yohan Weerasinghe wrote:I am sure Active-X is an outdated technology.


I wouldn't call it "outdated". I would call it a "niche technology" -- although the way Microsoft has been focusing on having their browsers comply with web standards lately, they might be de-emphasizing non-standard things like Active-X. That's just irrelevant speculation for you, though, since unfortunately it appears you have to learn about it.
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

Ya, No use of learning this I guess. I stopped studying that book. Just a wastage of time
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
g tsuji wrote:It is funny to hear insisting activex is an out-dated technology so lightly as if it is already nothing no more. If you think so, making it work is of no value, so why looking? why not join the camp with the easy slogan of "using a real browser"? (Check if msxml2 is installed at all, probing the registry to ascertain what kinds of vesion are installed side-by-side... etc. Then have a check on UAC might have a bearing as well...)


Just remember that MS is the one that came up with the XMLHttpRequest object.

A lot of people bust on IE6, but back in its day, the browser was ground breaking and there were no real specs, they were making them up with Netscape. :)

Eric
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 535
    
    3
If people think I am looking down on ie6 or msxml2, they get me completely wrong. Many of those who now use xmlhttprequest have no idea the effort of cloning the ground-breaking msxml2.xmlhttp and they want to reversing the achievement by verbiage.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

To give credit where credit is due, the idea behind (what has come to be known as) Ajax was brilliant. But, as usual, Microsoft's implementation sucked. True to form, the implementation was IE-only (ergo Windows-only), and it took the other browser vendors to take the idea and implement in a standard way that could be used across browsers. Then we, as page authors, just have to bide our time and wait for Microsoft to (maybe) (someday) adopt the standards-compliant implementation so that we don't have to do detection on our pages.

Thank goodness for libraries such as jQuery and Dojo that help to level the playing field.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 499

Bear Bibeault wrote:To give credit where credit is due, the idea behind (what has come to be known as) Ajax was brilliant. But, as usual, Microsoft's implementation sucked. True to form, the implementation was IE-only (ergo Windows-only), and it took the other browser vendors to take the idea and implement in a standard way that could be used across browsers. Then we, as page authors, just have to bide our time and wait for Microsoft to (maybe) (someday) adopt the standards-compliant implementation so that we don't have to do detection on our pages.

Thank goodness for libraries such as jQuery and Dojo that help to level the playing field.


You mean Microsoft introduced Ajax? wow!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

The idea behind Ajax was created in order to implement OWA (Outlook Web Access). It was a great idea. Too bad they flubbed it up.
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 535
    
    3
The word "ajax" in this context carries a sin originelle that as far as I am concerned haunts it forever is that it did not give pertinent credit where credit should go from the day of its inception. Standard? It sounds that much innocent! But this is not the place to reflect on alternative socio-political aspects of technology.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

The acronym AJAX was coined by Jesse James Garrett back in the mid 2000's to describe the technology as XMLHttpRequest was too much of a mouthful. It has since been word-ized as Ajax and that's the term applied to the technology these days.

The name of the object itself is frequently abbreviated to XHR.

My only issue with all these names is the X for XML. XHR and Ajax are not restricted to just XML, in fact, I see JSON used a lot more with Ajax than XML these days.

g tsuji wrote:But this is not the place to reflect on alternative socio-political aspects of technology.

As the moderator of this forum, I say that this discussion is fine and can continue along its present course.
 
Consider Paul's rocket mass heater.
 
subject: XML DOM is not working