From 993793018e1973bd5ef7912decb074dce4c67917 Mon Sep 17 00:00:00 2001 From: Martin Byrenheid Date: Sun, 23 Mar 2014 01:58:13 +0100 Subject: [PATCH] Began work in news2rss-template --- content/c3d2/{ => templates}/html.xsl | 0 content/c3d2/templates/rss.xsl | 40 ++++++++ doc/README.md | 31 ++++++ transformation/news2rss/news2rss.xsl | 132 ++++++++++++++++++++++++++ 4 files changed, 203 insertions(+) rename content/c3d2/{ => templates}/html.xsl (100%) create mode 100644 content/c3d2/templates/rss.xsl create mode 100644 doc/README.md create mode 100644 transformation/news2rss/news2rss.xsl diff --git a/content/c3d2/html.xsl b/content/c3d2/templates/html.xsl similarity index 100% rename from content/c3d2/html.xsl rename to content/c3d2/templates/html.xsl diff --git a/content/c3d2/templates/rss.xsl b/content/c3d2/templates/rss.xsl new file mode 100644 index 000000000..7ca3b3c87 --- /dev/null +++ b/content/c3d2/templates/rss.xsl @@ -0,0 +1,40 @@ + + + + + + + + + + + + www.c3d2.de Newsfeed + http://www.c3d2.de/ + Neues aus dem Chaos Computer Club Dresden + de-de + + Chaosknoten + images/ck.png + http://www.c3d2.de/ + + + + + + + + + + + + diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 000000000..6368aec6c --- /dev/null +++ b/doc/README.md @@ -0,0 +1,31 @@ +General concept: + - (TBD) Structure of XML-files is predefined by the + DTDs in the dtd-folder, which contains all the entities + supported by the framework. + + - Basic transformations offered by framework + -> offer general-purpose transformations + -> located in transformation + + - Domain-specific XSL-Templates (e.g. html.xsl, rss.xsl) + -> should normally only include a template with name "main", which contains + the basic domain-specific structure for the created objects of this type + -> located in content//templates + -> definition of own templates is possible, but may cause name collisions with + the imported templates provided by the framework + -> each template may include the appropriate transformation template + from the framework and use the provided templates + +Process for final formats (such as html or rss): + 1. Transformation initiated by calling "xsltproc $PATHS {html,rss}.xsl .xml + 2. Framework-included template matches root element, may do some preparations (as in news2rss.xsl) + and call the "main"-template. + 3. The "main"-template defines the common structure and calls the needed templates + provided by the framework at the needed places. + +Changelog to master (besides new architecture): + +news2rss: + - Transformation of : + -> removed insertion of and to make code more generic + -> may in future be taken directly from the @author-attribute in the xml-file diff --git a/transformation/news2rss/news2rss.xsl b/transformation/news2rss/news2rss.xsl new file mode 100644 index 000000000..8b1bd1235 --- /dev/null +++ b/transformation/news2rss/news2rss.xsl @@ -0,0 +1,132 @@ + + + + + + + + + + 2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .html + + + <xsl:value-of select="@title"/> + + <![CDATA[ +
+ +
+ ]]> +
+ + + + + + + + + + + + + + + + + + + + + <![CDATA[ +
+ +
+ ]]> +
+ + + + + + + + + + + + +
+
+ +