xref: /aosp_15_r20/external/apache-xml/test/tests/bugzilla/Bugzilla4056.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1*1212f9a0SAndroid Build Coastguard Worker<?xml version="1.0" encoding="UTF-8"?>
2*1212f9a0SAndroid Build Coastguard Worker<!-- Bugzilla#4056 See also whitespace20.xsl for similar test of xml:space -->
3*1212f9a0SAndroid Build Coastguard Worker<!-- $RCSfile: Bugzilla4056.xsl,v $ $Revision$ $Date$ -->
4*1212f9a0SAndroid Build Coastguard Worker<xsl:stylesheet
5*1212f9a0SAndroid Build Coastguard Worker xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6*1212f9a0SAndroid Build Coastguard Worker version="1.0"
7*1212f9a0SAndroid Build Coastguard Worker  xmlns:java="http://xml.apache.org/xslt/java"
8*1212f9a0SAndroid Build Coastguard Worker  exclude-result-prefixes="java">
9*1212f9a0SAndroid Build Coastguard Worker  <xsl:strip-space elements="*"/>
10*1212f9a0SAndroid Build Coastguard Worker
11*1212f9a0SAndroid Build Coastguard Worker  <xsl:template match="NewsML">
12*1212f9a0SAndroid Build Coastguard Worker	<xsl:apply-templates select="NewsItem"/>
13*1212f9a0SAndroid Build Coastguard Worker  </xsl:template>
14*1212f9a0SAndroid Build Coastguard Worker
15*1212f9a0SAndroid Build Coastguard Worker  <xsl:template match="NewsItem">
16*1212f9a0SAndroid Build Coastguard Worker    <EVENT xml:space="preserve">
17*1212f9a0SAndroid Build Coastguard Worker	  <xsl:attribute name="event-id"><xsl:value-of select="Identification/NewsIdentifier/PublicIdentifier"/>:<xsl:value-of select="Identification/NewsIdentifier/RevisionId"/></xsl:attribute>
18*1212f9a0SAndroid Build Coastguard Worker	  <DIR name="content">
19*1212f9a0SAndroid Build Coastguard Worker		<STRING name="headline">
20*1212f9a0SAndroid Build Coastguard Worker		  <xsl:choose>
21*1212f9a0SAndroid Build Coastguard Worker			<xsl:when test="string-length( NewsComponent/NewsLines/HeadLine )>0">
22*1212f9a0SAndroid Build Coastguard Worker			  <xsl:apply-templates select="NewsComponent/NewsLines/HeadLine/descendant-or-self::text()"/>
23*1212f9a0SAndroid Build Coastguard Worker		  </xsl:when>
24*1212f9a0SAndroid Build Coastguard Worker		  <xsl:otherwise>
25*1212f9a0SAndroid Build Coastguard Worker			<xsl:apply-templates select="NewsComponent/NewsLines/NewsLine[NewsLineType/@FormalName='alert'][1]/NewsLineText/descendant-or-self::text()"/>
26*1212f9a0SAndroid Build Coastguard Worker		  </xsl:otherwise>
27*1212f9a0SAndroid Build Coastguard Worker		</xsl:choose>
28*1212f9a0SAndroid Build Coastguard Worker		</STRING>
29*1212f9a0SAndroid Build Coastguard Worker		<STRING name="story">
30*1212f9a0SAndroid Build Coastguard Worker		  <xsl:apply-templates select="NewsComponent/ContentItem/DataContent/descendant-or-self::text()"/>
31*1212f9a0SAndroid Build Coastguard Worker		</STRING>
32*1212f9a0SAndroid Build Coastguard Worker	  </DIR>
33*1212f9a0SAndroid Build Coastguard Worker	  <DIR name="meta">
34*1212f9a0SAndroid Build Coastguard Worker		<xsl:apply-templates select="NewsComponent/TopicSet[@FormalName='ReutersMetaData']/Topic/Property[@FormalName='Code']" mode="meta"/>
35*1212f9a0SAndroid Build Coastguard Worker
36*1212f9a0SAndroid Build Coastguard Worker		<STRING name="provider"><xsl:value-of select="Identification/NewsIdentifier/ProviderId"/></STRING>
37*1212f9a0SAndroid Build Coastguard Worker		<STRING name="any"><xsl:value-of select="Identification/NewsIdentifier/ProviderId"/></STRING>
38*1212f9a0SAndroid Build Coastguard Worker
39*1212f9a0SAndroid Build Coastguard Worker		<xsl:variable name="attribution" select="NewsComponent/AdministrativeMetadata/Source/Party/@FormalName"/>
40*1212f9a0SAndroid Build Coastguard Worker		<xsl:if test="$attribution">
41*1212f9a0SAndroid Build Coastguard Worker		  <STRING name="attribution"><xsl:value-of select="$attribution"/></STRING>
42*1212f9a0SAndroid Build Coastguard Worker		  <STRING name="any"><xsl:value-of select="$attribution"/></STRING>
43*1212f9a0SAndroid Build Coastguard Worker		</xsl:if>
44*1212f9a0SAndroid Build Coastguard Worker
45*1212f9a0SAndroid Build Coastguard Worker		<xsl:variable name="language" select="NewsComponent/DescriptiveMetadata/Language[1]/@FormalName"/>
46*1212f9a0SAndroid Build Coastguard Worker		<xsl:if test="$language">
47*1212f9a0SAndroid Build Coastguard Worker		  <STRING name="language"><xsl:value-of select="$language"/></STRING>
48*1212f9a0SAndroid Build Coastguard Worker		  <STRING name="any"><xsl:value-of select="$language"/></STRING>
49*1212f9a0SAndroid Build Coastguard Worker		</xsl:if>
50*1212f9a0SAndroid Build Coastguard Worker	  </DIR>
51*1212f9a0SAndroid Build Coastguard Worker	  <DIR name="teasers">
52*1212f9a0SAndroid Build Coastguard Worker		<STRING name="teaser0"/>
53*1212f9a0SAndroid Build Coastguard Worker		<STRING name="teaser1"/>
54*1212f9a0SAndroid Build Coastguard Worker		<STRING name="teaser2"/>
55*1212f9a0SAndroid Build Coastguard Worker		<STRING name="teaser3"/>
56*1212f9a0SAndroid Build Coastguard Worker		<STRING name="teaser4"/>
57*1212f9a0SAndroid Build Coastguard Worker	  </DIR>
58*1212f9a0SAndroid Build Coastguard Worker	</EVENT>
59*1212f9a0SAndroid Build Coastguard Worker  </xsl:template>
60*1212f9a0SAndroid Build Coastguard Worker
61*1212f9a0SAndroid Build Coastguard Worker  <xsl:template match="Property" mode="meta">
62*1212f9a0SAndroid Build Coastguard Worker	<STRING name="{../TopicType/@FormalName}"><xsl:value-of select="@Value"/></STRING>
63*1212f9a0SAndroid Build Coastguard Worker	<STRING name="any"><xsl:value-of select="@Value"/></STRING>
64*1212f9a0SAndroid Build Coastguard Worker  </xsl:template>
65*1212f9a0SAndroid Build Coastguard Worker
66*1212f9a0SAndroid Build Coastguard Worker  <!--
67*1212f9a0SAndroid Build Coastguard Worker   * Licensed to the Apache Software Foundation (ASF) under one
68*1212f9a0SAndroid Build Coastguard Worker   * or more contributor license agreements. See the NOTICE file
69*1212f9a0SAndroid Build Coastguard Worker   * distributed with this work for additional information
70*1212f9a0SAndroid Build Coastguard Worker   * regarding copyright ownership. The ASF licenses this file
71*1212f9a0SAndroid Build Coastguard Worker   * to you under the Apache License, Version 2.0 (the  "License");
72*1212f9a0SAndroid Build Coastguard Worker   * you may not use this file except in compliance with the License.
73*1212f9a0SAndroid Build Coastguard Worker   * You may obtain a copy of the License at
74*1212f9a0SAndroid Build Coastguard Worker   *
75*1212f9a0SAndroid Build Coastguard Worker   *     http://www.apache.org/licenses/LICENSE-2.0
76*1212f9a0SAndroid Build Coastguard Worker   *
77*1212f9a0SAndroid Build Coastguard Worker   * Unless required by applicable law or agreed to in writing, software
78*1212f9a0SAndroid Build Coastguard Worker   * distributed under the License is distributed on an "AS IS" BASIS,
79*1212f9a0SAndroid Build Coastguard Worker   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
80*1212f9a0SAndroid Build Coastguard Worker   * See the License for the specific language governing permissions and
81*1212f9a0SAndroid Build Coastguard Worker   * limitations under the License.
82*1212f9a0SAndroid Build Coastguard Worker  -->
83*1212f9a0SAndroid Build Coastguard Worker
84*1212f9a0SAndroid Build Coastguard Worker</xsl:stylesheet>
85