473,320 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Read some XML tags

I'm rather new to working with XML in .NET and have been doing all the
reading I can handle. Perhaps, it's the format of the XML that is
confusing me but....

<event type="system" time="14:23:15" vcrTime="00:00:00"
digitalTime="00:00:01">
<text><![CDATA[Start Cap:14h23m14s.asf on 2006-03-06]]></text>
</event>

I have the following code to get each "event" tags by name and then
loop through and I know how to get the entire <eventtag and the
<texttag. Other than parsing through the text in the <eventtag, is
there an elegant way to get the digitalTime value for example?

Dim settings As New XmlDocument

settings.Load(strXMLfile)
Dim elemlist As XmlNodeList =
settings.GetElementsByTagName("event")
Dim eventchild As XmlNode

For Each eventchild In elemlist

...Do something here

Next
Thanks for the help, Chris

Aug 23 '06 #1
3 1266


Stupid48 wrote:

<event type="system" time="14:23:15" vcrTime="00:00:00"
digitalTime="00:00:01">
<text><![CDATA[Start Cap:14h23m14s.asf on 2006-03-06]]></text>
</event>
Dim settings As New XmlDocument

settings.Load(strXMLfile)
Dim elemlist As XmlNodeList =
settings.GetElementsByTagName("event")
Dim eventchild As XmlNode

For Each eventchild In elemlist
For Each eventElement As XmlElement In elemlist
Dim time As String = eventElement.GetAttribute("digitalTime")
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 23 '06 #2
Perfect, thank you....

Martin Honnen wrote:
Stupid48 wrote:

<event type="system" time="14:23:15" vcrTime="00:00:00"
digitalTime="00:00:01">
<text><![CDATA[Start Cap:14h23m14s.asf on 2006-03-06]]></text>
</event>
Dim settings As New XmlDocument

settings.Load(strXMLfile)
Dim elemlist As XmlNodeList =
settings.GetElementsByTagName("event")
Dim eventchild As XmlNode

For Each eventchild In elemlist

For Each eventElement As XmlElement In elemlist
Dim time As String = eventElement.GetAttribute("digitalTime")
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 23 '06 #3
Stupid48 wrote:
I'm rather new to working with XML in .NET and have been doing all the
reading I can handle. Perhaps, it's the format of the XML that is
confusing me but....

<event type="system" time="14:23:15" vcrTime="00:00:00"
digitalTime="00:00:01">
<text><![CDATA[Start Cap:14h23m14s.asf on 2006-03-06]]></text>
</event>
The CDATA section is unnecessary here and is evidence that the creator
of the XML didn't have much of a clue what was going on.

Before getting in too deep, try to get the data model improved.

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Aug 23 '06 #4

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

Similar topics

2
by: Anthony Liu | last post by:
I have a news corpus that looks like the following. I want to do a statistical survey of the words used in the news report per se. So, I must not consider those words in the XML tags. I know...
1
by: Sphere | last post by:
Hi I'd like to read out the ID3 V2 tags from my music files (like mp3, wma, ogg, ... is there a possibility to do that?
6
by: George Hester | last post by:
This location has a parasite checker using javascript. It is in a js file called parasite.js. It is freely available. http://www.doxdesk.com/parasite/ He\She is the only one I trust on the...
6
by: Karthik | last post by:
I am trying to read Http request body values NOT form values The content type is text/xml and its POST I am posting data from Infopath to an asp.net page. In ASP it works by just writing...
5
by: Emmanuel | last post by:
Hi there, My client would like to process an xml file. the structure of which is as below. <xml> <stockitem> <releaseddate>.....date value...</releaseddate> <...aditional tags for additional...
5
by: mesh2005 | last post by:
I'm new to C# , I use MS visual studio.NET 2003. I have some TIFF images, I want to write a program using c# that reads an image (.tiff) and prints all its tags. can anyone guid me to the right...
1
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and...
0
by: Hyunchul Kim | last post by:
Dear all, How can I read a pdf file and add invisible comment? I want to make a script which read a pdf file and add tags inside the file invisibly. Then, I will make a script for managing tags...
2
by: gachsaran | last post by:
Hi I have some mp3 files and i want to write a program to read alle information regarding singers, name of song, and other technical info. and write them to my database. I need to read tags...
1
Markus
by: Markus | last post by:
Before you post please: Turn on PHP Debugging Messages - this will help yourself and our experts to solve your problem. Please provide the error details in your post. Read the Posting...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.