473,671 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XMLDocument - Driving me nuts!!

Ok, this really is driving me nuts!!! :(
'All' I am trying to do is get the value of a named element. My XML doc
is:

<?xml version="1.0" encoding="utf-16" standalone="yes " ?>
- <Page>
<Title>Test</Title>
<MetaKeywords>T est</MetaKeywords>
<MetaDescriptio n>Test</MetaDescription >
<Content>Test </Content>
- <Audit>
<LastUpdateBy />
<LastUpdateDate >08/05/2005 09:25:32</LastUpdateDate>
</Audit>
</Page>

So, I want to get the value of the title element - Should return 'Test'.
Heres my code:

Public Sub LoadFromXML(ByV al strXMLFileLocat ion As String)
Me.XMLFileLocat ion = strXMLFileLocat ion
'Dim XMLFileStream As New FileStream(strX MLFileLocation,
FileMode.Open)
Dim XMLDoc As XmlDocument = New XmlDocument
XMLDoc.Load(str XMLFileLocation )
Dim myXMLNodeList As XmlNodeList =
XMLDoc.GetEleme ntsByTagName("T itle")
Me.Title = myXMLNodeList.I tem(0).InnerTex t() <-- This
fails
with error: Object reference not set to an instance of an object.

I've also tried using ...item(1)... - Same error.
Note that this:
Me.Title = myXMLNodeList.C ount.ToString
Returns a value of 1 - So I guess the XML document is found and loaded
correctly.
Any help will be appreciated.

Simon.
--
I am using the free version of SPAMfighter for private users.
It has removed 2212 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!
Nov 19 '05 #1
0 971

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

Similar topics

6
1605
by: Keiron Waites | last post by:
Please see the problem in action here: http://www.leadbullet.biz/contact.php If you mouse over the fields, you will see that text is shown on the right. The text makes the other fields move when it is shown - even though the width of the text is less than the width of the field. WHY? This is driving me nuts - please help! TIA,
12
1599
by: Marty | last post by:
It seems all of the sudden that user controls that contain images are referencing image sources relative to the document that I drop the control on. This obviously does not work beacuase the image source is relative to the user control, not necessarily the form. Can anyone tell me why this would be the case?
0
877
by: Simon Harris | last post by:
Ok, this really is driving me nuts!!! :( 'All' I am trying to do is get the value of a named element. My XML doc is: <?xml version="1.0" encoding="utf-16" standalone="yes" ?> - <Page> <Title>Test</Title> <MetaKeywords>Test</MetaKeywords>
4
1649
by: trond | last post by:
Hello all, Before I start I'd like to point out that I am a complete novice when it comes to asp.net - My background is in network and operating systems, and although I have been doing a bit of hobby programming in vb.net and web programming in asp/vbscript in the past, I am pretty much a beginner at asp.net. What I'm trying to do, is to take the "PersonalHomePage" starter kit that MS supplies with VS2005 and tweak it a bit, to make it...
1
1564
by: windandwaves | last post by:
Hi I have the following file: --myfile.php <?php if($s) { echo $s; session_id($s); session_start;
2
1510
by: mitsura | last post by:
Hi, I need to read a simle XML file. For this I use the SAX parser. So far so good. The XML file consist out of number of "Service" object with each object a set of attributes. I read through the XML file and for each "<Service>" entry I create a new service object. When I am in the "<Service>" part of the XML file and I encounter
4
2471
by: mattlightbourn | last post by:
Hi all, I have a problem which has been driving me nuts. Crosstab queries! I have a database witch a few different tables to do with garment manufacturing. I have a table for a client account, garment type (Jacket, skirt, etc), client sizing spec and descriptives (measurement names i.e: Shoulder to cuff, inside leg, etc), available sizes (ie. 4,6,8,10,12,14,16,18,20,S,M,L,SM,ML,One) and pattern adjustments (if size 10 is the base, the...
3
2284
by: DuncanIdaho | last post by:
Hello experts IE 7.0.5730.11 Opera 9.27 Firefox 2.0.0.14 This problem only occurs in Opera and Firefox (amazing, IE does something right, or maybe not) Anyway, the problem is that when I put an image in a <divor a <td>
0
8401
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
8926
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
8824
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...
0
8673
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
7444
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
6236
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
5703
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
4227
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
2818
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 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.