[Home] [By Thread] [By Date] [Recent Entries]
This is my first post; Welcome! How can I keep track of the folder attribute in the parent template You're challenge is that you start from a new document node, from that point on, the original document node is out of scope. However, xsl:apply-templates can have a child, xsl:with-param. Use <xsl:with-param name="filename" select="@name" /> and inside the matching template, add <xsl:param name="filename" />. You can then refer to this by using the variable $filename. The potion of code below fails until I explictly provide the absolute path and also prepend it with file://D| Not sure what the question is for Q #2, but your conclusion is correct. You need to provide a URI. The exact syntax for a file-uri is often debated and can be processor dependent (i.e., some may require file:///, as after file:// for protocol, you must first provide the root /). Is it possible for me to determine using XSLT the directory path of the XML file being processed? Certain processors may provide extension functions for that. In XSLT 2.0, you can use the base-uri() function to find the filename (not quite: to find the base uri) of a document. You can even use base-uri(documen('')) to get the filename of the executing XSLT file. If you need to stick to XSLT 1.0, you can pass the filename as a parameter on the commandline. Define the parameter as xsl:param in the root of your styleseet. Same solution works for getting the absolute current path (you Q #2). Cheers, Abel ------------------------------------------------------------------------ From: Lighton Phiri <lighton.phiri@xxxxxxxxx> Sent: Saturday, August 06, 2011 12:34:26 PM To: xsl-list Cc: Subject: xslt document function - recursive folder processing. I am working with XSLT version 1.0 using xsltproc.
|

Cart



