[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Copying refered files

Subject: Copying refered files
From: "Joga Singh Rawat" <jrawat@xxxxxxxxxxxxxx>
Date: Fri, 28 Aug 2009 11:29:37 +0530
 Copying refered files
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.