Re: [xsl] Copying refered files

Subject: Re: [xsl] Copying refered files
From: Jingjun Long <longjingjun@xxxxxxxxx>
Date: Fri, 28 Aug 2009 15:02:06 +0800
Hello Joga,

You are about to remove duplicated items.

<xsl:for-each-group> may be used to fulfill your needs.

Jingjun

2009/8/28 Joga Singh Rawat <jrawat@xxxxxxxxxxxxxx>
>
> Hi,
>
> I want to achieve following results but don't know exactly what to do? I
> have a specific directory where all htm files (a.htm, b.htm, c.htm...
x.htm)
> are lying.
>
> Input: abc.xml
> <abc>
> <x><a href="a.htm">aaa</a></x>
> <x><a href="b.htm">bbb</a></x>
> <x><a href="a.htm">aaa</a></x>
> <x><a href="c.htm">ccc</a></x>
> <x><a href="b.htm">bbb</a></x>
> </abc>
>
> I want to run a xslt in the above xml file (abc.xml) . This xslt will
> convert abc.xml into abc.htm and also pulled the cross refered files (do
not
> want to be duplicate). The output directory should contains four html files
> ie. abc.htm, a.htm, b.htm c.htm. I am trying just as follows:
>
> <xsl:template match="abc">
>  <html>
>  <xsl:apply-templates/>
>  <xsl:for-each select="//a">
>   <xsl:variable name="reffile" select="@href"/>
>   <xsl:result-document href="{$reffile}">
>    <xsl:copy-of select="document(concat('masterdir/', $reffile))"/>
>   </xsl:result-document>
>  </xsl:for-each>
>  </html>
> </xsl:template>
>
> Anyone any idea?
>
> Thanks

Current Thread