I have a question on XSL-Transformation (XSLT-1). I am trying it since days, but I didn't get it to work.
I want to build a standard website tree navigation with XML and XSLT-1. It should only show the items on the path to the current item. if the current item has child-items, the next node should be opened.
My XML source is like this:
<cat>
<item id="0" name="1">
<item id="1" name="1.1"></item>
<item id="2" name="1.2"></item>
<item id="3" name="1.3"></item>
<item id="4" name="1.4">
<item id="5" name="1.4.1">
<item id="6" name="1.4.1.1"></item>
<item id="7" name="1.4.1.2"></item>
<item id="8" name="1.4.1.3"></item>
</item>
<item id="9" name="1.4.2"></item>
<item id="10" name="1.4.3"></item>
</item>
<item id="11" name="1.5"></item>
<item id="12" name="1.6"></item>
</item>
<item id="13" name="2">
<item id="14" name="2.1"></item>
<item id="15" name="2.2"></item>
</item>
<item id="16" name="3"></item>
</cat>
Now I want to call a page with an $pageid=7 send by URL, and it should show some output like this:
<ul>
<li>1
<ul>
<li>1.1</li>
<li>1.2</li>
<li>1.3</li>
<li>1.4
<ul>
<li>1.4.1
<ul>
<li>1.4.1.1</li>
<li class="activeitem">1.4.1.2</li>
<li>1.4.1.3</li>
</ul>
</li>
<li>1.4.2</li>
<li>1.4.3</li>
</ul>
</li>
<li>1.5</li>
<li>1.6</li>
</ul>
</li>
<li>2</li>
<li>3</li>
</ul>
If I call a page with an $pageid=4 send by URL, and it should show some output like this:
<ul>
<li>1
<ul>
<li>1.1</li>
<li>1.2</li>
<li>1.3</li>
<li class="activeitem">1.4
<ul>
<li>1.4.1</li>
<li>1.4.2</li>
<li>1.4.3</li>
</ul>
</li>
<li>1.5</li>
<li>1.6</li>
</ul>
</li>
<li>2</li>
<li>3</li>
</ul>
Hopefully my example is understandable for all.
I already got a sitemap and a breadcrumb navigation working, but this one seems to be very tricky and experienced.
I tried to modify the examples from Tree navigation with XML and XSLT - but it didn't worked well. It only shows the path to the item, but not the rest.
Can somebody experienced with XSLT-1 help me with it?
Or maybe somebody has already a working solution to post here?
It would be very kind. Thank you all for your attention.