[cairo-commit] svgslides .cvsignore, 1.1, 1.2 ChangeLog, 1.51, 1.52 svgslides-index.rnc, NONE, 1.1 svgslides.xsl, 1.38, 1.39

Carl Worth commit at pdx.freedesktop.org
Thu Feb 3 09:07:06 PST 2005


Committed by: cworth

Update of /cvs/cairo/svgslides
In directory gabe:/tmp/cvs-serv2961

Modified Files:
	.cvsignore ChangeLog svgslides.xsl 
Added Files:
	svgslides-index.rnc 
Log Message:

        * svgslides-index.rnc: Add new schema for index files.

        * svgslides.xsl: Add support to generate an XML index file which
        captures the filename and title of each slide. This is intended to
        work with Kristian Høgsberg's recent addition of support for
        svgslides to evince.


Index: .cvsignore
===================================================================
RCS file: /cvs/cairo/svgslides/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- .cvsignore	2 Feb 2005 19:42:53 -0000	1.1
+++ .cvsignore	3 Feb 2005 17:07:03 -0000	1.2
@@ -1 +1,2 @@
 test-???.svg
+test-index.xml

Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/svgslides/ChangeLog,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- ChangeLog	2 Feb 2005 22:29:16 -0000	1.51
+++ ChangeLog	3 Feb 2005 17:07:04 -0000	1.52
@@ -1,3 +1,12 @@
+2005-02-03  Carl Worth  <cworth at cworth.org>
+
+	* svgslides-index.rnc: Add new schema for index files.
+
+	* svgslides.xsl: Add support to generate an XML index file which
+	captures the filename and title of each slide. This is intended to
+	work with Kristian Høgsberg's recent addition of support for
+	svgslides to evince.
+
 2005-02-02  Carl Worth  <cworth at cworth.org>
 
 	* README: Add a big README. It's got good coverage in some parts,

--- NEW FILE: svgslides-index.rnc ---
default namespace = "http://www.svgslides.org/svgslides-index0.1"

start =
  element svgslides-index {
    attribute title { text },
    element slide {
      attribute filename { text },
      attribute title { text }
    }+
  }

Index: svgslides.xsl
===================================================================
RCS file: /cvs/cairo/svgslides/svgslides.xsl,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- svgslides.xsl	2 Feb 2005 20:14:56 -0000	1.38
+++ svgslides.xsl	3 Feb 2005 17:07:04 -0000	1.39
@@ -3,14 +3,39 @@
 		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 		xmlns:xlink="http://www.w3.org/1999/xlink"
 		xmlns:ss="http://www.svgslides.org/svgslides0.1"
+		xmlns:ssi="http://www.svgslides.org/svgslides-index0.1"
 		xmlns:svg="http://www.w3.org/2000/svg"
 		exclude-result-prefixes="svg ss"
 		>
   <xsl:output method="xml" indent="yes" />
 
+  <!-- The main template performs two passes over the slide content.
+
+       The first is a very simple scan to generate the index file,
+
+       The second pass generates one output SVG file per slide by
+       finding and processing an SVG file matching the given theme
+       name, processing its contents, and substituting slide content
+       where appropriate.
+  -->
   <xsl:template match="/">
+    <xsl:variable name="title" select="/ss:svgslides/@title" />
+
+    <xsl:document href="{$title}-index.xml">
+      <svgslides-index 
+	  title="{$title}"
+	  xmlns="http://www.svgslides.org/svgslides-index0.1">
+	<xsl:for-each select="//ss:slides/ss:slide">
+	  <slide
+	      filename="{$title}-{format-number(position(),'000')}.svg"
+	      title="{@title}"
+	      />
+	</xsl:for-each>
+      </svgslides-index>
+    </xsl:document>
+    
     <xsl:for-each select="//ss:slides/ss:slide">
-      <xsl:document href="{concat(/ss:svgslides/@title,'-',format-number(position(),'000'),'.svg')}">
+      <xsl:document href="{$title}-{format-number(position(),'000')}.svg">
 	<xsl:call-template name="apply-theme">
 	  <xsl:with-param name="theme-id" select="ancestor-or-self::*[@theme][1]/@theme" />
 	  <xsl:with-param name="current-slide" select="." />




More information about the cairo-commit mailing list