Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering XML

Status
Not open for further replies.

NeoSthlm

Programmer
Jun 22, 2004
5
SE
Hi!

I'm building a faq in asp.net c#. Today the faq has 4 main categories. In each main category there might be none or several subcategories. In each subcategory or right under maincategories there are a listing of faq's.

The faq is in 4 languages and the subcategories/faq's can differ from language to language.

I have everything stored in a xml file. My idea was to load it into a dataset then try to filter the tables but it doesn't seem to work. Then I planned to use nested repeaters to present the data. Sounds so easy but I'm quite new to .net and asp.net.

What would be the best solution to do this?

The user has chosen english as language, I want to filter out just the english group of faq's then just get it out to the page.

The xml file looks like this. Please change the structur of it if you a better way of doing it.

<?xml version="1.0" encoding="utf-8" ?>
<faq>
<language langId="EN">
<category categoryName="Search">
<subCategory>
<subCategoryName>Search sub1</subCategoryName>
<faqQuestion>
<faqQuestionId>1</faqQuestionId>
<question>What happens if..?</question>
<answer>Nothing..</answer>
<visible>true</visible>
<dateCreated>2005-09-15</dateCreated>
</faqQuestion>
</subCategory>
<subCategory>
<subCategoryId>2</subCategoryId>
<subCategoryName>Search subcategory2</subCategoryName>
<faqQuestion>
<faqQuestionId>1</faqQuestionId>
<question>How can I..?</question>
<answer>Do like this..</answer>
<visible>true</visible>
<dateCreated>2005-09-15</dateCreated>
</faqQuestion>
</subCategory>
<noSubCategory>
<noSubFaqQuestion>
<noSubQuestionId>1</noSubQuestionId>
<noSubQuestion>How can I..?</noSubQuestion>
<noSubAnswer>Do like this..</noSubAnswer>
<noSubVisible>true</noSubVisible>
<noSubDateCreated>2005-09-15</noSubDateCreated>
</noSubFaqQuestion>
</noSubCategory>
</category>
<category Id="2" categoryName="Send">
<subCategory>
<subCategoryName>Send sub1</subCategoryName>
<faqQuestion>
<faqQuestionId>1</faqQuestionId>
<question>vWhat happens if..?</question>
<answer>nothing..</answer>
<visible>true</visible>
<dateCreated>2005-09-15</dateCreated>
</faqQuestion>
</subCategory>
</category>
</language>
<language langId="SV">
<category Id="1" categoryName="Skicka">
<subCategory>
<subCategoryName>Skicka sub1</subCategoryName>
<faqQuestion>
<faqQuestionId>1</faqQuestionId>
<question>Om jag....?</question>
<answer>nothing..</answer>
<visible>true</visible>
<dateCreated>2005-09-15</dateCreated>
</faqQuestion>
</subCategory>
<noSubCategory>
<noSubFaqQuestion>
<noSubQuestionId>1</noSubQuestionId>
<noSubQuestion>Kan jag.?</noSubQuestion>
<noSubAnswer>nej det kan du inte.</noSubAnswer>
<noSubVisible>true</noSubVisible>
<noSubDateCreated>2005-09-15</noSubDateCreated>
</noSubFaqQuestion>
</noSubCategory>
</category>
</language>
</faq>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top