Need help with xml and xsl design

A

Adam Wasi

Hi all
This is what I have in mind and I will appreciate any suggestions.

I am trying to create a xml help system for my application. The schema of
the xml file will be
<helpsystem>
<help id="unique id">
<text>text data</text>
<link
href="optional tag which will hold a reference to a uri"
helpanchor="this is also a optional attribute which will point
to a helpid in the same document or a different document"
helpanchorhtmlfile=" this attribute will only be present if the
helpachor attribute is there and basically will include a html file name"
some text data </link>
</help>
(any number of help tags)
</helpsystem>

At runtime this xml will be read and it will be transform to html. Each help
tag will become a html table and each child of the help tag will become a
row for the html table.

The link tag will either have href attribute or helpanchor attribute but not
both. The link tag trasform to a html <a> tag. The href attribute of the
link tag transform to the href attribute of <a>and the <link> text becomes
the text for the <a> tag. When the helpanchorhtmlfile attribute is present,
the href attribute of <a> will hold the reference given by this tag.

All this is very easy( have already written the xsl stylesheet for it) when
the link tag has the attribute href. My difficulty comes when the link tag
has helpanchor attribute because for this attribute I have to generate a
seperate html file with the name given in the helpanchorhtmlfile attribute.
Since the help id which the helpanchor is pointing itself could have any
number of link, I have to build html files for any number of nested levels.

In a traditional programming I would have accomplish this task using
recursion but how can I do this using xsl. If any of you have any
suggestions please let me know and I will greatly appreciate your help.

Rafia Tapia
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top