473,785 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems getting attribute xlink:href in Safari browser

I have managed to get the xml to load using the xmlHTTPrequest. ..
(inspite of premature readyState 4) the problem now arises
in Safari alone...

var thelink = node.getAttribu te("xlink:href" )

Works in other browsers... except Safari, where
it always returns null

Any ideas?
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Oct 5 '05 #1
4 4002


Lance Dyas wrote:

var thelink = node.getAttribu te("xlink:href" )


Assuming the prefix xlink is bound to the namespace URI
http://www.w3.org/1999/xlink you could try

var theLink;
if (typeof node.getAttribu teNS != 'undefined') {
theLink = node.getAttribu teNS('http://www.w3.org/1999/xlink', 'href');
}
else {
theLink = node.getAttribu te('xlink:href' );
}

I don't have time to test that now with a Safari browser but if you are
scripting XML with namespace then the namespace relevant methods of DOM
Level 2 like getAttributeNS or getElementsByTa gNameNS should be used if
supported by the implementation.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 5 '05 #2
Thanks for the response... my exposure to SVG and scripting within
its various implementations had me trying almost exactly that as of a
month ago there was no joy in Safari (or any other browser for the name
space method), but since there have been a few Safari patches
since then, I might give it another go.

Martin Honnen wrote:


Lance Dyas wrote:

var thelink = node.getAttribu te("xlink:href" )


Assuming the prefix xlink is bound to the namespace URI
http://www.w3.org/1999/xlink you could try

var theLink;
if (typeof node.getAttribu teNS != 'undefined') {
theLink = node.getAttribu teNS('http://www.w3.org/1999/xlink', 'href');
}
else {
theLink = node.getAttribu te('xlink:href' );
}

I don't have time to test that now with a Safari browser but if you are
scripting XML with namespace then the namespace relevant methods of DOM
Level 2 like getAttributeNS or getElementsByTa gNameNS should be used if
supported by the implementation.


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Oct 5 '05 #3
Just wanted to mention this worked quite nicely, it is a good sign when
browsers do start paying attention to standards!

Martin Honnen wrote:


Lance Dyas wrote:

var thelink = node.getAttribu te("xlink:href" )


Assuming the prefix xlink is bound to the namespace URI
http://www.w3.org/1999/xlink you could try

var theLink;
if (typeof node.getAttribu teNS != 'undefined') {
theLink = node.getAttribu teNS('http://www.w3.org/1999/xlink', 'href');
}
else {
theLink = node.getAttribu te('xlink:href' );
}

I don't have time to test that now with a Safari browser but if you are
scripting XML with namespace then the namespace relevant methods of DOM
Level 2 like getAttributeNS or getElementsByTa gNameNS should be used if
supported by the implementation.


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Oct 6 '05 #4
Lance Dyas said the following on 10/5/2005 8:15 PM:
Just wanted to mention this worked quite nicely, it is a good sign when
browsers do start paying attention to standards!


Now, if we can just get posters to read and adhere to desired practices
as explained in the groups FAQ. See signature below.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Oct 6 '05 #5

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

Similar topics

1
2180
by: Bernd Oninger | last post by:
As far as I know one could use other xsd schemas with the import and the xlink feature. What are the differences (beside the syntax)? Bernd
1
3083
by: 3W | last post by:
How does one get the browser's width using standards compliant Javascript 1.5/ECMAScript?
7
9213
by: Weston C | last post by:
I'm trying to get the href attribute from the base tag in the document head. The following does not seem to work... any ideas what I'm doing wrong? if(!(document.getElementsByTagName) || !(basehrefs = document.getElementsByTagName('base')) || !(basehrefs.length) || !(basehrefs.length > 0) || !(basehrefs.getAttribute) || !(basehref = basehrefs.getAttribute('href')) )
3
2502
by: Kevin Matthews | last post by:
i'm having strange problems with browser compatibility between firefox and internet explorer, ---------------------------------------- The following is the CSS: ---------------------------------------- body { font-family: Verdana, Arial, Helvetica, Sans-serif; font-size: 80%; background-color: #FFFFFF;
2
1240
by: Prasad Dannani | last post by:
Hi, I want to know the browser settings like Image Enabled, Cookie Enabled etc., For Cookies and Script Request object has some properties but after disabling certain features also we are getting the same results. Please help on the way of tracking the image disabled option ASAP.
2
1964
by: adMjb | last post by:
Hi Any help would be fantastic I have a simple problem but I cant work it out... DOHH...., this is my XML: <?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/css" href="BSI%20Test.css"?> <document xmlns:xlink="http://www.w3.org/1999/xlink"
4
4764
by: jvanulden | last post by:
Hello all, I am having difficulty figuring out how to create an XmlElement and giving it an attribute that requires a namespace. Here is what I have so far which throws an exception because you can't have a : in an attribute name??? XmlElement eOnlineResource = m_context.CreateElement("OnlineResource"); eOnlineResource.SetAttribute("xlink:href", "http://www.w3c.org/1999/xlink", sldUrl);
1
1660
by: kaye80 | last post by:
I have an XML and XSL document. I am trying to incorporate hyperlinks throughout the XML document. I have read many of the related posts on this and other forums but I can't seem to get it right. Please help! Do I have to declare the namespace in the XSL doc also as shown below or should I take it out? No matter what I do, nothing appears for the link tag in the browser. a piece of my xml DOC (using google for now as an easy example but...
6
1554
by: paulsparrow | last post by:
Loaded Apache and PHP on a Windows XP box. Apache is working fine. However when I load a .php page I get a "Forbidden Warning You don't have permission to access /php/php.exe/Chapter03/handle_form.php on this server." Any idea what I need to configure?
0
9645
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10330
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9952
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8976
agi2029
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...
1
7500
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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
2
3654
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.