473,545 Members | 2,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

E4X/Firefox 1.5: problem using default xml namespace

I've been interested in E4X because my company has an XML schema that
we usually manipulate through a Java mapping generated by Castor, which
I think is fairly tedious, and which means you have to do everything in
the webapp. I think it'd be cool to suck in the XML, tweak it in the
browser, then use a SOAP call to submit it to the server.

Anyhow, we use namespaces on all our elements, and I was trying to
avoid using the "ns::elementnam e" notation if I didn't have to. I
thought that calling "default xml namespace = 'our.namespace' " would
let us do that. In other words, I could do something like this:

var a = <n:abc
xmlns:n="urn:so mething"><n:foo >1</n:foo><n:foo>2</n:foo></n:abc>;
default xml namespace = "urn:something" ;
alert(a.foo);

However, running that inside a function in a web page returns an empty
string. But the following:

alert(eval("a.f oo"));

returns what I expect, which is this:

<n:foo xmlns:n="urn:so mething">1</n:foo>
<n:foo xmlns:n="urn:so mething">2</n:foo>

I tried an example with both of these:

alert(a.foo);
alert(eval("a.f oo"));

But if they are in the same method, "a.foo" returns the same thing as
"eval('a.foo')" , which is mighty strange. Even if I do:
alert(a.foo);
eval("");

I get it to work. That tells me there is something about the parsing of
the expression that is going awry, but the presence of the eval("")
makes it work OK.

My Mozilla version is: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

I tried Rhino 1.6R2 and I get the behavior I expect, with the eval or
not.

Mar 14 '06 #1
1 2112


Bob Tinsman wrote:
var a = <n:abc
xmlns:n="urn:so mething"><n:foo >1</n:foo><n:foo>2</n:foo></n:abc>;
default xml namespace = "urn:something" ;
alert(a.foo);


The problem seems only to occur if that code is executed in function
scope. Nevertheless it is a bug in my understanding so I have filed a
bug report
<https://bugzilla.mozill a.org/show_bug.cgi?id =330572>
--

Martin Honnen
http://JavaScript.FAQTs.com/
Mar 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3479
by: Matthias Huening | last post by:
Hi, os.startfile('http://www.python.org') works fine on WinXP with IE as default webbrowser. With Mozilla Firefox 0.9 as default webbrowser, however, I get an error. Firefox starts, the page gets loaded and then Python gives me an error message (Traceback below). The same is true for the webbowser module. Is this a Python problem or a...
3
1606
by: ~~~ .NET Ed ~~~ | last post by:
This is a strange problem and I wonder if anybody has experienced this annoying anomaly. I created a new ASP.NET project with its web-shared directory on my WinXP Pro/IIS machine. I compile the project and everything is fine so far. Accessing the default page with Internet Explorer 6.0 shows the page as expected. I am however using...
3
2865
by: Yair Cohen | last post by:
hello 1 i use an xml documet with xml schema but when i try to use XPath (selectnodes) it retrieves empty list. when i remove the schema (the 'xmlns="http..."') i get the data. how can i handle this ? using xmlDocument.documentElement.selectNodes("PROP") something like this:
8
2402
by: acb | last post by:
Hi, I wrote a DLL Component (using Visual Studio 2005) and managed to include it into a C# Console application. I am now trying to include this component into a Web project. I copy the DLL into the bin directory but am not able to progress. Can anyone please guide me to an online tutorial on the subject. Thanks,
12
2469
by: wangzx | last post by:
I am the author of easyajax.sourceforge.net, and I have a problem on Firefox 1.5, I post the problem here and hopes somebody help me. The test page can be: http://easyajax.sourceforge.net/demo/overview.html The page works well in Firefox 1.0.* and IE 6.0, and Opera 8.5, but it doesnt work on Firefox 1.5, the first time you open the page,...
5
5974
by: mic123 | last post by:
I am creating an xml document using XMLOutputter in JAVA, then displaying the xml file in Firefox browser. My problem is that I want to simply display the XML as idented text, but the browser adds "-" signs to the text. So when I try to copy+paste the text I also get the "-" signs with it. Can I cause the browser to display an idented XML...
1
6393
by: p8000 | last post by:
This browser seems to have so many problems. One more: I try to have this Fire browser (version 2.0.0.1) as Not default, but so far, without success. How can I have this browser as not default browser?. What are the steps to do this?. Do I have to delete it from the hard drive and then re-install it?. I'd like to have the chance to use other...
7
2529
by: Carlos Mendonça | last post by:
Has anyone managed to get ClickOnce to work with Firefox? It seems to me that it still has the same issues VS 2K5 had. I appreciate any comments or tips.
1
1806
by: shidhincr | last post by:
I have some doubts regarding XML and XSL transfornation using javascript.Hope SomeOne will help me for solving this problem. Actually i Created a javascript for transforming XML and XSL. i made a new class in the javascript and i added the object of that particular class and a namespace into the processor by using the method ...
0
7499
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7689
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7456
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7786
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5359
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3490
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.