473,406 Members | 2,217 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,406 software developers and data experts.

Reading a XML tag that is not constant

maylortaylor
72 64KB
I have a small backup program that has a text box labled "JobName" so I can keep track of each individual job. The program writes the paths of the source files and the destination to a XML document for logging and such. I want my end user to input anything into the text box and have that text be used as an XML tag that I can obviously reference later.

Any suggestions?

So far this is what i have for my other tags.

Expand|Select|Wrap|Line Numbers
  1. Dim nSource = doc.GetElementsByTagName("Source")
  2.             Dim nJob = doc.GetElementsByTagName("Job")
  3.  
  4. For Each item As System.Xml.XmlElement In nJob
  5.                 Console.WriteLine(item.Name)
  6.             Next
  7.  
But I want "Job" in doc.getElementByTagName("Job") to be pulled from the XML file or perhaps the textbox in the program
Nov 20 '12 #1

✓ answered by Rabbit

I have no idea what your XML structure is but you can either read the structure dynamically, or you can write a node at the beginning with the name of the tags you want to retrieve, or write it all with the same tag but add an attribute with the user's input as the value.

4 1434
Rabbit
12,516 Expert Mod 8TB
Instead of where you have "Job", put a reference to the textbox in the program.
Nov 20 '12 #2
maylortaylor
72 64KB
Well, the textbox is on a seperate program. The code above is part of a console program that will read the XML file for the job name, file locations, and destination - and then zip the files together and store in the destination location.

The first program (a simple windows form), allows the user to add the files to a list, select the destination for the eventual zip file, and also to insert a reference(job) name.

So, as you can see, i'm finding difficulties referencing a textbox in a seperate console program.
Nov 20 '12 #3
Rabbit
12,516 Expert Mod 8TB
I have no idea what your XML structure is but you can either read the structure dynamically, or you can write a node at the beginning with the name of the tags you want to retrieve, or write it all with the same tag but add an attribute with the user's input as the value.
Nov 20 '12 #4
maylortaylor
72 64KB
Thank you again Rabbit. Your last suggestion "...write it all with the same tag but add an attribute with the user's input as the value." worked perfectly.
Nov 20 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Chris Pomasl | last post by:
Does no one have any insight?......please? Chris -------- Original Message -------- Subject: Problem with __FILE__ magic constant Date: Tue, 06 Jan 2004 16:43:41 GMT From: Chris Pomasl...
7
by: richbl | last post by:
Hello all, I have a question about unserializing a single array element from a serialized array. Can this be done, or must I first unserialize the array, and then access the element? For...
9
by: Krisztian Kepes | last post by:
Hi ! I want to create an module and I want to use some Global Constant in it. How to I create an global constant in module what is accessable in from other modules ? like this example: ***...
7
by: Nolan Martin | last post by:
is a static functions address constant? ie.. static void func(); write_to_file(&func); Restart program... static void func(); void (*funcPtr) ();
20
by: CoolPint | last post by:
While I was reading about const_cast, I got curious and wanted to know if I could modify a constant variable through a pointer which has been "const_cast"ed. Since the pointer would be pointing to...
8
by: Darsant | last post by:
I'm currently reading 1-n number of binary files, each with 3 different arrays of floats containing about 10,000 values a piece for a total of about 30,000 values per file. I'm looking for a way...
50
by: Michael Mair | last post by:
Cheerio, I would appreciate opinions on the following: Given the task to read a _complete_ text file into a string: What is the "best" way to do it? Handling the buffer is not the problem...
6
by: Peter | last post by:
I'm interested to know what ideas are out there for reading a parallel port at a constant sample rate while still allowing the user to interact with the GUI. That is, reading it every 10ms for...
4
by: jaime | last post by:
Hi again all. Given the line: const int x=5; Can I then use "x" as a constant expression? (By "constant expression", I mean "constant expression" as defined in the C99 standard) I've been...
2
by: subramanian100in | last post by:
I am reading David Musser's "STL Tutorial and Reference Guide" Second Edition. In that book, on pages 68-69, definition has been given that "an iterator can be mutable or constant depending on...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.