473,396 Members | 1,996 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,396 software developers and data experts.

Read XML nested tags

7
Hi!

I'm working on a program (C# .NET CF) that uses an XML file. The file stucture is something like:

<Questions>
<question1>
<text>
<answerA>
<answerB>
</question1>
<question2>
<answerA>
<answerB>
</question2>
</Questions>

I need to display in a text box a specific attribute like for example answerB of question2. Does anybody have an idea how to do that?

Thanks a lot,
Xloi
Sep 13 '07 #1
1 2932
>>> You can load this XML File into an XMLDocument object, use SelectSingleNode() function to get the Details.
For Example:
xmlDoc.SelectSingleNode("/Questions/question1/answerA");

>> Or you can use XMLReader also for Getting the Data. Compared to XMLDocument XMLReader is faster


Hi!

I'm working on a program (C# .NET CF) that uses an XML file. The file stucture is something like:

<Questions>
<question1>
<text>
<answerA>
<answerB>
</question1>
<question2>
<answerA>
<answerB>
</question2>
</Questions>

I need to display in a text box a specific attribute like for example answerB of question2. Does anybody have an idea how to do that?

Thanks a lot,
Xloi
Feb 26 '08 #2

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

Similar topics

0
by: Glen | last post by:
I have a Struts action form which contains a bean. I am trying to display a bean retrieved from the database in this form using the nested tag. Can anyone help me? I continue to get an error...
0
by: Dean H. Saxe | last post by:
I'm currently developing a tool in perl to search out potential XSS (Cross Site Scripting) vulnerabilities and correct them in a ColdFusion based web app. I've been having great success so far,...
1
by: mlv2312 | last post by:
Hi, I have experienced problems when dealing with nested anchors. I implemented some code to perform highlighting and specific anchors are used for the searched words. The problem is when the...
5
by: Markus Ernst | last post by:
Hi I have a validation problem with a form and nested divs. I understand what the problem is, but I don't see how to fix it. This is my normal page structure, and it validates: <!DOCTYPE HTML...
10
by: Philip Ronan | last post by:
Hi, I'm having problems embedding alternative content with nested OBJECT tags. Take a look at <http://www.japanesetranslator.co.uk/chihiro/map.html> The map on this page is available in SVG,...
2
by: SEB | last post by:
can any one please redirect me to how to use control builder class to parse the following case (or any other method) <mycustomcontroltag> <item attribute1="x" attribute2="y" ......> <subitems>...
3
by: Ward Bekker | last post by:
Hi, I need a regular expression that will match only the tags that have nested tags inside them: Input: <control id=1><control id=2></control></control><control id=3></control> Goal:
2
by: Fred Flintstone | last post by:
Why not? Why can't I put a table within paragraph tags? Also: "Element DIV cannot be nested within element 'u'." I can't underline something within div tags? Why not? Thanks! :)
1
by: arunsh | last post by:
Hi I have problem fetching valuesof nested tags in xmlusing xsl stylesheet. For eg.The xml Looks like this <InputFields> <AcctReq> <CardNbrCnt length="3">001</CardNbrCnt> <Acct> ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.