~ziad-sawalha/keystone/trunk

« back to all changes in this revision

Viewing changes to echo/echo/xsl/echo.xsl

  • Committer: Ziad Sawalha
  • Date: 2011-05-26 01:24:05 UTC
  • mfrom: (87.5.8)
  • Revision ID: git-v1:b0d12a558f590a501a42afd1283148961563920e
Merge pull request 53

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="UTF-8"?>
2
 
 
3
 
<transform xmlns="http://www.w3.org/1999/XSL/Transform"
4
 
           xmlns:echo="http://docs.openstack.org/echo/api/v1.0"
5
 
           version="1.0">
6
 
    <output method="text" encoding="UTF-8"/>
7
 
 
8
 
    <template match="echo:echo">
9
 
        <text>{ "echo" : { </text>
10
 
        <apply-templates  select="@*"/>
11
 
        <text>,</text>
12
 
        <apply-templates />
13
 
        <text>}}</text>
14
 
    </template>
15
 
 
16
 
    <template match="echo:content">
17
 
        <text>"content" : {</text>
18
 
        <apply-templates select="@*"/>
19
 
        <text>, "value" : "</text>
20
 
        <apply-templates />
21
 
        <text>" }</text>
22
 
    </template>
23
 
 
24
 
    <template match="@*">
25
 
        <if test="position() != 1">
26
 
            <text>,</text>
27
 
        </if>
28
 
        <text>"</text>
29
 
        <value-of select="name()"/>
30
 
        <text>" : "</text>
31
 
        <value-of select="."/>
32
 
        <text>"</text>
33
 
    </template>
34
 
 
35
 
    <template match="text()">
36
 
        <variable name="noeol"   select="translate(string(.),'&#x000a;','')"/>
37
 
        <variable name="noquote" select="translate($noeol,'&quot;',&quot;&apos;&quot;)"/>
38
 
        <value-of select="$noquote"/>
39
 
    </template>
40
 
 
41
 
</transform>