xsl-list
[Top] [All Lists]

Re: [xsl] Copying refered files

2009-08-28 03:02:59
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(_at_)aptaracorp(_dot_)com>

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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>