Click here to Skip to main content
15,890,741 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
We have an xml doc that contains different levels:
XML
<Root>
	<folder name="aaa">
		<folder name="abb">
			<file name="ccc.pdf" url="c:\test\ccc.pdf"/>
			<file name="ddd.pdf" url="c:\test\ddd.pdf"/>
			<file name="eee.pdf" url="c:\test\eee.pdf"/>
			<file name="fff.pdf" url="c:\test\fff.pdf"/>
		</folder>
		<folder name="acc">
			<file name="ggg.pdf" url="c:\test\ggg.pdf"/>
			<file name="hhh.pdf" url="c:\test\hhh.pdf"/>
		</folder>
	</folder>
	<folder name="bbb">
		<folder name="bba">
			<file name="iii.pdf" url="c:\test\iii.pdf"/>
		</folder>
		<folder name="bbc" />
	</folder>
	<folder name="ccc">
			<file name="iii.pdf" url="c:\test\iii.pdf"/>
			<file name="jjj.pdf" url="c:\test\jjj.pdf"/>
			<file name="kkk.pdf" url="c:\test\kkk.pdf"/>
			<file name="lll.pdf" url="c:\test\lll.pdf"/>
	</folder>
</Root>

My question is how to using xsl to make the xml drill down like expand collapse(toggle) the folder name. and also make the file linkable (by the attribute url)
Posted
Updated 26-Jun-13 9:58am
v4
Comments
Sergey Alexandrovich Kryukov 26-Jun-13 15:14pm    
You need to specify exactly what do you have to achieve. "Drill down" is not informative enough.
—SA

1 solution

What you are displaying there is not xml.
The xml does not "drill down" using xsl. You can use xsl transforms to look at the data in different ways but I don't think that is what you want.

I think what you want to do is read the xml into a dom, and use XPath queries to find different pieces of the data. Ask Google about 'XPath'.

[mod 1]
Okay, you changed the question so that the data presented is now in xml format. Your question is still vague, but I think the answer you want is still to use XPath for whatever it is you are trying to do.
 
Share this answer
 
v2
Comments
lmik9898 26-Jun-13 15:58pm    
Thanks. I updated the xml file and I just want to make the file like <ul> <li> format. and the pdf file can be opened directly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900