Re: [xslt] exslt:document and xsltproc



Tim Van Holder wrote:
> david reid wrote:
>> Can xsltproc be persuaded to write the files generated by using
>> exsl:document sections to disk with the filenames given by their href
>> attributes?
> 
> I don't know what you mean - I don't have to persuade it in order for
> that to happen...
> 
> I have
> 
> <xsl:param name="output-uri"/>
> ...
> <xsl:template mode="toc" match="/">
>   <xsl:variable name="uri" select="concat($output-uri, '/toc.html')"/>
> ...
>   <exsl:document href="{$uri}"
> 		 method="xml" version="1.0" encoding="utf-8"
>                  omit-xml-declaration="no" media-type="text/xhtml"
> 		 doctype-public="-//W3C//DTD XHTML 1.1//EN"
> 		 indent="yes">
> ...
> 
> and "xsltproc --stringparam output-uri '/foo'" generates /foo/toc.html
> just fine (and the same goes if $output-uri is not set to an absolute
> path).
> 
> Perhaps including an example of behaviour which you find erroneous would
> be helpful.

Suppose I have

  <xsl:for-each select="item">
    <xsl:variable name="uri" select="concat('dir/', name, '.xml')"/>
    <exsl:document method="xml" version="1.0" encoding="utf-8"
href="{$uri}">
      <xsl:apply-templates select="."/>
    </exsl:document>
  </xsl:for-each>

What I really want is some way of writing out each exsl:document as a
seperate file using a filename based on $uri. Is such a thing possible?

Thanks.

-- 
david

Have you listened to FeatherCast yet?
http://feathercast.org/

Bought the t-shirt?
http://www.cafepress.com/feathercast/


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