473,796 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need XML help with nested tables

(I posted this in ADO group, but I think this group will be better)

Hi-

I need to develop an FAQ section for our website. We would like to break up
the FAQ by products, then categories with each category having n
question/answer pairs.
I would like to pass parameters in the querystring based on what the
product/category the user selected, then populate a datagrid with the
correct set of question/answer

I am pretty new to XML, but basically I made something like this:
<products>
<product>
<name>prod1</name>
<partNum>prod 1</partNum>
<categories>
<category>
<name>basic category</name>
<faqs>
<faq>
<question>Thi s is a sample question</question>
<answer>this is the answer</answer>
</faq>
</faqs>
</category>
</categories>
</product>
<product>
<name>prod2</name>
<partNum>prod 2</partNum>
<categories>
<category>
<name>basic something or something category</name>
<faqs>
<faq>
<question>Thi s is another question</question>
<answer>and this is another answer</answer>
</faq>
</faqs>
</category>
</categories>
</product>
</products>

So, then I use a DataSet and the ReadXML() method, this result in 5 tables.
I was hoping that it would somehow be nested for me, but the way it is right
now I can't see an easy way to use it the way I want.

the first table lists the products(good)
the second table I can't really tell what is in there
third tables has all the categories, so on and so on.

What is confusing is... what is the point of structuring data hierarchically
in XML file if you can't maintain it? I'm sure you can, but how? Is what
I'm doing not common?

Someone please shed a little light on this for me, I would appreciate it!!

Thanks,
Steve
Nov 18 '05 #1
4 1652
Create a dataset with datarelations between the tables you want
nested. Set the Nested property prior to writing the xml:

ds.Relations["relationNa me"].Nested = true;

-- Mary
MCW Technologies
http://www.mcwtech.com

On Thu, 4 Dec 2003 16:44:58 -0800, "Steve Klett"
<sk************ @yahoo.com> wrote:
(I posted this in ADO group, but I think this group will be better)

Hi-

I need to develop an FAQ section for our website. We would like to break up
the FAQ by products, then categories with each category having n
question/answer pairs.
I would like to pass parameters in the querystring based on what the
product/category the user selected, then populate a datagrid with the
correct set of question/answer

I am pretty new to XML, but basically I made something like this:
<products>
<product>
<name>prod1</name>
<partNum>prod 1</partNum>
<categories>
<category>
<name>basic category</name>
<faqs>
<faq>
<question>Thi s is a sample question</question>
<answer>this is the answer</answer>
</faq>
</faqs>
</category>
</categories>
</product>
<product>
<name>prod2</name>
<partNum>prod 2</partNum>
<categories>
<category>
<name>basic something or something category</name>
<faqs>
<faq>
<question>Thi s is another question</question>
<answer>and this is another answer</answer>
</faq>
</faqs>
</category>
</categories>
</product>
</products>

So, then I use a DataSet and the ReadXML() method, this result in 5 tables.
I was hoping that it would somehow be nested for me, but the way it is right
now I can't see an easy way to use it the way I want.

the first table lists the products(good)
the second table I can't really tell what is in there
third tables has all the categories, so on and so on.

What is confusing is... what is the point of structuring data hierarchically
in XML file if you can't maintain it? I'm sure you can, but how? Is what
I'm doing not common?

Someone please shed a little light on this for me, I would appreciate it!!

Thanks,
Steve


Nov 18 '05 #2
Hi Mary, thanks for the response.

So I would setup the relationions prior to reading teh XML, correct? Have
you ever seen any examples of this?

Thanks again,
Steve


"Mary Chipman" <mc***@nomail.p lease> wrote in message
news:qh******** *************** *********@4ax.c om...
Create a dataset with datarelations between the tables you want
nested. Set the Nested property prior to writing the xml:

ds.Relations["relationNa me"].Nested = true;

-- Mary
MCW Technologies
http://www.mcwtech.com

On Thu, 4 Dec 2003 16:44:58 -0800, "Steve Klett"
<sk************ @yahoo.com> wrote:
(I posted this in ADO group, but I think this group will be better)

Hi-

I need to develop an FAQ section for our website. We would like to break upthe FAQ by products, then categories with each category having n
question/answer pairs.
I would like to pass parameters in the querystring based on what the
product/category the user selected, then populate a datagrid with the
correct set of question/answer

I am pretty new to XML, but basically I made something like this:
<products>
<product>
<name>prod1</name>
<partNum>prod 1</partNum>
<categories>
<category>
<name>basic category</name>
<faqs>
<faq>
<question>Thi s is a sample question</question>
<answer>this is the answer</answer>
</faq>
</faqs>
</category>
</categories>
</product>
<product>
<name>prod2</name>
<partNum>prod 2</partNum>
<categories>
<category>
<name>basic something or something category</name>
<faqs>
<faq>
<question>Thi s is another question</question>
<answer>and this is another answer</answer>
</faq>
</faqs>
</category>
</categories>
</product>
</products>

So, then I use a DataSet and the ReadXML() method, this result in 5 tables.I was hoping that it would somehow be nested for me, but the way it is rightnow I can't see an easy way to use it the way I want.

the first table lists the products(good)
the second table I can't really tell what is in there
third tables has all the categories, so on and so on.

What is confusing is... what is the point of structuring data hierarchicallyin XML file if you can't maintain it? I'm sure you can, but how? Is whatI'm doing not common?

Someone please shed a little light on this for me, I would appreciate it!!
Thanks,
Steve

Nov 18 '05 #3
Once you add the data to a dataset you can then set the DataRelations
between the different DataTables. There's examples in online help --
see the topic "Adding a Relationship between Tables". Gotdotnet.com
probably has other examples or tutorials as well. Then once you've set
up the relations, you can then set the nested property to true.

-- Mary
MCW Technologies
http://www.mcwtech.com

On Mon, 8 Dec 2003 09:53:32 -0800, "neverstill "
<sk************ @yahoo.com> wrote:
Hi Mary, thanks for the response.

So I would setup the relationions prior to reading teh XML, correct? Have
you ever seen any examples of this?

Thanks again,
Steve


"Mary Chipman" <mc***@nomail.p lease> wrote in message
news:qh******* *************** **********@4ax. com...
Create a dataset with datarelations between the tables you want
nested. Set the Nested property prior to writing the xml:

ds.Relations["relationNa me"].Nested = true;

-- Mary
MCW Technologies
http://www.mcwtech.com

On Thu, 4 Dec 2003 16:44:58 -0800, "Steve Klett"
<sk************ @yahoo.com> wrote:
>(I posted this in ADO group, but I think this group will be better)
>
>Hi-
>
>I need to develop an FAQ section for our website. We would like to breakup >the FAQ by products, then categories with each category having n
>question/answer pairs.
>I would like to pass parameters in the querystring based on what the
>product/category the user selected, then populate a datagrid with the
>correct set of question/answer
>
>I am pretty new to XML, but basically I made something like this:
><products>
> <product>
> <name>prod1</name>
> <partNum>prod 1</partNum>
> <categories>
> <category>
> <name>basic category</name>
> <faqs>
> <faq>
> <question>Thi s is a sample question</question>
> <answer>this is the answer</answer>
> </faq>
> </faqs>
> </category>
> </categories>
> </product>
> <product>
> <name>prod2</name>
> <partNum>prod 2</partNum>
> <categories>
> <category>
> <name>basic something or something category</name>
> <faqs>
> <faq>
> <question>Thi s is another question</question>
> <answer>and this is another answer</answer>
> </faq>
> </faqs>
> </category>
> </categories>
> </product>
></products>
>
>
>
>So, then I use a DataSet and the ReadXML() method, this result in 5tables. >I was hoping that it would somehow be nested for me, but the way it isright >now I can't see an easy way to use it the way I want.
>
>the first table lists the products(good)
>the second table I can't really tell what is in there
>third tables has all the categories, so on and so on.
>
>What is confusing is... what is the point of structuring datahierarchical ly >in XML file if you can't maintain it? I'm sure you can, but how? Iswhat >I'm doing not common?
>
>Someone please shed a little light on this for me, I would appreciateit!! >
>Thanks,
>Steve
>


Nov 18 '05 #4
great, thanks Mary!
"Mary Chipman" <mc***@nomail.p lease> wrote in message
news:4v******** *************** *********@4ax.c om...
Once you add the data to a dataset you can then set the DataRelations
between the different DataTables. There's examples in online help --
see the topic "Adding a Relationship between Tables". Gotdotnet.com
probably has other examples or tutorials as well. Then once you've set
up the relations, you can then set the nested property to true.

-- Mary
MCW Technologies
http://www.mcwtech.com

On Mon, 8 Dec 2003 09:53:32 -0800, "neverstill "
<sk************ @yahoo.com> wrote:
Hi Mary, thanks for the response.

So I would setup the relationions prior to reading teh XML, correct? Haveyou ever seen any examples of this?

Thanks again,
Steve


"Mary Chipman" <mc***@nomail.p lease> wrote in message
news:qh******* *************** **********@4ax. com...
Create a dataset with datarelations between the tables you want
nested. Set the Nested property prior to writing the xml:

ds.Relations["relationNa me"].Nested = true;

-- Mary
MCW Technologies
http://www.mcwtech.com

On Thu, 4 Dec 2003 16:44:58 -0800, "Steve Klett"
<sk************ @yahoo.com> wrote:

>(I posted this in ADO group, but I think this group will be better)
>
>Hi-
>
>I need to develop an FAQ section for our website. We would like to
breakup
>the FAQ by products, then categories with each category having n
>question/answer pairs.
>I would like to pass parameters in the querystring based on what the
>product/category the user selected, then populate a datagrid with the
>correct set of question/answer
>
>I am pretty new to XML, but basically I made something like this:
><products>
> <product>
> <name>prod1</name>
> <partNum>prod 1</partNum>
> <categories>
> <category>
> <name>basic category</name>
> <faqs>
> <faq>
> <question>Thi s is a sample question</question>
> <answer>this is the answer</answer>
> </faq>
> </faqs>
> </category>
> </categories>
> </product>
> <product>
> <name>prod2</name>
> <partNum>prod 2</partNum>
> <categories>
> <category>
> <name>basic something or something category</name>
> <faqs>
> <faq>
> <question>Thi s is another question</question>
> <answer>and this is another answer</answer>
> </faq>
> </faqs>
> </category>
> </categories>
> </product>
></products>
>
>
>
>So, then I use a DataSet and the ReadXML() method, this result in 5

tables.
>I was hoping that it would somehow be nested for me, but the way it is

right
>now I can't see an easy way to use it the way I want.
>
>the first table lists the products(good)
>the second table I can't really tell what is in there
>third tables has all the categories, so on and so on.
>
>What is confusing is... what is the point of structuring data

hierarchical ly
>in XML file if you can't maintain it? I'm sure you can, but how? Is

what
>I'm doing not common?
>
>Someone please shed a little light on this for me, I would appreciate

it!!
>
>Thanks,
>Steve
>

Nov 18 '05 #5

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

Similar topics

1
2512
by: Eric Bohlman | last post by:
What's the correct technique for nesting a bordered table inside of cell of another bordered table without getting a double-thickness border around the nested table? This is assuming the collapsing-border model. An example of where I have a good reason to do this is at <http://www.wayneengineering.com/literature/wcsf-settings.php>. In this case I was able to get away with using ordered lists for the parameters with enumerated values,...
1
1793
by: da_fox | last post by:
Ok. I give up. I appeal to the css gurus out there for their benevolence. I'm trying to center some text on an arbitrary vertical on a page using CSS instead of nested tables. It seems so easy but I can't figure it out. If you cut and paste the following html code you will see that the 'Centered Text' is center by using a nested table and setting some widths. How can I accomplish the same thing without the inner-most table?
8
8922
by: T. Bjarne | last post by:
I'm writing a form with a grid layout (similar to the ones in phpMyAdmin). The form will contain X number of columns and Y rows - all cells containg INPUT elements. As long as the data isn't tabular I want to avoid tables. Is there a smart way (DIVs and CSS) to do this form without a table? Could I consider a form like this as tabular data, and forget making it tableless? Thanks,
1
3077
by: Hazz | last post by:
I have 5 tables in SQL Server. Each with the following design and a sample chain of the relationships from the root (WRL - World) UUS is the 'Code' of the first table and it is the 'Parent' value of the second table, etc. Parent varchar 3 Name varchar 60 Code varchar 3 WRL United States UUS <- UUS California UCA <- UCA North Coast UNC <- UNC
0
1447
by: George Durzi | last post by:
I have a DataSet with 3 tables, and two DataRelations dsSubs.Tables.TableName = "Subscriptions" dsSubs.Tables.TableName = "AccountManagers" dsSubs.Relations.Add "AccountManagers_Subscriptions", dsSubs.Tables.Columns dsSubs.Tables.Columns) dsSubs.Tables.TableName = "NewsFeeds"
3
4043
by: Eirik Eldorsen | last post by:
Im trying to make a nested repeater with 3 levels. I've successfully created a nested repeater with 2 levels, but when adding the 3rd level I get an InvalidCastException. What am I doing wrong? Here is my code: <asp:Repeater id="level1Repeater" runat="server"> <itemtemplate>
18
2500
by: fishwick | last post by:
I haven't really done any css in quite a while, and am banging my head against the wall trying get the rudimentary layout together of a church website home page to display correctly - I don't want to continue work until I understand what I'm doing wrong. http://www.christchurchinfo.net The site displays nicely in Firefox/Mozilla and Safari, but the stained glass windows navigation portion is getting pushed down in IE, and the "news"...
25
6785
by: Shannon Jacobs | last post by:
The OL tag still allows for a START value, but that is now deprecated. I've found sound references that suggest the proper technique now is to control it with a style for the OL in quetion, but I haven't been able to find the proper reference. What I actually want is an ordered list that counts down to one. Are negative increments even possible? Doesn't seem like a ridiculous idea in the real world, but... (Yes, I also searched these...
2
1922
by: Me LK | last post by:
I have a set of drop downs nested in a datagrid. Each drop down is a size or color for an item. Each row of the grid has a button which leads to a cart. When a user selects something from the first row or nested drop downs the page refreshes, the correct item is selected in the list and the and upon clicking the add to cart button the correct choices show up in the database. When a person selects something from a row other then the first...
0
9529
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
10231
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
10176
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
9054
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...
0
6792
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
5443
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...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
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
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.