1<?xml version="1.0"?> 2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 3 4<xsl:output method="html"/> 5 6 <!-- FileName: output74 --> 7 <!-- Document: http://www.w3.org/TR/xslt --> 8 <!-- DocVersion: 19991116 --> 9 <!-- Section: 16.4 Disable output escaping. --> 10 <!-- Purpose: Spec states:It is an error for output escaping to be disabled 11 for a text node that is used for something other than a text node in the 12 result tree. Thus, it is an error to disable output escaping for an 13 xsl:value-of or xsl:text element that is used to generate the string-value 14 of a comment, processing instruction or attribute node;. OUTPUT = HTML --> 15 <!-- Author: Paul Dick --> 16 17<xsl:template match="doc"> 18 <html> 19 <out1> 20 <xsl:attribute name="attrib1"> 21 <xsl:text disable-output-escaping="no">_<Whoa-No>_</xsl:text> 22 </xsl:attribute> 23 <xsl:attribute name="attrib2"> 24 <xsl:value-of select="a" disable-output-escaping="no"/> 25 </xsl:attribute></out1> 26 27 <!-- This is the error case. It should come out as doe="no" --> 28 <out2> 29 <xsl:attribute name="attrib3"> 30 <xsl:text disable-output-escaping="yes">_<Whoa-Yes>_</xsl:text> 31 </xsl:attribute> 32 <xsl:attribute name="attrib4"> 33 <xsl:value-of select="a" disable-output-escaping="yes"/> 34 </xsl:attribute></out2 > 35 36 <h1> 37 <xsl:attribute name="title"> 38 <xsl:text disable-output-escaping="yes">_<Yes-Contacts>_</xsl:text> 39 </xsl:attribute>People</h1> 40 41 <frame> 42 <xsl:attribute name="scrolling">yes</xsl:attribute> 43 <xsl:attribute name="name"> 44 <xsl:text disable-output-escaping="yes">_<this>_</xsl:text> 45 </xsl:attribute></frame> 46 47 <out3> 48 <xsl:value-of select="a" disable-output-escaping="yes"/></out3> 49 50 </html> 51</xsl:template> 52 53 54 <!-- 55 * Licensed to the Apache Software Foundation (ASF) under one 56 * or more contributor license agreements. See the NOTICE file 57 * distributed with this work for additional information 58 * regarding copyright ownership. The ASF licenses this file 59 * to you under the Apache License, Version 2.0 (the "License"); 60 * you may not use this file except in compliance with the License. 61 * You may obtain a copy of the License at 62 * 63 * http://www.apache.org/licenses/LICENSE-2.0 64 * 65 * Unless required by applicable law or agreed to in writing, software 66 * distributed under the License is distributed on an "AS IS" BASIS, 67 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 68 * See the License for the specific language governing permissions and 69 * limitations under the License. 70 --> 71 72</xsl:stylesheet> 73