Creating 'Table of Contents' list with XSL

D

Don Wash

Hi everyone!

I'm creating an ASP page (with VBScript) to display the Table of Contents
(TOC) for my website. I have stored the TOC in the XML file and currently
trying to transform the data in the XML file into a readable TOC web page
using XSL file.

I have the following XML file...

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="toc.xsl"?>
<topicGroups id="TopicSet_Root">
<topicGroup id="TopicGroup1">
<text>Topic 1</text>
<topicItem id="Lesson1">
<text>Lesson 1</text>
<url>http://localhost/lesson1.asp</url>

<topicGroups id="TopicSet_2">
<topicGroup id="TopicGroup2">
<text>Lesson 2</text>
<topicItem id="Lesson2">
<text>Lesson 2.1</text>
<url>http://localhost/lesson2_1.asp</url>
</topicItem>
<topicItem id="Lesson2_Links">
<text>Links</text>
<url>http://localhost/lesson2_Links.asp</url>
</topicItem>
</topicGroup >
</topicGroups >

</topicItem>
</topicGroup >
</topicGroups >

I would like XSL to transform this XML file into something like this...

Topic 1
|------------Lesson 1
|------------Lesson 2
|------------Lesson 2.1
|------------Links

As you can see, my XML structure (or schema) is "recursed" and could become
indefnitly recursed heirachy list as I add more items to the Table of
Contents (TOC).

My question is, how can I "loop" in XSL so that I can display all of the
items in the XML file as properly structured heirachy TOC, so that I don't
have to update XSL file when I add/remove items in the XML file?

Thank you all in advance!

Don

P.S. I've tried 'for-next' thingie but it didn't worked well with my
"recursed" items to arrange to become a TOC hierachy. I think my problem
requires a more complex solution (maybe?)
 
D

Douglas J. Steele

I'd suggest asking this in an XML-related group such as microsoft.public.xml
or, probably better, microsoft.public.xsl

This newsgroup is for questions about Access, the database product that's
part of Office Professional.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top