Path: blob/master/test/jaxp/javax/xml/jaxp/functional/test/gaptest/Bug4511326.java
41129 views
/*1* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package test.gaptest;2425import java.io.StringReader;2627import javax.xml.transform.TransformerConfigurationException;28import javax.xml.transform.TransformerFactory;29import javax.xml.transform.stream.StreamSource;3031import org.testng.annotations.Listeners;32import org.testng.annotations.Test;3334/*35* @test36* @bug 451132637* @library /javax/xml/jaxp/libs38* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow test.gaptest.Bug451132639* @run testng/othervm test.gaptest.Bug451132640* @summary In forwards-compatible mode the attribute isn't ignored41*/42@Listeners({jaxp.library.BasePolicy.class})43public class Bug4511326 {4445private static final String XSL = "<xsl:stylesheet version='2.0' "46+ "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>"47+ "<xsl:template a='1' match='/'>"48+ "<H2><xsl:value-of select='//author'/></H2>"49+ "<H1><xsl:value-of select='//title'/></H1>"50+ "</xsl:template>"51+ "</xsl:stylesheet>";525354@Test55public void ignoreAttTest() throws TransformerConfigurationException {56/* Create a TransformFactory instance */57TransformerFactory transformerFactory = TransformerFactory.newInstance();5859/* Create and init a StreamSource instance */60StreamSource source = new StreamSource(new StringReader(XSL));6162transformerFactory.newTransformer(source);63}6465}666768