From 96fa456a0ae624a30a3cfded21e91e690056eda2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 3 Oct 2006 15:39:34 +0000 Subject: * An example of using toXML to pass structured information to a builder and generate a Jetty configuration file with XSLT. --- doc/manual/writing-nix-expressions.xml | 79 ++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/manual/writing-nix-expressions.xml b/doc/manual/writing-nix-expressions.xml index 9f7fed8fd..744ae6839 100644 --- a/doc/manual/writing-nix-expressions.xml +++ b/doc/manual/writing-nix-expressions.xml @@ -1288,8 +1288,9 @@ command-line argument. See builtins.add e1 e2 - Add integers e1 and - e2.. + Return the sum of the integers + e1 and + e2. @@ -1710,7 +1711,79 @@ in foo of e. The main application for toXML is to communicate information with the builder in a more structured format than plain environment - variables. + variables. + + Passing information to a builder + using <function>toXML</function> + + + $out/server-conf.xml + "; + + stylesheet = builtins.toFile "stylesheet.xsl" " + + + + + + + + + + + + + "; + + servlets = builtins.toXML [ + { path = "/bugtracker"; war = jira + "/lib/atlassian-jira.war"; } + { path = "/wiki"; war = uberwiki + "/uberwiki.war"; } + ]; +})]]> + + + + The string in the attribute servlets + evaluates to something like this: + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + -- cgit v1.2.3