From 41e8513ca90ef28c848bf792f9ae14d82cbcadfb Mon Sep 17 00:00:00 2001
From: Ladislav Lhotka <lhotka@nic.cz>
Date: Thu, 11 Aug 2016 14:55:08 +0200
Subject: [PATCH] Add empty revision if not specified.

---
 tools/xslt/hello2yanglib.xsl | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/xslt/hello2yanglib.xsl b/tools/xslt/hello2yanglib.xsl
index 489f0ab..65d410f 100644
--- a/tools/xslt/hello2yanglib.xsl
+++ b/tools/xslt/hello2yanglib.xsl
@@ -41,7 +41,7 @@ Limitations:
   </template>
 
   <template name="uri-parameters">
-    <param name="text" select="substring-after(., '?')"/>
+    <param name="text"/>
     <choose>
       <when test="contains($text, '&amp;')">
 	<call-template name="uri-param">
@@ -95,10 +95,16 @@ Limitations:
 
   <template match="nc:capability">
     <element name="yl:module">
-      <call-template name="uri-parameters"/>
+      <variable name="pars" select="substring-after(., '?')"/>
+      <call-template name="uri-parameters">
+	<with-param name="text" select="$pars"/>
+      </call-template>
       <element name="yl:namespace">
 	<value-of select="substring-before(., '?')"/>
       </element>
+      <if test="not(contains($pars, 'revision='))">
+	<element name="yl:revision"/>
+      </if>
       <element name="yl:conformance-type">implement</element>
     </element>
   </template>
-- 
GitLab