diff xsls/dirmap.xsls @ 1200:333eccb8a7f6

Moved dir.map postprocessing into template.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 21 May 2014 21:37:27 +0400
parents 166fd33afad1
children
line wrap: on
line diff
--- a/xsls/dirmap.xsls
+++ b/xsls/dirmap.xsls
@@ -6,6 +6,8 @@ X:stylesheet {
 
 X:output method="text";
 
+X:strip-space elements="*";
+
 X:template = "link" {
     !{@id}
     X:text{ }
@@ -15,4 +17,32 @@ X:template = "link" {
     X:text{;&#10;}
 }
 
+X:template = "link[@id = 'include']" {
+    X:text{\\}
+    !{@id}
+    X:text{ }
+    !{substring-before(@doc, '.xml')}
+    X:text{.html#}
+    !{@id}
+    X:text{;&#10;}
 }
+
+X:template = "link[starts-with(@id, 'var_')]" {
+    X:text{$}
+    !{substring-after(@id, 'var_')}
+    X:text{ }
+    !{substring-before(@doc, '.xml')}
+    X:text{.html#}
+    !{@id}
+    X:text{;&#10;}
+}
+
+X:template = "links | varlinks" {
+    X:for-each "link", X:sort "@id" {
+        X:if "count(preceding-sibling::link[@id = current()/@id]) = 0" {
+            !! ".";
+        }
+    }
+}
+
+}