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. 1 2129
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/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 Firefox
problem?
Matthias
|
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 FireFox as my browser (don't ask why). Using
FireFox 1.0 on the new ASP.NET project brings up an...
|
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:
|
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,
|
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, it works
well, but when you refresh the page(such as CTRL-R), the page will
displayed in bad way.
| |
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 text without the "-"
signs??
|
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 browsers,
when I want.
I have Mac OSX 10.4.8.
...
|
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.
|
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 processor.addObject(object,namespace) . It works fine in
Internet Explorer. So that i could call a function of...
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |