• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0"?>
2
3<!-- queryOnSubElement.xslt
4
5Selects  a given tag according to the content of a subelement. This transform is completely parametrized.
6
7Copyright J.M. Vanel 2000 - under GNU public licence
8
9-->
10
11
12
13<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
14
15                 version="1.0" >
16
17
18
19<xsl:param name="wantedTag">b</xsl:param>
20
21<xsl:param name="wantedsubElement">d</xsl:param>
22
23<xsl:param name="wantedString">d in b</xsl:param>
24
25
26
27  <xsl:template match="/">
28
29    <Collection>
30
31      <xsl:copy-of select="//* [ name(.) = $wantedTag]
32
33                           [ * [ name(.) = $wantedsubElement]
34
35                           [contains(., $wantedString) ] ]" />
36
37    </Collection>
38
39  </xsl:template>
40
41  <!--
42   * Licensed to the Apache Software Foundation (ASF) under one
43   * or more contributor license agreements. See the NOTICE file
44   * distributed with this work for additional information
45   * regarding copyright ownership. The ASF licenses this file
46   * to you under the Apache License, Version 2.0 (the  "License");
47   * you may not use this file except in compliance with the License.
48   * You may obtain a copy of the License at
49   *
50   *     http://www.apache.org/licenses/LICENSE-2.0
51   *
52   * Unless required by applicable law or agreed to in writing, software
53   * distributed under the License is distributed on an "AS IS" BASIS,
54   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55   * See the License for the specific language governing permissions and
56   * limitations under the License.
57  -->
58
59</xsl:stylesheet>
60