[xslt] Creating directories



Hi,

I would like to create a directory structure based on an XML 
tree. I searched the mailing list archive and had a look around 
the net but found nothing. I guess it's not possible to do this 
with XSLT at this point. I wondered if anyone here had tried a 
similar thing and had any best practice advice.

I am trying to develop a DTD and stylesheet that allows a user 
to markup the structure and content of a simple brochureware web 
site in the XML and then invoke the stylesheet to build the 
actual site.

So the following XML:

<site>
	<page name="index">
		<content><p>Test</p></content>
	</page>
	<section name="content">
		<page name="index">
			<content><p>Test</p></content>
		</page>
		<page name="page2">
			<content><p>Test</p></content>
		</page>
	</section>
</site>

Would produce three output HTML files:

index.html
content/index.html
content/page2.html

The best solution I can come up with at the moment is to have a 
pre-transformation phase that creates the directories, using 
Perl or Python or something.

TIA,

Ben Godfrey




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]