~vcs-imports/xena/trunk

« back to all changes in this revision

Viewing changes to ext/src/xalan-j_2_7_1/samples/DOM2DOM/birds.xsl

  • Committer: matthewoliver
  • Date: 2009-12-10 03:18:07 UTC
  • Revision ID: vcs-imports@canonical.com-20091210031807-l086qguzdlljtkl9
Merged Xena Testing into Xena Stable for the Xena 5 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
 
 
3
  <!--
 
4
   * Licensed to the Apache Software Foundation (ASF) under one
 
5
   * or more contributor license agreements. See the NOTICE file
 
6
   * distributed with this work for additional information
 
7
   * regarding copyright ownership. The ASF licenses this file
 
8
   * to you under the Apache License, Version 2.0 (the  "License");
 
9
   * you may not use this file except in compliance with the License.
 
10
   * You may obtain a copy of the License at
 
11
   *
 
12
   *     http://www.apache.org/licenses/LICENSE-2.0
 
13
   *
 
14
   * Unless required by applicable law or agreed to in writing, software
 
15
   * distributed under the License is distributed on an "AS IS" BASIS,
 
16
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
17
   * See the License for the specific language governing permissions and
 
18
   * limitations under the License.
 
19
  -->
 
20
 
 
21
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
22
  <xsl:output method="xml" indent="yes"/>
 
23
 
 
24
<xsl:template match="Class">
 
25
<BirdInfo>
 
26
        <xsl:apply-templates select="Order"/>
 
27
</BirdInfo>
 
28
</xsl:template>
 
29
 
 
30
<xsl:template match="Order">
 
31
Order is:  <xsl:value-of select="@Name"/>
 
32
        <xsl:apply-templates select="Family"/><xsl:text>
 
33
</xsl:text>
 
34
</xsl:template>
 
35
 
 
36
<xsl:template match="Family">
 
37
        Family is:  <xsl:value-of select="@Name"/>
 
38
        <xsl:apply-templates select="Species | SubFamily | text()"/>
 
39
</xsl:template>
 
40
 
 
41
<xsl:template match="SubFamily">
 
42
                SubFamily is <xsl:value-of select="@Name"/>
 
43
    <xsl:apply-templates select="Species | text()"/>
 
44
</xsl:template>
 
45
 
 
46
<xsl:template match="Species">
 
47
        <xsl:choose>
 
48
          <xsl:when test="name(..)='SubFamily'">
 
49
                <xsl:text>      </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text><xsl:value-of select="@Scientific_Name"/>
 
50
          </xsl:when>
 
51
          <xsl:otherwise>
 
52
                <xsl:value-of select="."/><xsl:text> </xsl:text><xsl:value-of select="@Scientific_Name"/>
 
53
          </xsl:otherwise>
 
54
        </xsl:choose>
 
55
</xsl:template>
 
56
 
 
57
</xsl:stylesheet>