1<?xml version="1.0"?> 2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 3 4 <!-- FileName: extend03 --> 5 <!-- Document: http://www.w3.org/TR/xslt --> 6 <!-- DocVersion: 19991116 --> 7 <!-- Section: 14 Extensions --> 8 <!-- Creator: Paul Dick --> 9 <!-- Purpose: Test function-available and element-available with 10 xslt elements and functions. --> 11 12<xsl:template match="/"> 13<out><xsl:text>
</xsl:text> 14 <xsl:choose> 15 <xsl:when test="element-available('xsl:value-of')"> 16 <xsl:text>element xsl:value-of IS defined</xsl:text> 17 </xsl:when> 18 <xsl:otherwise> 19 <xsl:text>element xsl:value-of IS NOT defined</xsl:text> 20 </xsl:otherwise> 21 </xsl:choose><xsl:text>
</xsl:text> 22 23 <xsl:choose> 24 <xsl:when test="function-available('document')"> 25 <xsl:text>function document() IS defined</xsl:text> 26 </xsl:when> 27 <xsl:otherwise> 28 <xsl:text>function document() IS NOT defined</xsl:text> 29 </xsl:otherwise> 30 </xsl:choose><xsl:text>
</xsl:text> 31 32</out> 33</xsl:template> 34 35 36 <!-- 37 * Licensed to the Apache Software Foundation (ASF) under one 38 * or more contributor license agreements. See the NOTICE file 39 * distributed with this work for additional information 40 * regarding copyright ownership. The ASF licenses this file 41 * to you under the Apache License, Version 2.0 (the "License"); 42 * you may not use this file except in compliance with the License. 43 * You may obtain a copy of the License at 44 * 45 * http://www.apache.org/licenses/LICENSE-2.0 46 * 47 * Unless required by applicable law or agreed to in writing, software 48 * distributed under the License is distributed on an "AS IS" BASIS, 49 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50 * See the License for the specific language governing permissions and 51 * limitations under the License. 52 --> 53 54</xsl:stylesheet> 55