473,800 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read XML nested tags

7 New Member
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 2939
DeepuChandran
1 New Member
>>> You can load this XML File into an XMLDocument object, use SelectSingleNod e() function to get the Details.
For Example:
xmlDoc.SelectSi ngleNode("/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
2886
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 message see end for stack trace. Struts config <form-bean name="newBean" type="com.NewForm" /> ...... <action path="/new-action" type="com.NewAction" name="newBean" scope="session">
0
3484
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, however, one scenario has me banging my head against the wall. I need a regex to find all <cfoutput ...>...</cfoutput> blocks in a CFM template. The regex should find all such blocks that are *not* nested within HTML tags (the tag itself,...
1
2034
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 searched words are inside <a href> tags, the links are lost after putting my anchors. For example: <a class="Programa" href="#" OnClick="window.open('/something.tif');"
5
7405
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 PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head>
10
2025
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, Flash, JPEG and ASCII art versions. The first two are there because they print at much higher resolution than the JPEG, so I'm keen to keep them in if possible.
2
2130
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> <item attribute1="xx" attribute2="yy" ......> <subitems> more deeper nested tags can be here </subitems> </item>
3
5562
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
6507
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
1243
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> <ReqCd length="3">001</ReqCd> <TransSourceTxt length="3">EXP</TransSourceTxt> </Acct>
0
9551
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
10505
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
10275
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
10253
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
10033
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
5471
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
4149
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
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
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.