473,772 Members | 2,292 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

parsing the <link> element tag

I am attempting to parse and xml file using javascript but am running
into a problem when parsing a <link></link> pair. For example, the
link information in most RSS feeds is given as

<link> http://www.something.com/someotherstuff </link>

However, when I use item.getElement sByTagName("lin k"), I get an empty
HTMLLinkObject back and if I print the innerHTML property of item, the
<link> tag shows up but not the </link> tag. Does anyone know of a
javascript solution to this?

Thanks,
-Doug

Jun 23 '06 #1
1 1965
Do**********@gm ail.com wrote:
I am attempting to parse and xml file using javascript but am running
into a problem when parsing a <link></link> pair. For example, the
link information in most RSS feeds is given as

<link> http://www.something.com/someotherstuff </link>

However, when I use item.getElement sByTagName("lin k"), I get an empty
HTMLLinkObject back and if I print the innerHTML property of item, the
<link> tag shows up but not the </link> tag. Does anyone know of a
javascript solution to this?


<script type="text/javascript">
if (window.ActiveX Object) {
xmlDoc = new ActiveXObject(' Microsoft.XMLDO M');
xmlDoc.async = false;
xmlDoc.load('fi le.xml');
doAlert();
}

else if (document.imple mentation
&& document.implem entation.create Document) {
xmlDoc = document.implem entation.create Document('', '', null);
xmlDoc.load('fi le.xml');
xmlDoc.onload = doAlert;
}

else {
alert('Browser can´t support script!');
}

function doAlert() {
alert(xmlDoc.ge tElementsByTagN ame('link')[0].firstChild.nod eValue);
}
</script>

--
Bart

Jun 24 '06 #2

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

Similar topics

9
2961
by: Francesco Moi | last post by:
Hello. I'm trying to build a RSS feed for my website. It starts: ----------------//--------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd"> <rss version="0.91"> ----------------//----------------------
6
17167
by: Todd Peterson | last post by:
I'm encountering some wierd behavior with a <link> tag over an HTTPS connection, vs. an HTTP connection... In an ASP/HTML page on my website, I've add a <link rel="shortcut icon"...> in order to allow the users to add a shortcut (with icon) on their desktop, as well as seeing the icon in the URL. Our development server allows both HTTP and HTTPS connections, but the icon only appears to be available when requesting the page via HTTP???...
2
1814
by: brw | last post by:
Is there a way to dynamically add a link tag to the head block of an ..aspx page? I'm aware that you can add a link tag (or literal control) statically and then dynamically modify the attributes. I'm wondering if there's a way to add the tag from scratch at run time. thanks, Ben
2
1740
by: Gopalan | last post by:
Hi I was using <link href="...." type="..."> tag inside the .aspx file. When I converted this aspx file to ascx file and use it in an aspx file it is not working properly. Please tell me where to put it. Thanks
1
2381
by: Baldoni | last post by:
It's been years since putting together a page. This line in my HTML: <link type="text/css" rel="stylesheet" href="net4801style.css"> gives this problem (via weblint HTML checker): attribute 'TYPE' for <link> is extended markup (use -x <extension> to do this). Where might be found a resource, for simple folk, explaining how to best correct this?
4
2023
by: John A Grandy | last post by:
When constructing an RSS 2.0 XML doc , should the <channel><link> element's value be 1. the url of the page the displays the content that the RSS feed describes : fox example: http://www.myecommerce.com/results.aspx/?keywords=mens+dress 2. the url of the page which generates an up-to-date version of the RSS doc :
6
1491
by: Spartanicus | last post by:
I'd like to execute a function when a <link rel="next" href="foo.htm"> type element is used. Although the "onclick" handler is allowed on the element, presumably because the functionality of the element is made available through a browser provided navbar the function doesn't execute when using the element. Anyone know if this is possible? -- Spartanicus
9
6906
by: Arancaytar | last post by:
I have so far seen two methods for including external resources as CSS stylesheets in a document. The first is this: <link href="/stylesheets/style.css" rel="stylesheet" type="text/css" /> And the second is this: <style type="text/css"> @import "/stylesheets/style.css"; </style>
1
8394
by: Rick | last post by:
Hello, The masterpage of the site has a <divelement that encloses the "content" of the actual aspx page. The content page has a <linkelement. When I try to switch from "source" view to "design" view, the following error message prevents me from going to "design" view:
0
9454
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
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
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,...
0
9914
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
8937
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...
0
6716
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
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...
1
4009
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
3
2851
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.