summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-09 19:48:16 (GMT)
committerAnas Nashif <anas.nashif@intel.com>2012-11-09 19:48:16 (GMT)
commitef5ad170c286b22d8c95037e9a8850b26a278650 (patch)
tree9a9aa651569d68602fb451af268ee4de789b726c
parent9a891af402f71f4a3e7aa552e027402d5d3d0d96 (diff)
downloadpattern-tools-ef5ad170c286b22d8c95037e9a8850b26a278650.zip
pattern-tools-ef5ad170c286b22d8c95037e9a8850b26a278650.tar.gz
pattern-tools-ef5ad170c286b22d8c95037e9a8850b26a278650.tar.bz2
initial checkin 001
-rw-r--r--xsl/comps.xsl30
-rw-r--r--xsl/filter.xsl39
-rw-r--r--xsl/merge.xsl13
3 files changed, 82 insertions, 0 deletions
diff --git a/xsl/comps.xsl b/xsl/comps.xsl
new file mode 100644
index 0000000..d18b0f8
--- /dev/null
+++ b/xsl/comps.xsl
@@ -0,0 +1,30 @@
+<?xml version="1.0" ?>
+<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:rpm="http://linux.duke.edu/metadata/rpm"
+ xmlns:patterns="http://novell.com/package/metadata/suse/pattern"
+ version="1.0">
+
+ <xsl:output method="xml" indent="yes" name="xml"/>
+
+ <xsl:template match="patterns">
+ <comps>
+ <xsl:for-each select="patterns:pattern">
+ <group>
+ <id><xsl:value-of select="patterns:name"/></id>
+ <name><xsl:value-of select="patterns:summary"/></name>
+ <description><xsl:value-of select="patterns:description"/></description>
+ <uservisible>true</uservisible>
+ <packagelist>
+ <xsl:for-each select="rpm:requires/rpm:entry">
+ <packagereq type="default"><xsl:value-of select="@name"/></packagereq>
+ </xsl:for-each>
+ </packagelist>
+ </group>
+ </xsl:for-each>
+ </comps>
+ </xsl:template>
+
+
+</xsl:stylesheet>
diff --git a/xsl/filter.xsl b/xsl/filter.xsl
new file mode 100644
index 0000000..03667f8
--- /dev/null
+++ b/xsl/filter.xsl
@@ -0,0 +1,39 @@
+<?xml version="1.0" ?>
+<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:rpm="http://linux.duke.edu/metadata/rpm"
+ xmlns:patterns="http://novell.com/package/metadata/suse/pattern"
+ xmlns="http://novell.com/package/metadata/suse/pattern"
+ version="1.0">
+
+ <xsl:output method="xml" indent="yes" name="xml"/>
+ <xsl:param name="arch"/>
+
+ <xsl:template match="/">
+ <pattern>
+ <xsl:apply-templates/>
+ </pattern>
+ </xsl:template>
+
+ <xsl:template match="*">
+ <name><xsl:value-of select="patterns:name"/></name>
+ <summary><xsl:value-of select="patterns:summary"/></summary>
+ <description><xsl:value-of select="patterns:description"/></description>
+ <uservisible/>
+ <category lang="en"><xsl:value-of select="patterns:category"/></category>
+ <rpm:requires>
+ <xsl:for-each select="rpm:requires/rpm:entry">
+ <xsl:if test="@arch = $arch or not(@arch)">
+ <rpm:entry>
+ <xsl:attribute name="name">
+ <xsl:value-of select="@name"/>
+ </xsl:attribute>
+ </rpm:entry>
+ </xsl:if>
+ </xsl:for-each>
+ </rpm:requires>
+ </xsl:template>
+
+
+</xsl:stylesheet>
diff --git a/xsl/merge.xsl b/xsl/merge.xsl
new file mode 100644
index 0000000..15b3487
--- /dev/null
+++ b/xsl/merge.xsl
@@ -0,0 +1,13 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template match="/">
+ <patterns>
+ <xsl:attribute name="count">
+ <xsl:value-of select="count(/index/file)"/>
+ </xsl:attribute>
+ <xsl:for-each select="/index/file">
+ <xsl:copy-of select="document(.)"/>
+ </xsl:for-each>
+ </patterns>
+ </xsl:template>
+</xsl:stylesheet>