r6730 - branches/cross-lfs/BOOK/stylesheets

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat Aug 20 04:50:25 PDT 2005


Author: manuel
Date: 2005-08-20 05:50:24 -0600 (Sat, 20 Aug 2005)
New Revision: 6730

Added:
   branches/cross-lfs/BOOK/stylesheets/wget.xsl
Log:
Added a simple stylesheet to create wget scripts.

Added: branches/cross-lfs/BOOK/stylesheets/wget.xsl
===================================================================
--- branches/cross-lfs/BOOK/stylesheets/wget.xsl	2005-08-20 10:20:08 UTC (rev 6729)
+++ branches/cross-lfs/BOOK/stylesheets/wget.xsl	2005-08-20 11:50:24 UTC (rev 6730)
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE xsl:stylesheet [
+ <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+
+<!--
+XSLT stylesheet to create wget scripts to download packages and patches.
+Only for Cross-LFS.
+
+Usage example:
+
+xsltproc -xinclude -output x86.wget stylesheets/wget.xsl x86-index.xml
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    version="1.0">
+
+  <xsl:output method="text"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="//ulink"/>
+  </xsl:template>
+
+  <xsl:template match="ulink">
+      <!-- Packages. If some package don't have the string ".tar." in their
+      name, the next test must be fixed to match it also. -->
+    <xsl:if test="contains(@url, '.tar.')">
+      <xsl:value-of select="@url"/>
+      <xsl:text>&#x0a;</xsl:text>
+    </xsl:if>
+      <!-- Patches. Match only the patches and skip possible duplicated
+      URLs due that may be splitted for PDF output-->
+    <xsl:if test="contains(@url, '.patch') and contains(@url, '&patches-root;')
+            and not(ancestor-or-self::*/@condition = 'pdf')">
+      <xsl:value-of select="@url"/>
+      <xsl:text>&#x0a;</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>


Property changes on: branches/cross-lfs/BOOK/stylesheets/wget.xsl
___________________________________________________________________
Name: svn:keywords
   + "Author Date Revision Id"




More information about the lfs-book mailing list