# HG changeset patch # User joehw # Date 1416340887 28800 # Node ID 85b0d46b0104e8b19690bd6a7648f6226187b659 # Parent 82f4cb44b2d7af2352f48568a64b7b6a5ae960cd 8043084: XML JAXP unittest co-location Reviewed-by: joehw, dfuchs Contributed-by: frank.yuan@oracle.com diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/TEST.ROOT --- a/jaxp/test/TEST.ROOT Wed Jul 05 20:07:55 2017 +0200 +++ b/jaxp/test/TEST.ROOT Tue Nov 18 12:01:27 2014 -0800 @@ -1,3 +1,6 @@ # This file identifies the root of the test-suite hierarchy. # It also contains test-suite configuration information. +# Tests that must run in othervm mode +othervm.dirs=javax/xml/jaxp/unittest + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/TEST.properties Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ +# jaxp test uses TestNG +TestNG.dirs = unittest + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6350682.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6350682.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.common; + +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6350682 + * @summary Test SAXParserFactory and TransformerFactory can newInstance when setContextClassLoader(null). + */ +public class Bug6350682 { + + @Test + public void testSAXParserFactory() { + try { + Thread.currentThread().setContextClassLoader(null); + if (Bug6350682.class.getClassLoader() == null) + System.out.println("this class loader is NULL"); + else + System.out.println("this class loader is NOT NULL"); + SAXParserFactory factory = SAXParserFactory.newInstance(); + Assert.assertTrue(factory != null, "Failed to get an instance of a SAXParserFactory"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testTransformerFactory() { + try { + Thread.currentThread().setContextClassLoader(null); + TransformerFactory factory = TransformerFactory.newInstance(); + Assert.assertTrue(factory != null, "Failed to get an instance of a TransformerFactory"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } catch (TransformerFactoryConfigurationError error) { + error.printStackTrace(); + Assert.fail(error.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6723276Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6723276Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.common; + +import org.testng.annotations.Test; +import org.testng.Assert; +import java.net.URL; +import java.net.URLClassLoader; + +import javax.xml.parsers.SAXParserFactory; + +/* + * @bug 6723276 + * @summary Test JAXP class can be loaded by bootstrap classloader. + */ +public class Bug6723276Test { + + @Test + public void test1() { + try { + SAXParserFactory.newInstance(); + } catch (Exception e) { + if (e.getMessage().indexOf("org.apache.xerces.jaxp.SAXParserFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } + } + } + + @Test + public void test2() { + try { + System.out.println(Thread.currentThread().getContextClassLoader()); + System.out.println(ClassLoader.getSystemClassLoader().getParent()); + Thread.currentThread().setContextClassLoader(new URLClassLoader(new URL[0], ClassLoader.getSystemClassLoader().getParent())); + SAXParserFactory.newInstance(); + } catch (Exception e) { + if (e.getMessage().indexOf("org.apache.xerces.jaxp.SAXParserFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + test + + + + information + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,501 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.common; + +import java.io.InputStream; +import java.io.StringWriter; +import java.security.AllPermission; +import java.security.Permission; +import java.security.Permissions; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; + +/* + * @bug 6941169 + * @summary Test use-service-mechanism feature. + */ +public class Bug6941169Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + private static final String DOM_FACTORY_ID = "javax.xml.parsers.DocumentBuilderFactory"; + private static final String SAX_FACTORY_ID = "javax.xml.parsers.SAXParserFactory"; + + // impl specific feature + final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism"; + + static String _xml = Bug6941169Test.class.getResource("Bug6941169.xml").getPath(); + static String _xsd = Bug6941169Test.class.getResource("Bug6941169.xsd").getPath(); + + @Test + public void testValidation_SAX_withoutServiceMech() { + System.out.println("Validation using SAX Source; Service mechnism is turned off; SAX Impl should be the default:"); + InputSource is = new InputSource(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml")); + SAXSource ss = new SAXSource(is); + System.setProperty(SAX_FACTORY_ID, "MySAXFactoryImpl"); + long start = System.currentTimeMillis(); + try { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, false); + Schema schema = factory.newSchema(new StreamSource(_xsd)); + Validator validator = schema.newValidator(); + validator.validate(ss, null); + } catch (Exception e) { + // e.printStackTrace(); + String error = e.getMessage(); + if (error.indexOf("javax.xml.parsers.FactoryConfigurationError: Provider MySAXFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } else { + System.out.println("Default impl is used"); + } + + // System.out.println(e.getMessage()); + + } + long end = System.currentTimeMillis(); + double elapsedTime = ((end - start)); + System.out.println("Time elapsed: " + elapsedTime); + System.clearProperty(SAX_FACTORY_ID); + } + + @Test + public void testValidation_SAX_withServiceMech() { + System.out.println("Validation using SAX Source. Using service mechnism (by default) to find SAX Impl:"); + InputSource is = new InputSource(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml")); + SAXSource ss = new SAXSource(is); + System.setProperty(SAX_FACTORY_ID, "MySAXFactoryImpl"); + long start = System.currentTimeMillis(); + try { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new StreamSource(_xsd)); + Validator validator = schema.newValidator(); + validator.validate(ss, null); + Assert.fail("User impl MySAXFactoryImpl should be used."); + } catch (Exception e) { + String error = e.getMessage(); + if (error.indexOf("javax.xml.parsers.FactoryConfigurationError: Provider MySAXFactoryImpl not found") > 0) { + // expected + } + // System.out.println(e.getMessage()); + + } + long end = System.currentTimeMillis(); + double elapsedTime = ((end - start)); + System.out.println("Time elapsed: " + elapsedTime); + System.clearProperty(SAX_FACTORY_ID); + } + + @Test + public void testValidation_SAX_withSM() { + System.out.println("Validation using SAX Source with security manager:"); + InputSource is = new InputSource(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml")); + SAXSource ss = new SAXSource(is); + System.setProperty(SAX_FACTORY_ID, "MySAXFactoryImpl"); + Permissions granted = new java.security.Permissions(); + granted.add(new AllPermission()); + System.setSecurityManager(new MySM(granted)); + + long start = System.currentTimeMillis(); + try { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, false); + Schema schema = factory.newSchema(new StreamSource(_xsd)); + Validator validator = schema.newValidator(); + validator.validate(ss, null); + } catch (Exception e) { + String error = e.getMessage(); + if (error.indexOf("javax.xml.parsers.FactoryConfigurationError: Provider MySAXFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } else { + System.out.println("Default impl is used"); + } + + // System.out.println(e.getMessage()); + + } finally { + System.clearProperty(SAX_FACTORY_ID); + System.setSecurityManager(null); + } + long end = System.currentTimeMillis(); + double elapsedTime = ((end - start)); + System.out.println("Time elapsed: " + elapsedTime); + System.setSecurityManager(null); + + } + + @Test + public void testTransform_DOM_withoutServiceMech() { + System.out.println("Transform using DOM Source; Service mechnism is turned off; Default DOM Impl should be the default:"); + DOMSource domSource = new DOMSource(); + domSource.setSystemId(_xml); + + // DOMSource domSource = new + // DOMSource(getDocument(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml"))); + System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl"); + long start = System.currentTimeMillis(); + try { + TransformerFactory factory = TransformerFactory.newInstance(); + factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, false); + + Transformer t = factory.newTransformer(); + + StringWriter result = new StringWriter(); + StreamResult streamResult = new StreamResult(result); + t.transform(domSource, streamResult); + System.out.println("Writing to " + result.toString()); + + } catch (Exception e) { + // e.printStackTrace(); + String error = e.getMessage(); + if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } else { + System.out.println("Default impl is used"); + } + + // System.out.println(e.getMessage()); + + } catch (Error e) { + // e.printStackTrace(); + String error = e.getMessage(); + if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } else { + System.out.println("Default impl is used"); + } + + // System.out.println(e.getMessage()); + + } + + long end = System.currentTimeMillis(); + double elapsedTime = ((end - start)); + System.out.println("Time elapsed: " + elapsedTime); + System.clearProperty(DOM_FACTORY_ID); + } + + /** this is by default */ + @Test + public void testTransform_DOM_withServiceMech() { + System.out.println("Transform using DOM Source; By default, the factory uses services mechanism to look up impl:"); + DOMSource domSource = new DOMSource(); + domSource.setSystemId(_xml); + + // DOMSource domSource = new + // DOMSource(getDocument(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml"))); + System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl"); + long start = System.currentTimeMillis(); + try { + TransformerFactory factory = TransformerFactory.newInstance(); + Transformer t = factory.newTransformer(); + + StringWriter result = new StringWriter(); + StreamResult streamResult = new StreamResult(result); + t.transform(domSource, streamResult); + System.out.println("Writing to " + result.toString()); + + Assert.fail("User impl MyDOMFactoryImpl should be used."); + + } catch (Exception e) { + String error = e.getMessage(); + if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) { + // expected + } + System.out.println(error); + + } catch (Error e) { + String error = e.getMessage(); + if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) { + // expected + } + System.out.println(error); + + } + + long end = System.currentTimeMillis(); + double elapsedTime = ((end - start)); + System.out.println("Time elapsed: " + elapsedTime); + System.clearProperty(DOM_FACTORY_ID); + } + + @Test + public void testTransform_DOM_withSM() { + System.out.println("Transform using DOM Source; Security Manager is set:"); + DOMSource domSource = new DOMSource(); + domSource.setSystemId(_xml); + + // DOMSource domSource = new + // DOMSource(getDocument(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml"))); + Permissions granted = new java.security.Permissions(); + granted.add(new AllPermission()); + System.setSecurityManager(new MySM(granted)); + System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl"); + long start = System.currentTimeMillis(); + try { + TransformerFactory factory = TransformerFactory.newInstance("com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl", + TransformerFactory.class.getClassLoader()); + Transformer t = factory.newTransformer(); + + StringWriter result = new StringWriter(); + StreamResult streamResult = new StreamResult(result); + t.transform(domSource, streamResult); + System.out.println("Writing to " + result.toString()); + + } catch (Exception e) { + String error = e.getMessage(); + if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } else { + System.out.println("Default impl is used"); + } + + // System.out.println(e.getMessage()); + + } catch (Error e) { + String error = e.getMessage(); + if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } else { + System.out.println("Default impl is used"); + } + + // System.out.println(e.getMessage()); + + } finally { + System.clearProperty(DOM_FACTORY_ID); + System.setSecurityManager(null); + } + long end = System.currentTimeMillis(); + double elapsedTime = ((end - start)); + System.out.println("Time elapsed: " + elapsedTime); + System.clearProperty(DOM_FACTORY_ID); + } + + @Test + public void testXPath_DOM_withoutServiceMech() { + final String XPATH_EXPRESSION = "/fooTest"; + System.out.println("Evaluate DOM Source; Service mechnism is turned off; Default DOM Impl should be used:"); + Document doc = getDocument(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml")); + System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl"); + long start = System.currentTimeMillis(); + try { + XPathFactory xPathFactory = XPathFactory.newInstance(); + xPathFactory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, false); + + XPath xPath = xPathFactory.newXPath(); + + String xPathResult = xPath.evaluate(XPATH_EXPRESSION, doc); + + } catch (Exception e) { + // e.printStackTrace(); + String error = e.getMessage(); + if (error.indexOf("MyDOMFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } else { + System.out.println("Default impl is used"); + } + + // System.out.println(e.getMessage()); + + } catch (Error e) { + // e.printStackTrace(); + String error = e.getMessage(); + if (error.indexOf("MyDOMFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } else { + System.out.println("Default impl is used"); + } + + // System.out.println(e.getMessage()); + + } + + long end = System.currentTimeMillis(); + double elapsedTime = ((end - start)); + System.out.println("Time elapsed: " + elapsedTime); + System.clearProperty(DOM_FACTORY_ID); + } + + @Test + public void testXPath_DOM_withServiceMech() { + final String XPATH_EXPRESSION = "/fooTest"; + System.out.println("Evaluate DOM Source; Service mechnism is on by default; It would try to use MyDOMFactoryImpl:"); + InputStream input = getClass().getResourceAsStream("Bug6941169.xml"); + InputSource source = new InputSource(input); + System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl"); + long start = System.currentTimeMillis(); + try { + XPathFactory xPathFactory = XPathFactory.newInstance(); + + XPath xPath = xPathFactory.newXPath(); + + String xPathResult = xPath.evaluate(XPATH_EXPRESSION, source); + Assert.fail("User impl MyDOMFactoryImpl should be used."); + + } catch (Exception e) { + // e.printStackTrace(); + String error = e.getMessage(); + if (error.indexOf("MyDOMFactoryImpl not found") > 0) { + System.out.println("Tried to locate MyDOMFactoryImpl"); + } else { + Assert.fail(e.getMessage()); + + } + + // System.out.println(e.getMessage()); + + } catch (Error e) { + // e.printStackTrace(); + String error = e.getMessage(); + if (error.indexOf("MyDOMFactoryImpl not found") > 0) { + System.out.println("Tried to locate MyDOMFactoryImpl"); + } else { + Assert.fail(e.getMessage()); + + } + + // System.out.println(e.getMessage()); + + } + + long end = System.currentTimeMillis(); + double elapsedTime = ((end - start)); + System.out.println("Time elapsed: " + elapsedTime); + System.clearProperty(DOM_FACTORY_ID); + } + + @Test + public void testXPath_DOM_withSM() { + final String XPATH_EXPRESSION = "/fooTest"; + System.out.println("Evaluate DOM Source; Security Manager is set:"); + Permissions granted = new java.security.Permissions(); + granted.add(new AllPermission()); + System.setSecurityManager(new MySM(granted)); + InputStream input = getClass().getResourceAsStream("Bug6941169.xml"); + InputSource source = new InputSource(input); + System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl"); + long start = System.currentTimeMillis(); + try { + XPathFactory xPathFactory = XPathFactory.newInstance("http://java.sun.com/jaxp/xpath/dom", + "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl", null); + + XPath xPath = xPathFactory.newXPath(); + + String xPathResult = xPath.evaluate(XPATH_EXPRESSION, source); + System.out.println("Use default impl"); + } catch (Exception e) { + // e.printStackTrace(); + String error = e.getMessage(); + if (error.indexOf("MyDOMFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } else { + System.out.println("Default impl should be used"); + } + + // System.out.println(e.getMessage()); + + } catch (Error e) { + // e.printStackTrace(); + String error = e.getMessage(); + if (error.indexOf("MyDOMFactoryImpl not found") > 0) { + Assert.fail(e.getMessage()); + } else { + System.out.println("Default impl should be used"); + } + + // System.out.println(e.getMessage()); + + } finally { + System.clearProperty(DOM_FACTORY_ID); + System.setSecurityManager(null); + } + long end = System.currentTimeMillis(); + double elapsedTime = ((end - start)); + System.out.println("Time elapsed: " + elapsedTime); + System.clearProperty(DOM_FACTORY_ID); + } + + @Test + public void testSM() { + SecurityManager sm = System.getSecurityManager(); + if (System.getSecurityManager() != null) { + System.out.println("Security manager not cleared: " + sm.toString()); + } else { + System.out.println("Security manager cleared: "); + } + } + + private static Document getDocument(InputStream in) { + + Document document = null; + + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder db = dbf.newDocumentBuilder(); + document = db.parse(in); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + + return document; + } + + class MySM extends SecurityManager { + Permissions granted; + + public MySM(Permissions perms) { + granted = perms; + } + + @Override + public void checkPermission(Permission perm) { + if (granted.implies(perm)) { + return; + } + super.checkPermission(perm); + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6979306Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6979306Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.common; + +import org.testng.annotations.Test; + +import com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck; + +/* + * @bug 6979306 + * @summary Test JAXP component version. + */ +public class Bug6979306Test { + + @Test + public void test() { + String[] input = {}; + EnvironmentCheck.main(input); + com.sun.org.apache.xerces.internal.impl.Version.main(input); + com.sun.org.apache.xalan.internal.Version._main(input); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug7143711Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug7143711Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.common; + +import java.security.AllPermission; +import java.security.Permission; +import java.security.Permissions; + +import javax.xml.XMLConstants; +import javax.xml.transform.TransformerFactory; +import javax.xml.validation.SchemaFactory; +import javax.xml.xpath.XPathFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 7143711 + * @summary Test set use-service-mechanism shall not override what's set by the constructor in secure mode. + */ +public class Bug7143711Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + private static final String DOM_FACTORY_ID = "javax.xml.parsers.DocumentBuilderFactory"; + private static final String SAX_FACTORY_ID = "javax.xml.parsers.SAXParserFactory"; + + // impl specific feature + final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism"; + + @Test + public void testValidation_SAX_withSM() { + System.out.println("Validation using SAX Source with security manager:"); + System.setProperty(SAX_FACTORY_ID, "MySAXFactoryImpl"); + Permissions granted = new java.security.Permissions(); + granted.add(new AllPermission()); + System.setSecurityManager(new MySM(granted)); + + try { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + // should not allow + factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, true); + if ((boolean) factory.getFeature(ORACLE_FEATURE_SERVICE_MECHANISM)) { + Assert.fail("should not override in secure mode"); + } + } catch (Exception e) { + Assert.fail(e.getMessage()); + + } finally { + System.clearProperty(SAX_FACTORY_ID); + System.setSecurityManager(null); + } + + System.setSecurityManager(null); + + } + + @Test + public void testTransform_DOM_withSM() { + System.out.println("Transform using DOM Source; Security Manager is set:"); + + Permissions granted = new java.security.Permissions(); + granted.add(new AllPermission()); + System.setSecurityManager(new MySM(granted)); + System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl"); + + try { + TransformerFactory factory = TransformerFactory.newInstance("com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl", + TransformerFactory.class.getClassLoader()); + factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, true); + if (((com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl) factory).useServicesMechnism()) { + Assert.fail("should not override in secure mode"); + } + + } catch (Exception e) { + Assert.fail(e.getMessage()); + } finally { + System.clearProperty(DOM_FACTORY_ID); + System.setSecurityManager(null); + } + + System.clearProperty(DOM_FACTORY_ID); + } + + @Test + public void testXPath_DOM_withSM() { + System.out.println("Evaluate DOM Source; Security Manager is set:"); + Permissions granted = new java.security.Permissions(); + granted.add(new AllPermission()); + System.setSecurityManager(new MySM(granted)); + System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl"); + + try { + XPathFactory xPathFactory = XPathFactory.newInstance("http://java.sun.com/jaxp/xpath/dom", + "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl", null); + xPathFactory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, true); + if ((boolean) xPathFactory.getFeature(ORACLE_FEATURE_SERVICE_MECHANISM)) { + Assert.fail("should not override in secure mode"); + } + + } catch (Exception e) { + Assert.fail(e.getMessage()); + } finally { + System.clearProperty(DOM_FACTORY_ID); + System.setSecurityManager(null); + } + + System.clearProperty(DOM_FACTORY_ID); + } + + @Test + public void testSM() { + SecurityManager sm = System.getSecurityManager(); + if (System.getSecurityManager() != null) { + System.out.println("Security manager not cleared: " + sm.toString()); + } else { + System.out.println("Security manager cleared: "); + } + } + + class MySM extends SecurityManager { + Permissions granted; + + public MySM(Permissions perms) { + granted = perms; + } + + @Override + public void checkPermission(Permission perm) { + if (granted.implies(perm)) { + return; + } + super.checkPermission(perm); + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6320118.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6320118.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.datatype; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.XMLGregorianCalendar; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6320118 + * @summary Test xml datatype XMLGregorianCalendar. + */ +public class Bug6320118 { + + DatatypeFactory df; + + @Test + public void test1() { + try { + df = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException e) { + Assert.fail(e.getMessage()); + } + + try { + XMLGregorianCalendar calendar = df.newXMLGregorianCalendar(1970, 1, 1, 24, 0, 0, 0, 0); + } catch (IllegalArgumentException e) { + Assert.fail(e.getMessage()); + } + } + + @Test + public void test2() { + try { + df = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException e) { + Assert.fail(e.getMessage()); + } + + try { + XMLGregorianCalendar calendar = df.newXMLGregorianCalendarTime(24, 0, 0, 0); + } catch (IllegalArgumentException e) { + Assert.fail(e.getMessage()); + } + } + + @Test + public void test3() { + try { + df = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException e) { + Assert.fail(e.getMessage()); + } + try { + XMLGregorianCalendar calendar = df.newXMLGregorianCalendar(); + // Must fail as other params are not 0 but undefined + calendar.setHour(24); + Assert.fail("test3() - Expected IllegalArgumentException not thrown"); + } catch (IllegalArgumentException e) { + // falls through + } + } + + @Test + public void test4() { + try { + df = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException e) { + Assert.fail(e.getMessage()); + } + + try { + XMLGregorianCalendar calendar = df.newXMLGregorianCalendar(); + calendar.setTime(24, 0, 0, 0); + } catch (IllegalArgumentException e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6937951Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6937951Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.datatype; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6937951 + * @summary Test midnight is same as the start of the next day in XMLGregorianCalendar. + */ +public class Bug6937951Test { + + @Test + public void test() throws DatatypeConfigurationException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + XMLGregorianCalendar c1 = dtf.newXMLGregorianCalendar("1999-12-31T24:00:00"); + XMLGregorianCalendar c2 = dtf.newXMLGregorianCalendar("2000-01-01T00:00:00"); + System.out.println("c1: " + c1.getYear() + "-" + c1.getMonth() + "-" + c1.getDay() + "T" + c1.getHour()); + System.out.println(c1.equals(c2) ? "pass" : "fail"); // fails + if (!c1.equals(c2)) + Assert.fail("hour 24 needs to be treated as equal to hour 0 of the next day"); + if (c1.getYear() != 2000 && c1.getHour() != 0) + Assert.fail("hour 24 needs to be treated as equal to hour 0 of the next day"); + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6937964Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6937964Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.datatype; + +import java.math.BigDecimal; +import java.math.BigInteger; + +import javax.xml.namespace.QName; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6937964 + * @summary Test Duration is normalized. + */ +public class Bug6937964Test { + /** + * Print debugging to System.err. + */ + private static final boolean DEBUG = false; + /** + * Constant to indicate expected lexical test failure. + */ + private static final String TEST_VALUE_FAIL = "*FAIL*"; + + private static final String FIELD_UNDEFINED = "FIELD_UNDEFINED"; + static final DatatypeConstants.Field[] fields = { DatatypeConstants.YEARS, DatatypeConstants.MONTHS, DatatypeConstants.DAYS, DatatypeConstants.HOURS, + DatatypeConstants.MINUTES, DatatypeConstants.SECONDS }; + + @Test + public void test() throws DatatypeConfigurationException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + Duration d = dtf.newDurationYearMonth("P20Y15M"); + int years = d.getYears(); + System.out.println(d.getYears() == 21 ? "pass" : "fail"); + } + + @Test + public void testNewDurationYearMonthLexicalRepresentation() throws DatatypeConfigurationException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + Duration d = dtf.newDurationYearMonth("P20Y15M"); + int years = d.getYears(); + Assert.assertTrue(years == 21, "Return value should be normalized"); + } + + @Test + public void testNewDurationYearMonthMilliseconds() throws DatatypeConfigurationException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + Duration d = dtf.newDurationYearMonth(671976000000L); + int years = d.getYears(); + System.out.println("Years: " + years); + Assert.assertTrue(years == 21, "Return value should be normalized"); + } + + @Test + public void testNewDurationYearMonthBigInteger() throws DatatypeConfigurationException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + BigInteger year = new BigInteger("20"); + BigInteger mon = new BigInteger("15"); + Duration d = dtf.newDurationYearMonth(true, year, mon); + int years = d.getYears(); + Assert.assertTrue(years == 21, "Return value should be normalized"); + } + + @Test + public void testNewDurationYearMonthInt() throws DatatypeConfigurationException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + Duration d = dtf.newDurationYearMonth(true, 20, 15); + int years = d.getYears(); + Assert.assertTrue(years == 21, "Return value should be normalized"); + } + + @Test + public void testNewDurationDayTimeLexicalRepresentation() throws DatatypeConfigurationException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + Duration d = dtf.newDurationDayTime("P1DT23H59M65S"); + int days = d.getDays(); + Assert.assertTrue(days == 2, "Return value should be normalized"); + } + + @Test + public void testNewDurationDayTimeMilliseconds() throws DatatypeConfigurationException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + Duration d = dtf.newDurationDayTime(172805000L); + int days = d.getDays(); + Assert.assertTrue(days == 2, "Return value should be normalized"); + } + + @Test + public void testNewDurationDayTimeBigInteger() throws DatatypeConfigurationException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + BigInteger day = new BigInteger("1"); + BigInteger hour = new BigInteger("23"); + BigInteger min = new BigInteger("59"); + BigInteger sec = new BigInteger("65"); + Duration d = dtf.newDurationDayTime(true, day, hour, min, sec); + int days = d.getDays(); + System.out.println("Days: " + days); + Assert.assertTrue(days == 2, "Return value should be normalized"); + } + + @Test + public void testNewDurationDayTimeInt() throws DatatypeConfigurationException { + DatatypeFactory dtf = DatatypeFactory.newInstance(); + Duration d = dtf.newDurationDayTime(true, 1, 23, 59, 65); + int days = d.getDays(); + System.out.println("Days: " + days); + Assert.assertTrue(days == 2, "Return value should be normalized"); + } + + @Test + public final void testNewDurationYearMonthLexicalRepresentation1() { + + /** + * Lexical test values to test. + */ + final String[] TEST_VALUES_LEXICAL = { "P13M", "P1Y1M", "-P13M", "-P1Y1M", "P1Y", "P1Y", "-P1Y", "-P1Y", "P1Y25M", "P3Y1M", "-P1Y25M", "-P3Y1M" }; + + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException datatypeConfigurationException) { + Assert.fail(datatypeConfigurationException.toString()); + } + + if (DEBUG) { + System.err.println("DatatypeFactory created: " + datatypeFactory.toString()); + } + + // test each value + for (int onTestValue = 0; onTestValue < TEST_VALUES_LEXICAL.length; onTestValue = onTestValue + 2) { + + if (DEBUG) { + System.err.println("testing value: \"" + TEST_VALUES_LEXICAL[onTestValue] + "\", expecting: \"" + TEST_VALUES_LEXICAL[onTestValue + 1] + "\""); + } + + try { + Duration duration = datatypeFactory.newDurationYearMonth(TEST_VALUES_LEXICAL[onTestValue]); + + if (DEBUG) { + System.err.println("Duration created: \"" + duration.toString() + "\""); + } + + // was this expected to fail? + if (TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is invalid yet it created the Duration \"" + duration.toString() + "\""); + } + + // right XMLSchemaType? + // TODO: enable test, it should pass, it fails with Exception(s) + // for now due to a bug + try { + QName xmlSchemaType = duration.getXMLSchemaType(); + if (!xmlSchemaType.equals(DatatypeConstants.DURATION_YEARMONTH)) { + Assert.fail("Duration created with XMLSchemaType of\"" + xmlSchemaType + "\" was expected to be \"" + + DatatypeConstants.DURATION_YEARMONTH + "\" and has the value \"" + duration.toString() + "\""); + } + } catch (IllegalStateException illegalStateException) { + // TODO; this test really should pass + System.err.println("Please fix this bug that is being ignored, for now: " + illegalStateException.getMessage()); + } + + // does it have the right value? + if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(duration.toString())) { + Assert.fail("Duration created with \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" was expected to be \"" + + TEST_VALUES_LEXICAL[onTestValue + 1] + "\" and has the value \"" + duration.toString() + "\""); + } + + // Duration created with correct value + } catch (Exception exception) { + + if (DEBUG) { + System.err.println("Exception in creating duration: \"" + exception.toString() + "\""); + } + + // was this expected to succed? + if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\""); + } + // expected failure + } + } + } + + /** + * TCK test failure + */ + @Test + public void testNewDurationDayTime005() { + BigInteger one = new BigInteger("1"); + BigInteger zero = new BigInteger("0"); + BigDecimal bdZero = new BigDecimal("0"); + BigDecimal bdOne = new BigDecimal("1"); + + Object[][] values = { + // lex, isPositive, years, month, days, hours, minutes, seconds + { "P1D", Boolean.TRUE, null, null, one, zero, zero, bdZero }, { "PT1H", Boolean.TRUE, null, null, zero, one, zero, bdZero }, + { "PT1M", Boolean.TRUE, null, null, zero, zero, one, bdZero }, { "PT1.1S", Boolean.TRUE, null, null, zero, zero, zero, bdOne }, + { "-PT1H1.1S", Boolean.FALSE, null, null, zero, one, zero, bdOne }, }; + + StringBuffer result = new StringBuffer(); + DatatypeFactory df = null; + + try { + df = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException e) { + Assert.fail(e.toString()); + } + + for (int valueIndex = 0; valueIndex < values.length; ++valueIndex) { + Duration duration = null; + try { + duration = df.newDurationDayTime(values[valueIndex][1].equals(Boolean.TRUE), ((BigInteger) values[valueIndex][4]).intValue(), + ((BigInteger) values[valueIndex][5]).intValue(), ((BigInteger) values[valueIndex][6]).intValue(), + ((BigDecimal) values[valueIndex][7]).intValue()); + } catch (IllegalArgumentException e) { + result.append("; unexpected " + e + " trying to create duration \'" + values[valueIndex][0] + "\'"); + } + if (duration != null) { + if ((duration.getSign() == 1) != values[valueIndex][1].equals(Boolean.TRUE)) { + result.append("; " + values[valueIndex][0] + ": wrong sign " + duration.getSign() + ", expected " + values[valueIndex][1]); + } + for (int i = 0; i < fields.length; ++i) { + Number value = duration.getField(fields[i]); + if ((value != null && values[valueIndex][2 + i] == null) || (value == null && values[valueIndex][2 + i] != null) + || (value != null && !value.equals(values[valueIndex][2 + i]))) { + result.append("; " + values[valueIndex][0] + ": wrong value of the field " + fields[i] + ": \'" + value + "\'" + ", expected \'" + + values[valueIndex][2 + i] + "\'"); + } + } + } + } + + if (result.length() > 0) { + Assert.fail(result.substring(2)); + } + System.out.println("OK"); + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug7042647Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug7042647Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.datatype; + +import java.util.Calendar; +import java.util.GregorianCalendar; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 7042647 + * @summary Test getFirstDayOfWeek is correct after converting XMLGregorianCalendar to a GregorianCalendar. + */ +public class Bug7042647Test { + + @Test + public void test() throws DatatypeConfigurationException { + XMLGregorianCalendar xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(1970, 1, 1, 0, 0, 0, 0, 0); + GregorianCalendar calendar = xmlCalendar.toGregorianCalendar(); + int firstDayOfWeek = calendar.getFirstDayOfWeek(); + Calendar defaultCalendar = Calendar.getInstance(); + int defaultFirstDayOfWeek = defaultCalendar.getFirstDayOfWeek(); + if (firstDayOfWeek != defaultFirstDayOfWeek) { + Assert.fail("Failed firstDayOfWeek=" + firstDayOfWeek + " != defaultFirstDayOfWeek=" + defaultFirstDayOfWeek); + } else { + System.out.println("Success firstDayOfWeek=" + firstDayOfWeek + " == defaultFirstDayOfWeek=" + defaultFirstDayOfWeek); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/DatatypeFactoryTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/DatatypeFactoryTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,631 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.datatype; + +import java.math.BigDecimal; +import java.math.BigInteger; + +import javax.xml.namespace.QName; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test DatatypeFactory. + */ +public class DatatypeFactoryTest { + + private static final boolean DEBUG = false; + + private static final String TEST_VALUE_FAIL = "*FAIL*"; + + private static final String FIELD_UNDEFINED = "FIELD_UNDEFINED"; + + static int parseInt(String value) { + return FIELD_UNDEFINED.equals(value) ? DatatypeConstants.FIELD_UNDEFINED : Integer.parseInt(value); + } + + static BigDecimal parseBigDecimal(String value) { + return FIELD_UNDEFINED.equals(value) ? null : new BigDecimal(value); + } + + static BigInteger parseBigInteger(String value) { + return FIELD_UNDEFINED.equals(value) ? null : new BigInteger(value); + } + + @Test + public final void testNewDurationMilliseconds() { + + /* + * to generate millisecond values + * final TimeZone GMT = TimeZone.getTimeZone("GMT"); GregorianCalendar + * gregorianCalendar = new GregorianCalendar(GMT); + * gregorianCalendar.setTimeInMillis(0); + * gregorianCalendar.add(Calendar.HOUR_OF_DAY, 1); + * gregorianCalendar.add(Calendar.MINUTE, 1); + * System.err.println("1 hour, 1 minute = " + + * gregorianCalendar.getTimeInMillis() + " milliseconds"); + */ + + /** + * Millisecond test values to test. + */ + final long[] TEST_VALUES_MILLISECONDS = { 0L, // 0 + 1L, // 1 millisecond + -1L, 1000L, // 1 second + -1000L, 1001L, // 1 second, 1 millisecond + -1001L, 60000L, // 1 minute + -60000L, 61000L, // 1 minute, 1 second + -61000L, 3600000L, // 1 hour + -3600000L, 3660000L, // 1 hour, 1 minute + -3660000L, 86400000L, // 1 day + -86400000L, 90000000L, // 1 day, 1 hour + -90000000L, 2678400000L, // 1 month + -2678400000L, 2764800000L, // 1 month, 1 day + -2764800000L, 31536000000L, // 1 year + -31536000000L, 34214400000L, // 1 year, 1 month + -34214400000L }; + + /** + * Millisecond test value results of test. + */ + final String[] TEST_VALUES_MILLISECONDS_RESULTS = { "P0Y0M0DT0H0M0.000S", // 0 + "P0Y0M0DT0H0M0.001S", // 1 millisecond + "-P0Y0M0DT0H0M0.001S", "P0Y0M0DT0H0M1.000S", // 1 second + "-P0Y0M0DT0H0M1.000S", "P0Y0M0DT0H0M1.001S", // 1 second, 1 + // millisecond + "-P0Y0M0DT0H0M1.001S", "P0Y0M0DT0H1M0.000S", // 1 minute + "-P0Y0M0DT0H1M0.000S", "P0Y0M0DT0H1M1.000S", // 1 minute, 1 + // second + "-P0Y0M0DT0H1M1.000S", "P0Y0M0DT1H0M0.000S", // 1 hour + "-P0Y0M0DT1H0M0.000S", "P0Y0M0DT1H1M0.000S", // 1 hour, 1 minute + "-P0Y0M0DT1H1M0.000S", "P0Y0M1DT0H0M0.000S", // 1 day + "-P0Y0M1DT0H0M0.000S", "P0Y0M1DT1H0M0.000S", // 1 day, 1 hour + "-P0Y0M1DT1H0M0.000S", "P0Y1M0DT0H0M0.000S", // 1 month + "-P0Y1M0DT0H0M0.000S", "P0Y1M1DT0H0M0.000S", // 1 month, 1 day + "-P0Y1M1DT0H0M0.000S", "P1Y0M0DT0H0M0.000S", // 1 year + "-P1Y0M0DT0H0M0.000S", "P1Y1M0DT0H0M0.000S", // 1 year, 1 month + "-P1Y1M0DT0H0M0.000S" }; + + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException datatypeConfigurationException) { + Assert.fail(datatypeConfigurationException.toString()); + } + + if (DEBUG) { + System.err.println("DatatypeFactory created: " + datatypeFactory.toString()); + } + + // test each value + for (int onTestValue = 0; onTestValue < TEST_VALUES_MILLISECONDS.length; onTestValue++) { + + if (DEBUG) { + System.err.println("testing value: \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\", expecting: \"" + + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\""); + } + + try { + Duration duration = datatypeFactory.newDuration(TEST_VALUES_MILLISECONDS[onTestValue]); + + if (DEBUG) { + System.err.println("Duration created: \"" + duration.toString() + "\""); + } + + // was this expected to fail? + if (TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is invalid yet it created the Duration \"" + duration.toString() + + "\""); + } + + // right XMLSchemaType? + QName xmlSchemaType = duration.getXMLSchemaType(); + if (!xmlSchemaType.equals(DatatypeConstants.DURATION)) { + Assert.fail("Duration created with XMLSchemaType of\"" + xmlSchemaType + "\" was expected to be \"" + DatatypeConstants.DURATION + + "\" and has the value \"" + duration.toString() + "\""); + } + + // does it have the right value? + if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(duration.toString())) { + Assert.fail("Duration created with \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" was expected to be \"" + + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\" and has the value \"" + duration.toString() + "\""); + } + + // Duration created with correct value + } catch (Exception exception) { + + if (DEBUG) { + System.err.println("Exception in creating duration: \"" + exception.toString() + "\""); + } + + // was this expected to succed? + if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\""); + } + // expected failure + } + } + } + + /** + * Test {@link DatatypeFactory.newDurationYearMonth(String + * lexicalRepresentation)}. + */ + @Test + public final void testNewDurationYearMonthLexicalRepresentation() { + + /** + * Lexical test values to test. + */ + final String[] TEST_VALUES_LEXICAL = { null, TEST_VALUE_FAIL, "", TEST_VALUE_FAIL, "-", TEST_VALUE_FAIL, "P", TEST_VALUE_FAIL, "-P", TEST_VALUE_FAIL, + "P1D", TEST_VALUE_FAIL, "P1Y1M1D", TEST_VALUE_FAIL, "P1M", "P1M", "-P1M", "-P1M", "P1Y", "P1Y", "-P1Y", "-P1Y", "P1Y1M", "P1Y1M", "-P1Y1M", + "-P1Y1M" }; + + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException datatypeConfigurationException) { + Assert.fail(datatypeConfigurationException.toString()); + } + + if (DEBUG) { + System.err.println("DatatypeFactory created: " + datatypeFactory.toString()); + } + + // test each value + for (int onTestValue = 0; onTestValue < TEST_VALUES_LEXICAL.length; onTestValue = onTestValue + 2) { + + if (DEBUG) { + System.err.println("testing value: \"" + TEST_VALUES_LEXICAL[onTestValue] + "\", expecting: \"" + TEST_VALUES_LEXICAL[onTestValue + 1] + "\""); + } + + try { + Duration duration = datatypeFactory.newDurationYearMonth(TEST_VALUES_LEXICAL[onTestValue]); + + if (DEBUG) { + System.err.println("Duration created: \"" + duration.toString() + "\""); + } + + // was this expected to fail? + if (TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is invalid yet it created the Duration \"" + duration.toString() + "\""); + } + + // right XMLSchemaType? + // TODO: enable test, it should pass, it fails with Exception(s) + // for now due to a bug + try { + QName xmlSchemaType = duration.getXMLSchemaType(); + if (!xmlSchemaType.equals(DatatypeConstants.DURATION_YEARMONTH)) { + Assert.fail("Duration created with XMLSchemaType of\"" + xmlSchemaType + "\" was expected to be \"" + + DatatypeConstants.DURATION_YEARMONTH + "\" and has the value \"" + duration.toString() + "\""); + } + } catch (IllegalStateException illegalStateException) { + // TODO; this test really should pass + System.err.println("Please fix this bug that is being ignored, for now: " + illegalStateException.getMessage()); + } + + // does it have the right value? + if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(duration.toString())) { + Assert.fail("Duration created with \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" was expected to be \"" + + TEST_VALUES_LEXICAL[onTestValue + 1] + "\" and has the value \"" + duration.toString() + "\""); + } + + // Duration created with correct value + } catch (Exception exception) { + + if (DEBUG) { + System.err.println("Exception in creating duration: \"" + exception.toString() + "\""); + } + + // was this expected to succed? + if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\""); + } + // expected failure + } + } + } + + /** + * Test {@link DatatypeFactory.newDurationYearMonth(long milliseconds)}. + * + */ + @Test + public final void testNewDurationYearMonthMilliseconds() { + + /** + * Millisecond test values to test. + */ + final long[] TEST_VALUES_MILLISECONDS = { 0L, 1L, -1L, 2678400000L, // 31 + // days, + // e.g. + // 1 + // month + -2678400000L, 5270400000L, // 61 days, e.g. 2 months + -5270400000L, 31622400000L, // 366 days, e.g. 1 year + -31622400000L, 34300800000L, // 397 days, e.g. 1 year, 1 month + -34300800000L }; + + /** + * Millisecond test value results of test. + */ + final String[] TEST_VALUES_MILLISECONDS_RESULTS = { "P0Y0M", "P0Y0M", "P0Y0M", "P0Y1M", "-P0Y1M", "P0Y2M", "-P0Y2M", "P1Y0M", "-P1Y0M", "P1Y1M", + "-P1Y1M" }; + + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException datatypeConfigurationException) { + Assert.fail(datatypeConfigurationException.toString()); + } + + if (DEBUG) { + System.err.println("DatatypeFactory created: " + datatypeFactory.toString()); + } + + // test each value + for (int onTestValue = 0; onTestValue < TEST_VALUES_MILLISECONDS.length; onTestValue++) { + + if (DEBUG) { + System.err.println("testing value: \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\", expecting: \"" + + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\""); + } + + try { + Duration duration = datatypeFactory.newDurationYearMonth(TEST_VALUES_MILLISECONDS[onTestValue]); + + if (DEBUG) { + System.err.println("Duration created: \"" + duration.toString() + "\""); + } + + // was this expected to fail? + if (TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is invalid yet it created the Duration \"" + duration.toString() + + "\""); + } + + // right XMLSchemaType? + QName xmlSchemaType = duration.getXMLSchemaType(); + if (!xmlSchemaType.equals(DatatypeConstants.DURATION_YEARMONTH)) { + Assert.fail("Duration created with XMLSchemaType of\"" + xmlSchemaType + "\" was expected to be \"" + DatatypeConstants.DURATION_YEARMONTH + + "\" and has the value \"" + duration.toString() + "\""); + } + + // does it have the right value? + if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(duration.toString())) { + Assert.fail("Duration created with \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" was expected to be \"" + + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\" and has the value \"" + duration.toString() + "\""); + } + + // only YEAR & MONTH should have values + int days = duration.getDays(); + int hours = duration.getHours(); + int minutes = duration.getMinutes(); + if (days != 0 || hours != 0 || minutes != 0) { + Assert.fail("xdt:yearMonthDuration created without discarding remaining milliseconds: " + " days = " + days + ", hours = " + hours + + ", minutess = " + minutes); + } + + // Duration created with correct values + } catch (Exception exception) { + + if (DEBUG) { + System.err.println("Exception in creating duration: \"" + exception.toString() + "\""); + } + + // was this expected to succed? + if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\""); + } + // expected failure + } + } + } + + /** + * Test {@link DatatypeFactory.newDurationDayTime(long milliseconds)}. + */ + @Test + public final void testNewDurationDayTime() { + + /** + * Millisecond test values to test. + */ + final long[] TEST_VALUES_MILLISECONDS = { 0L, 1L, -1L, 2678400000L, // 31 + // days, + // e.g. + // 1 + // month + -2678400000L, 5270400000L, // 61 days, e.g. 2 months + -5270400000L, 31622400000L, // 366 days, e.g. 1 year + -31622400000L, 34300800000L, // 397 days, e.g. 1 year, 1 month + -34300800000L }; + + /** + * Millisecond test value results of test. + */ + final String[] TEST_VALUES_MILLISECONDS_RESULTS = { "P0Y0M0DT0H0M0.000S", "P0Y0M0DT0H0M0.001S", "-P0Y0M0DT0H0M0.001S", "P0Y1M", "-P0Y1M", "P0Y2M", + "-P0Y2M", "P1Y0M", "-P1Y0M", "P1Y1M", "-P1Y1M" }; + + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException datatypeConfigurationException) { + Assert.fail(datatypeConfigurationException.toString()); + } + + if (DEBUG) { + System.err.println("DatatypeFactory created: " + datatypeFactory.toString()); + } + + // test each value + for (int onTestValue = 0; onTestValue < TEST_VALUES_MILLISECONDS.length; onTestValue++) { + + if (DEBUG) { + System.err.println("testing value: \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\", expecting: \"" + + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\""); + } + + try { + Duration duration = datatypeFactory.newDurationDayTime(TEST_VALUES_MILLISECONDS[onTestValue]); + + if (DEBUG) { + System.err.println("Duration created: \"" + duration.toString() + "\""); + } + + // was this expected to fail? + if (TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is invalid yet it created the Duration \"" + duration.toString() + + "\""); + } + + // does it have the right value? + if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(duration.toString())) { + // TODO: this is bug that should be fixed + if (false) { + Assert.fail("Duration created with \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" was expected to be \"" + + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\" and has the value \"" + duration.toString() + "\""); + } else { + System.err.println("Please fix this bug: " + "Duration created with \"" + TEST_VALUES_MILLISECONDS[onTestValue] + + "\" was expected to be \"" + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\" and has the value \"" + duration.toString() + + "\""); + } + } + + // only day, hour, minute, and second should have values + QName xmlSchemaType = duration.getXMLSchemaType(); + int years = duration.getYears(); + int months = duration.getMonths(); + + if (!xmlSchemaType.equals(DatatypeConstants.DURATION_DAYTIME) || years != 0 || months != 0) { + // TODO: this is bug that should be fixed + if (false) { + Assert.fail("xdt:dayTimeDuration created without discarding remaining milliseconds: " + " XMLSchemaType = " + xmlSchemaType + + ", years = " + years + ", months = " + months); + } else { + System.err.println("Please fix this bug: " + "xdt:dayTimeDuration created without discarding remaining milliseconds: " + + " XMLSchemaType = " + xmlSchemaType + ", years = " + years + ", months = " + months); + } + } + + // Duration created with correct values + } catch (Exception exception) { + + if (DEBUG) { + System.err.println("Exception in creating duration: \"" + exception.toString() + "\""); + } + + // was this expected to succed? + if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\""); + } + // expected failure + } + } + } + + /** + * Test {@link DatatypeFactory.newXMLGregorianCalendar(String + * lexicalRepresentation)}. + */ + @Test + public final void testNewXMLGregorianCalendarLexicalRepresentation() { + + /** + * Lexical test values to test. + */ + final String[] TEST_VALUES_LEXICAL = { null, TEST_VALUE_FAIL, "", TEST_VALUE_FAIL, "---01", "---01", // gDay + "---01Z", "---01Z", // gDay, UTC + "---01-08:00", "---01-08:00", // gDay, PDT + "--01--", TEST_VALUE_FAIL, // gMonth pre errata, --MM--(z?) + "--01", "--01", // gMonth + "--01Z", "--01Z", // gMonth, UTC + "--01-08:00", "--01-08:00", // gMonth, PDT + "--01-01", "--01-01", // gMonthDay + "--01-01Z", "--01-01Z", // gMonthDay, UTC + "--01-01-08:00", "--01-01-08:00" // gMonthDay, PDT + }; + + // get a DatatypeFactory + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException datatypeConfigurationException) { + Assert.fail(datatypeConfigurationException.toString()); + } + + if (DEBUG) { + System.err.println("DatatypeFactory created: " + datatypeFactory.toString()); + } + + // test each value + for (int onTestValue = 0; onTestValue < TEST_VALUES_LEXICAL.length; onTestValue = onTestValue + 2) { + + if (DEBUG) { + System.err.println("testing value: \"" + TEST_VALUES_LEXICAL[onTestValue] + "\", expecting: \"" + TEST_VALUES_LEXICAL[onTestValue + 1] + "\""); + } + + try { + XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(TEST_VALUES_LEXICAL[onTestValue]); + + if (DEBUG) { + System.err.println("XMLGregorianCalendar created: \"" + xmlGregorianCalendar.toString() + "\""); + } + + // was this expected to fail? + if (TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is invalid yet it created the XMLGregorianCalendar \"" + + xmlGregorianCalendar.toString() + "\""); + } + + // does it have the right value? + if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(xmlGregorianCalendar.toString())) { + Assert.fail("XMLGregorianCalendar created with \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" was expected to be \"" + + TEST_VALUES_LEXICAL[onTestValue + 1] + "\" and has the value \"" + xmlGregorianCalendar.toString() + "\""); + } + + // XMLGregorianCalendar created with correct value + } catch (Exception exception) { + + if (DEBUG) { + System.err.println("Exception in creating XMLGregorianCalendar: \"" + exception.toString() + "\""); + } + + // was this expected to succed? + if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) { + Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\""); + } + // expected failure + } + } + } + + /** + * Test {@link DatatypeFactory.newXMLGregorianCalendar( BigInteger year, int + * month, int day, int hour, int minute, int second, BigDecimal + * fractionalSecond, int timezone)} and + * DatatypeFactory.newXMLGregorianCalendar( int year, int month, int day, + * int hour, int minute, int second, int fractionalSecond, int timezone)} . + */ + @Test + public final void testNewXMLGregorianCalendarYearMonthDayHourMinuteSecondFractionalSecondTimezone() { + + final String[][] invalidDates = { + { "1970", "-1", "1", "0", "0", "0", "0", "0" }, + { "1970", "0", "1", "0", "0", "0", "0", "0" }, + { "1970", "13", "1", "0", "0", "0", "0", "0" }, + { "1970", "1", "-1", "0", "0", "0", "0", "0" }, + { "1970", "1", "0", "0", "0", "0", "0", "0" }, + { "1970", "1", "32", "0", "0", "0", "0", "0" }, + { "1970", "1", "1", "-1", "0", "0", "0", "0" }, + // valid per Schema Errata: + // http://www.w3.org/2001/05/xmlschema-errata#e2-45 + // {"1970", "1", "1", "24", "0", "0", "0", "0" } + // put in a repeat value to preserve offsets & TCK tests + { "1970", "1", "1", "0", "-1", "0", "0", "0" }, { "1970", "1", "1", "0", "-1", "0", "0", "0" }, { "1970", "1", "1", "0", "60", "0", "0", "0" }, + { "1970", "1", "1", "0", "0", "-1", "0", "0" }, { "1970", "1", "1", "0", "0", "61", "0", "0" }, + { "1970", "1", "1", "0", "0", "0", "-0.000001", "0" }, { "1970", "1", "1", "0", "0", "0", "1.0001", "0" }, + { "1970", "1", "1", "0", "0", "0", "0", "841" }, { "1970", "1", "1", "0", "0", "0", "0", "-841" }, }; + + // get a DatatypeFactory + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException datatypeConfigurationException) { + Assert.fail(datatypeConfigurationException.toString()); + } + + if (DEBUG) { + System.err.println("DatatypeFactory created: " + datatypeFactory.toString()); + } + + // test values, expect failure + for (int valueIndex = 0; valueIndex < invalidDates.length; ++valueIndex) { + + try { + + if (DEBUG) { + System.err.println("testing DatatypeFactory.newXMLGregorianCalendar(" + invalidDates[valueIndex][0] + ", " + invalidDates[valueIndex][1] + + ", " + invalidDates[valueIndex][2] + ", " + invalidDates[valueIndex][3] + ", " + invalidDates[valueIndex][4] + ", " + + invalidDates[valueIndex][5] + ", " + invalidDates[valueIndex][6] + ", " + invalidDates[valueIndex][7] + ")"); + } + + XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(parseBigInteger(invalidDates[valueIndex][0]), + parseInt(invalidDates[valueIndex][1]), parseInt(invalidDates[valueIndex][2]), parseInt(invalidDates[valueIndex][3]), + parseInt(invalidDates[valueIndex][4]), parseInt(invalidDates[valueIndex][5]), parseBigDecimal(invalidDates[valueIndex][6]), + parseInt(invalidDates[valueIndex][7])); + + if (DEBUG) { + System.err.println("created XMLGregorianCalendar: " + xmlGregorianCalendar.toString()); + } + + // unexpected success, should have failed + Assert.fail("expected IllegalArgumentException " + "for DatatypeFactory.newXMLGregorianCalendar(" + invalidDates[valueIndex][0] + ", " + + invalidDates[valueIndex][1] + ", " + invalidDates[valueIndex][2] + ", " + invalidDates[valueIndex][3] + ", " + + invalidDates[valueIndex][4] + ", " + invalidDates[valueIndex][5] + ", " + invalidDates[valueIndex][6] + ", " + + invalidDates[valueIndex][7] + "). " + "Instead, XMLGregorianCalendar: \"" + xmlGregorianCalendar.toString() + "\" was created."); + } catch (IllegalArgumentException illegalArgumentException) { + // expected failure + if (DEBUG) { + System.err.println("Exception creating XMLGregorianCalendar: " + illegalArgumentException.toString()); + } + } + } + + // test with all ints + int[] testIndex = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, }; + for (int i = 0; i < testIndex.length; ++i) { + int valueIndex = testIndex[i]; + try { + if (DEBUG) { + System.err.println("testing DatatypeFactory.newXMLGregorianCalendar(" + invalidDates[valueIndex][0] + ", " + invalidDates[valueIndex][1] + + ", " + invalidDates[valueIndex][2] + ", " + invalidDates[valueIndex][3] + ", " + invalidDates[valueIndex][4] + ", " + + invalidDates[valueIndex][5] + ", " + invalidDates[valueIndex][6] + ", " + invalidDates[valueIndex][7] + ")"); + } + + XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(parseInt(invalidDates[valueIndex][0]), + parseInt(invalidDates[valueIndex][1]), parseInt(invalidDates[valueIndex][2]), parseInt(invalidDates[valueIndex][3]), + parseInt(invalidDates[valueIndex][4]), parseInt(invalidDates[valueIndex][5]), parseInt(invalidDates[valueIndex][6]), + parseInt(invalidDates[valueIndex][7])); + + if (DEBUG) { + System.err.println("created XMLGregorianCalendar: " + xmlGregorianCalendar.toString()); + } + + // unexpected success, should have failed + Assert.fail("expected IllegalArgumentException " + "for DatatypeFactory.newXMLGregorianCalendar(" + invalidDates[valueIndex][0] + ", " + + invalidDates[valueIndex][1] + ", " + invalidDates[valueIndex][2] + ", " + invalidDates[valueIndex][3] + ", " + + invalidDates[valueIndex][4] + ", " + invalidDates[valueIndex][5] + ", " + invalidDates[valueIndex][6] + ", " + + invalidDates[valueIndex][7] + "). " + "Instead, XMLGregorianCalendar: \"" + xmlGregorianCalendar.toString() + "\" was created."); + } catch (IllegalArgumentException illegalArgumentException) { + // expected failure + if (DEBUG) { + System.err.println("Exception creating XMLGregorianCalendar: " + illegalArgumentException.toString()); + } + } + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/DurationTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/DurationTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,476 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.datatype; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +import javax.xml.namespace.QName; + +import org.testng.Assert; +import org.testng.AssertJUnit; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/* + * @summary Test Duration. + */ +public class DurationTest { + + private final static boolean DEBUG = true; + + protected Duration duration = null; + + @BeforeMethod + protected void setUp() { + try { + duration = DatatypeFactory.newInstance().newDuration(100); + } catch (DatatypeConfigurationException dce) { + dce.printStackTrace(); + Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage()); + } + } + + @Test + public void testDurationSubtract() { + try { + Duration bigDur = DatatypeFactory.newInstance().newDuration(20000); + Duration smallDur = DatatypeFactory.newInstance().newDuration(10000); + if (smallDur.subtract(bigDur).getSign() != -1) { + Assert.fail("smallDur.subtract(bigDur).getSign() is not -1"); + } + if (bigDur.subtract(smallDur).getSign() != 1) { + Assert.fail("bigDur.subtract(smallDur).getSign() is not 1"); + } + if (smallDur.subtract(smallDur).getSign() != 0) { + Assert.fail("smallDur.subtract(smallDur).getSign() is not 0"); + } + } catch (DatatypeConfigurationException e) { + e.printStackTrace(); + } + } + + @Test + public void testDurationMultiply() { + int num = 5000; // millisends. 5 seconds + int factor = 2; + try { + Duration dur = DatatypeFactory.newInstance().newDuration(num); + if (dur.multiply(factor).getSeconds() != 10) { + Assert.fail("duration.multiply() return wrong value"); + } + // factor is 2*10^(-1) + if (dur.multiply(new BigDecimal(new BigInteger("2"), 1)).getSeconds() != 1) { + Assert.fail("duration.multiply() return wrong value"); + } + if (dur.subtract(DatatypeFactory.newInstance().newDuration(1000)).multiply(new BigDecimal(new BigInteger("2"), 1)).getSeconds() != 0) { + Assert.fail("duration.multiply() return wrong value"); + } + } catch (DatatypeConfigurationException e) { + e.printStackTrace(); + } + } + + @Test + public void testDurationAndCalendar1() { + int year = 1; + int month = 2; + int day = 3; + int hour = 4; + int min = 5; + int sec = 6; + String lexicalRepresentation = "P" + year + "Y" + month + "M" + day + "DT" + hour + "H" + min + "M" + sec + "S"; + try { + Duration dur = DatatypeFactory.newInstance().newDuration(lexicalRepresentation); + System.out.println(dur.toString()); + AssertJUnit.assertTrue("year should be 1", dur.getYears() == year); + AssertJUnit.assertTrue("month should be 2", dur.getMonths() == month); + AssertJUnit.assertTrue("day should be 3", dur.getDays() == day); + AssertJUnit.assertTrue("hour should be 4", dur.getHours() == hour); + AssertJUnit.assertTrue("minute should be 5", dur.getMinutes() == min); + AssertJUnit.assertTrue("second should be 6", dur.getSeconds() == sec); + } catch (DatatypeConfigurationException e) { + e.printStackTrace(); + } + } + + @Test + public void testDurationAndCalendar2() { + try { + AssertJUnit.assertTrue("10.00099S means 10 sec since it will be rounded to zero", DatatypeFactory.newInstance().newDuration("PT10.00099S") + .getTimeInMillis(new Date()) == 10000); + AssertJUnit.assertTrue("10.00099S means 10 sec since it will be rounded to zero", DatatypeFactory.newInstance().newDuration("-PT10.00099S") + .getTimeInMillis(new Date()) == -10000); + AssertJUnit.assertTrue("10.00099S means 10 sec since it will be rounded to zero", DatatypeFactory.newInstance().newDuration("PT10.00099S") + .getTimeInMillis(new GregorianCalendar()) == 10000); + AssertJUnit.assertTrue("10.00099S means 10 sec since it will be rounded to zero", DatatypeFactory.newInstance().newDuration("-PT10.00099S") + .getTimeInMillis(new GregorianCalendar()) == -10000); + } catch (DatatypeConfigurationException e) { + e.printStackTrace(); + } + } + + @Test + public void testDurationAndCalendar3() { + try { + Calendar cal = new GregorianCalendar(); + cal.set(Calendar.SECOND, 59); + DatatypeFactory.newInstance().newDuration(10000).addTo(cal); + AssertJUnit.assertTrue("sec will be 9", cal.get(Calendar.SECOND) == 9); + + Date date = new Date(); + date.setSeconds(59); + DatatypeFactory.newInstance().newDuration(10000).addTo(date); + AssertJUnit.assertTrue("sec will be 9", date.getSeconds() == 9); + } catch (DatatypeConfigurationException e) { + e.printStackTrace(); + } + } + + @Test + public void testEqualsWithDifferentObjectParam() { + + AssertJUnit.assertFalse("equals method should return false for any object other than Duration", duration.equals(new Integer(0))); + } + + @Test + public void testEqualsWithNullObjectParam() { + + AssertJUnit.assertFalse("equals method should return false for null parameter", duration.equals(null)); + } + + @Test + public void testEqualsWithEqualObjectParam() { + try { + AssertJUnit.assertTrue("equals method is expected to return true", duration.equals(DatatypeFactory.newInstance().newDuration(100))); + } catch (DatatypeConfigurationException dce) { + dce.printStackTrace(); + Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage()); + } + } + + /** + * Inspired by CR 5077522 Duration.compare makes mistakes for some values. + */ + @Test + public void testCompareWithInderterminateRelation() { + + final String[][] partialOrder = { // partialOrder + { "P1Y", "<>", "P365D" }, { "P1Y", "<>", "P366D" }, { "P1M", "<>", "P28D" }, { "P1M", "<>", "P29D" }, { "P1M", "<>", "P30D" }, { "P1M", "<>", "P31D" }, + { "P5M", "<>", "P150D" }, { "P5M", "<>", "P151D" }, { "P5M", "<>", "P152D" }, { "P5M", "<>", "P153D" }, { "PT2419200S", "<>", "P1M" }, + { "PT2678400S", "<>", "P1M" }, { "PT31536000S", "<>", "P1Y" }, { "PT31622400S", "<>", "P1Y" }, { "PT525600M", "<>", "P1Y" }, + { "PT527040M", "<>", "P1Y" }, { "PT8760H", "<>", "P1Y" }, { "PT8784H", "<>", "P1Y" }, { "P365D", "<>", "P1Y" }, }; + + DatatypeFactory df = null; + try { + df = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException ex) { + ex.printStackTrace(); + Assert.fail(ex.toString()); + } + + boolean compareErrors = false; + + for (int valueIndex = 0; valueIndex < partialOrder.length; ++valueIndex) { + Duration duration1 = df.newDuration(partialOrder[valueIndex][0]); + Duration duration2 = df.newDuration(partialOrder[valueIndex][2]); + int cmp = duration1.compare(duration2); + int expected = ">".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.GREATER + : "<".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.LESSER : "==".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.EQUAL + : DatatypeConstants.INDETERMINATE; + + // just note any errors, do not fail until all cases have been + // tested + if (expected != cmp) { + compareErrors = true; + System.err.println("returned " + cmp2str(cmp) + " for durations \'" + duration1 + "\' and " + duration2 + "\', but expected " + + cmp2str(expected)); + } + } + + if (compareErrors) { + // TODO; fix bug, these tests should pass + if (false) { + Assert.fail("Errors in comparing indeterminate relations, see Stderr"); + } else { + System.err.println("Please fix this bug: " + "Errors in comparing indeterminate relations, see Stderr"); + } + } + } + + public static String cmp2str(int cmp) { + return cmp == DatatypeConstants.LESSER ? "LESSER" : cmp == DatatypeConstants.GREATER ? "GREATER" : cmp == DatatypeConstants.EQUAL ? "EQUAL" + : cmp == DatatypeConstants.INDETERMINATE ? "INDETERMINATE" : "UNDEFINED"; + } + + /** + * Inspired by CR 6238220 javax.xml.datatype.Duration has no clear + * description concerning return values range. + */ + @Test + public void testNormalizedReturnValues() throws Exception { + + final Object[] TEST_VALUES = { + // test 61 seconds -> 1 minute, 1 second + true, // isPositive, + BigInteger.ZERO, // years, + BigInteger.ZERO, // months + BigInteger.ZERO, // days + BigInteger.ZERO, // hours + BigInteger.ZERO, // minutes + new BigDecimal(61), // seconds + 61000L, // durationInMilliSeconds, + "P0Y0M0DT0H0M61S", // lexicalRepresentation + + // test - 61 seconds -> - 1 minute, 1 second + false, // isPositive, + BigInteger.ZERO, // years, + BigInteger.ZERO, // months + BigInteger.ZERO, // days + BigInteger.ZERO, // hours + BigInteger.ZERO, // minutes + new BigDecimal(61), // seconds + 61000L, // durationInMilliSeconds, + "-P0Y0M0DT0H0M61S", // lexicalRepresentation + }; + + final Object[] NORM_VALUES = { + // test 61 seconds -> 1 minute, 1 second + true, // normalized isPositive, + BigInteger.ZERO, // normalized years, + BigInteger.ZERO, // normalized months + BigInteger.ZERO, // normalized days + BigInteger.ZERO, // normalized hours + BigInteger.ONE, // normalized minutes + BigDecimal.ONE, // normalized seconds + 61000L, // normalized durationInMilliSeconds, + "P0Y0M0DT0H1M1.000S", // normalized lexicalRepresentation + + // test - 61 seconds -> - 1 minute, 1 second + false, // normalized isPositive, + BigInteger.ZERO, // normalized years, + BigInteger.ZERO, // normalized months + BigInteger.ZERO, // normalized days + BigInteger.ZERO, // normalized hours + BigInteger.ONE, // normalized minutes + BigDecimal.ONE, // normalized seconds + 61000L, // normalized durationInMilliSeconds, + "-P0Y0M0DT0H1M1.000S" // normalized lexicalRepresentation + }; + + for (int onValue = 0; onValue < TEST_VALUES.length; onValue += 9) { + newDurationTester(((Boolean) TEST_VALUES[onValue]).booleanValue(), // isPositive, + ((Boolean) NORM_VALUES[onValue]).booleanValue(), // normalized + // isPositive, + (BigInteger) TEST_VALUES[onValue + 1], // years, + (BigInteger) NORM_VALUES[onValue + 1], // normalized years, + (BigInteger) TEST_VALUES[onValue + 2], // months + (BigInteger) NORM_VALUES[onValue + 2], // normalized months + (BigInteger) TEST_VALUES[onValue + 3], // days + (BigInteger) NORM_VALUES[onValue + 3], // normalized days + (BigInteger) TEST_VALUES[onValue + 4], // hours + (BigInteger) NORM_VALUES[onValue + 4], // normalized hours + (BigInteger) TEST_VALUES[onValue + 5], // minutes + (BigInteger) NORM_VALUES[onValue + 5], // normalized minutes + (BigDecimal) TEST_VALUES[onValue + 6], // seconds + (BigDecimal) NORM_VALUES[onValue + 6], // normalized seconds + ((Long) TEST_VALUES[onValue + 7]).longValue(), // durationInMilliSeconds, + ((Long) NORM_VALUES[onValue + 7]).longValue(), // normalized + // durationInMilliSeconds, + (String) TEST_VALUES[onValue + 8], // lexicalRepresentation + (String) NORM_VALUES[onValue + 8]); // normalized + // lexicalRepresentation + + newDurationDayTimeTester(((Boolean) TEST_VALUES[onValue]).booleanValue(), // isPositive, + ((Boolean) NORM_VALUES[onValue]).booleanValue(), // normalized + // isPositive, + BigInteger.ZERO, // years, + BigInteger.ZERO, // normalized years, + BigInteger.ZERO, // months + BigInteger.ZERO, // normalized months + (BigInteger) TEST_VALUES[onValue + 3], // days + (BigInteger) NORM_VALUES[onValue + 3], // normalized days + (BigInteger) TEST_VALUES[onValue + 4], // hours + (BigInteger) NORM_VALUES[onValue + 4], // normalized hours + (BigInteger) TEST_VALUES[onValue + 5], // minutes + (BigInteger) NORM_VALUES[onValue + 5], // normalized minutes + (BigDecimal) TEST_VALUES[onValue + 6], // seconds + (BigDecimal) NORM_VALUES[onValue + 6], // normalized seconds + ((Long) TEST_VALUES[onValue + 7]).longValue(), // durationInMilliSeconds, + ((Long) NORM_VALUES[onValue + 7]).longValue(), // normalized + // durationInMilliSeconds, + (String) TEST_VALUES[onValue + 8], // lexicalRepresentation + (String) NORM_VALUES[onValue + 8]); // normalized + // lexicalRepresentation + } + } + + private void newDurationTester(boolean isPositive, boolean normalizedIsPositive, BigInteger years, BigInteger normalizedYears, BigInteger months, + BigInteger normalizedMonths, BigInteger days, BigInteger normalizedDays, BigInteger hours, BigInteger normalizedHours, BigInteger minutes, + BigInteger normalizedMinutes, BigDecimal seconds, BigDecimal normalizedSeconds, long durationInMilliSeconds, long normalizedDurationInMilliSeconds, + String lexicalRepresentation, String normalizedLexicalRepresentation) { + + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException ex) { + ex.printStackTrace(); + Assert.fail(ex.toString()); + } + + // create 4 Durations using the 4 different constructors + + Duration durationBigInteger = datatypeFactory.newDuration(isPositive, years, months, days, hours, minutes, seconds); + durationAssertEquals(durationBigInteger, DatatypeConstants.DURATION, normalizedIsPositive, normalizedYears.intValue(), normalizedMonths.intValue(), + normalizedDays.intValue(), normalizedHours.intValue(), normalizedMinutes.intValue(), normalizedSeconds.intValue(), + normalizedDurationInMilliSeconds, normalizedLexicalRepresentation); + + Duration durationInt = datatypeFactory.newDuration(isPositive, years.intValue(), months.intValue(), days.intValue(), hours.intValue(), + minutes.intValue(), seconds.intValue()); + durationAssertEquals(durationInt, DatatypeConstants.DURATION, normalizedIsPositive, normalizedYears.intValue(), normalizedMonths.intValue(), + normalizedDays.intValue(), normalizedHours.intValue(), normalizedMinutes.intValue(), normalizedSeconds.intValue(), + normalizedDurationInMilliSeconds, normalizedLexicalRepresentation); + + Duration durationMilliseconds = datatypeFactory.newDuration(durationInMilliSeconds); + durationAssertEquals(durationMilliseconds, DatatypeConstants.DURATION, normalizedIsPositive, normalizedYears.intValue(), normalizedMonths.intValue(), + normalizedDays.intValue(), normalizedHours.intValue(), normalizedMinutes.intValue(), normalizedSeconds.intValue(), + normalizedDurationInMilliSeconds, normalizedLexicalRepresentation); + + Duration durationLexical = datatypeFactory.newDuration(lexicalRepresentation); + durationAssertEquals(durationLexical, DatatypeConstants.DURATION, normalizedIsPositive, normalizedYears.intValue(), normalizedMonths.intValue(), + normalizedDays.intValue(), normalizedHours.intValue(), normalizedMinutes.intValue(), normalizedSeconds.intValue(), + normalizedDurationInMilliSeconds, normalizedLexicalRepresentation); + } + + private void newDurationDayTimeTester(boolean isPositive, boolean normalizedIsPositive, BigInteger years, BigInteger normalizedYears, BigInteger months, + BigInteger normalizedMonths, BigInteger days, BigInteger normalizedDays, BigInteger hours, BigInteger normalizedHours, BigInteger minutes, + BigInteger normalizedMinutes, BigDecimal seconds, BigDecimal normalizedSeconds, long durationInMilliSeconds, long normalizedDurationInMilliSeconds, + String lexicalRepresentation, String normalizedLexicalRepresentation) { + + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException ex) { + ex.printStackTrace(); + Assert.fail(ex.toString()); + } + + // create 4 dayTime Durations using the 4 different constructors + + Duration durationDayTimeBigInteger = datatypeFactory.newDurationDayTime(isPositive, days, hours, minutes, seconds.toBigInteger()); + durationAssertEquals(durationDayTimeBigInteger, DatatypeConstants.DURATION_DAYTIME, normalizedIsPositive, normalizedYears.intValue(), + normalizedMonths.intValue(), normalizedDays.intValue(), normalizedHours.intValue(), normalizedMinutes.intValue(), normalizedSeconds.intValue(), + normalizedDurationInMilliSeconds, normalizedLexicalRepresentation); + + /* + * Duration durationDayTimeInt = datatypeFactory.newDurationDayTime( + * isPositive, days.intValue(), hours.intValue(), minutes.intValue(), + * seconds.intValue()); Duration durationDayTimeMilliseconds = + * datatypeFactory.newDurationDayTime( durationInMilliSeconds); Duration + * durationDayTimeLexical = datatypeFactory.newDurationDayTime( + * lexicalRepresentation); + * Duration durationYearMonthBigInteger = + * datatypeFactory.newDurationYearMonth( isPositive, years, months); + * Duration durationYearMonthInt = datatypeFactory.newDurationYearMonth( + * isPositive, years.intValue(), months.intValue()); Duration + * durationYearMonthMilliseconds = datatypeFactory.newDurationYearMonth( + * durationInMilliSeconds); Duration durationYearMonthLexical = + * datatypeFactory.newDurationYearMonth( lexicalRepresentation) ; + */ + + } + + private void durationAssertEquals(Duration duration, QName xmlSchemaType, boolean isPositive, int years, int months, int days, int hours, int minutes, + int seconds, long milliseconds, String lexical) { + + final TimeZone GMT = TimeZone.getTimeZone("GMT"); + final GregorianCalendar EPOCH = new GregorianCalendar(GMT); + EPOCH.clear(); + + if (DEBUG) { + System.out.println("Testing Duration: " + duration.toString()); + } + + // sign + if (DEBUG) { + boolean actual = (duration.getSign() == 1) ? true : false; + System.out.println("sign:"); + System.out.println(" expected: \"" + isPositive + "\""); + System.out.println(" actual: \"" + actual + "\""); + } + + if (DEBUG) { + System.out.println("years:"); + System.out.println(" expected: \"" + years + "\""); + System.out.println(" actual: \"" + duration.getYears() + "\""); + } + + if (DEBUG) { + System.out.println("months:"); + System.out.println(" expected: \"" + months + "\""); + System.out.println(" actual: \"" + duration.getMonths() + "\""); + } + + if (DEBUG) { + System.out.println("days:"); + System.out.println(" expected: \"" + days + "\""); + System.out.println(" actual: \"" + duration.getDays() + "\""); + } + + if (DEBUG) { + System.out.println("hours:"); + System.out.println(" expected: \"" + hours + "\""); + System.out.println(" actual: \"" + duration.getHours() + "\""); + } + + if (DEBUG) { + System.out.println("minutes:"); + System.out.println(" expected: \"" + minutes + "\""); + System.out.println(" actual: \"" + duration.getMinutes() + "\""); + } + + if (DEBUG) { + System.out.println("seconds:"); + System.out.println(" expected: \"" + seconds + "\""); + System.out.println(" actual: \"" + duration.getSeconds() + "\""); + } + + if (DEBUG) { + System.out.println("milliseconds:"); + System.out.println(" expected: \"" + milliseconds + "\""); + System.out.println(" actual: \"" + duration.getTimeInMillis(EPOCH) + "\""); + } + + if (DEBUG) { + System.out.println("lexical:"); + System.out.println(" expected: \"" + lexical + "\""); + System.out.println(" actual: \"" + duration.toString() + "\""); + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/FactoryFindTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/FactoryFindTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.datatype; + +import java.net.URL; +import java.net.URLClassLoader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test Classloader for DatatypeFactory. + */ +public class FactoryFindTest { + + boolean myClassLoaderUsed = false; + + public FactoryFindTest(String name) { + } + + @Test + public void testFactoryFind() { + try { + // System.setProperty("jaxp.debug", "true"); + + DatatypeFactory factory = DatatypeFactory.newInstance(); + Assert.assertTrue(factory.getClass().getClassLoader() == null); + + Thread.currentThread().setContextClassLoader(null); + factory = DatatypeFactory.newInstance(); + Assert.assertTrue(factory.getClass().getClassLoader() == null); + + Thread.currentThread().setContextClassLoader(new MyClassLoader()); + factory = DatatypeFactory.newInstance(); + if (System.getSecurityManager() == null) + Assert.assertTrue(myClassLoaderUsed); + else + Assert.assertFalse(myClassLoaderUsed); + } catch (Exception ex) { + } + + } + + class MyClassLoader extends URLClassLoader { + + public MyClassLoader() { + super(new URL[0]); + } + + public Class loadClass(String name) throws ClassNotFoundException { + myClassLoaderUsed = true; + return super.loadClass(name); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/XMLGregorianCalendarTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/XMLGregorianCalendarTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.datatype; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/* + * @summary Test XMLGregorianCalendar. + */ +public class XMLGregorianCalendarTest { + + private static final boolean DEBUG = false; + + private static final int TEST_VALUE_FAIL = 0; + + private static final int TEST_VALUE_PASS = 1; + + private XMLGregorianCalendar calendar; + + @BeforeMethod + protected void setUp() { + try { + calendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(); + } catch (DatatypeConfigurationException dce) { + dce.printStackTrace(); + Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage()); + } + } + + @Test + public final void testSetTime() { + + /** + * Hour, minute, second values to test and expected result. + */ + final int[] TEST_VALUES = { 24, 0, 0, TEST_VALUE_PASS, 24, 1, 0, TEST_VALUE_FAIL, 24, 0, 1, TEST_VALUE_FAIL, 24, DatatypeConstants.FIELD_UNDEFINED, 0, + TEST_VALUE_FAIL, 24, 0, DatatypeConstants.FIELD_UNDEFINED, TEST_VALUE_FAIL }; + + // create DatatypeFactory + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException datatypeConfigurationException) { + Assert.fail(datatypeConfigurationException.toString()); + } + + if (DEBUG) { + System.err.println("DatatypeFactory created: " + datatypeFactory.toString()); + } + + // create XMLGregorianCalendar + XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(); + + // test each value + for (int onTestValue = 0; onTestValue < TEST_VALUES.length; onTestValue = onTestValue + 4) { + + if (DEBUG) { + System.err.println("testing values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2] + + ") expected (0=fail, 1=pass): " + TEST_VALUES[onTestValue + 3]); + } + + try { + // set time + xmlGregorianCalendar.setTime(TEST_VALUES[onTestValue], TEST_VALUES[onTestValue + 1], TEST_VALUES[onTestValue + 2]); + + if (DEBUG) { + System.err.println("XMLGregorianCalendar created: \"" + xmlGregorianCalendar.toString() + "\""); + } + + // was this expected to fail? + if (TEST_VALUES[onTestValue + 3] == TEST_VALUE_FAIL) { + Assert.fail("the values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2] + + ") are invalid, " + "yet it created the XMLGregorianCalendar \"" + xmlGregorianCalendar.toString() + "\""); + } + } catch (Exception exception) { + + if (DEBUG) { + System.err.println("Exception in creating XMLGregorianCalendar: \"" + exception.toString() + "\""); + } + + // was this expected to succed? + if (TEST_VALUES[onTestValue + 3] == TEST_VALUE_PASS) { + Assert.fail("the values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2] + + ") are valid yet it failed with \"" + exception.toString() + "\""); + } + // expected failure + } + } + } + + @Test + public final void testSetHour() { + + /** + * Hour values to test and expected result. + */ + final int[] TEST_VALUES = { + // setTime(H, M, S), hour override, expected result + 0, 0, 0, 0, TEST_VALUE_PASS, 0, 0, 0, 23, TEST_VALUE_PASS, 0, 0, 0, 24, TEST_VALUE_PASS, + // creates invalid state + 0, 0, 0, DatatypeConstants.FIELD_UNDEFINED, TEST_VALUE_FAIL, + // violates Schema Errata + 0, 0, 1, 24, TEST_VALUE_FAIL }; + + // create DatatypeFactory + DatatypeFactory datatypeFactory = null; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch (DatatypeConfigurationException datatypeConfigurationException) { + Assert.fail(datatypeConfigurationException.toString()); + } + + if (DEBUG) { + System.err.println("DatatypeFactory created: " + datatypeFactory.toString()); + } + + // create XMLGregorianCalendar + XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(); + + // test each value + for (int onTestValue = 0; onTestValue < TEST_VALUES.length; onTestValue = onTestValue + 5) { + + if (DEBUG) { + System.err.println("testing values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2] + + ", " + TEST_VALUES[onTestValue + 3] + ") expected (0=fail, 1=pass): " + TEST_VALUES[onTestValue + 4]); + } + + try { + // set time to known valid value + xmlGregorianCalendar.setTime(TEST_VALUES[onTestValue], TEST_VALUES[onTestValue + 1], TEST_VALUES[onTestValue + 2]); + // now explicitly set hour + xmlGregorianCalendar.setHour(TEST_VALUES[onTestValue + 3]); + + if (DEBUG) { + System.err.println("XMLGregorianCalendar created: \"" + xmlGregorianCalendar.toString() + "\""); + } + + // was this expected to fail? + if (TEST_VALUES[onTestValue + 4] == TEST_VALUE_FAIL) { + Assert.fail("the values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2] + ", " + + TEST_VALUES[onTestValue + 3] + ") are invalid, " + "yet it created the XMLGregorianCalendar \"" + xmlGregorianCalendar.toString() + + "\""); + } + } catch (Exception exception) { + + if (DEBUG) { + System.err.println("Exception in creating XMLGregorianCalendar: \"" + exception.toString() + "\""); + } + + // was this expected to succed? + if (TEST_VALUES[onTestValue + 4] == TEST_VALUE_PASS) { + Assert.fail("the values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2] + ", " + + TEST_VALUES[onTestValue + 3] + ") are valid yet it failed with \"" + exception.toString() + "\""); + } + // expected failure + } + } + } + + @Test + public void testEqualsWithDifferentObjectParam() { + + Assert.assertFalse(calendar.equals(new Integer(0)), "equals method should return false for any object other" + " than XMLGregorianCalendar"); + } + + @Test + public void testEqualsWithNullObjectParam() { + + Assert.assertFalse(calendar.equals(null), "equals method should return false for null parameter"); + } + + @Test + public void testEqualsWithEqualObjectParam() { + + try { + Assert.assertTrue(calendar.equals(DatatypeFactory.newInstance().newXMLGregorianCalendar()), "equals method is expected to return true"); + } catch (DatatypeConfigurationException dce) { + dce.printStackTrace(); + Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage()); + } + } + + @Test + public void testToString() { + try { + String inputDateTime = "2006-10-23T22:15:01.000000135+08:00"; + DatatypeFactory factory = DatatypeFactory.newInstance(); + XMLGregorianCalendar calendar = factory.newXMLGregorianCalendar(inputDateTime); + String toStr = calendar.toString(); + Assert.assertTrue(toStr.indexOf("E") == -1, "String value cannot contain exponent"); + } catch (DatatypeConfigurationException dce) { + dce.printStackTrace(); + Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.File; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 4674384 + * @summary Test large maxOccurs. + */ +public class Bug4674384_MAX_OCCURS_Test { + + @Test + public final void testLargeMaxOccurs() { + + String XML_FILE_NAME = "Bug4674384_MAX_OCCURS_Test.xml"; + + try { + // create and initialize the parser + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); + spf.setValidating(true); + + SAXParser parser = spf.newSAXParser(); + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); + + File xmlFile = new File(getClass().getResource(XML_FILE_NAME).getPath()); + + parser.parse(xmlFile, new DefaultHandler()); + } catch (Exception e) { + System.err.println("Failure: File " + XML_FILE_NAME + " was parsed with a large value of maxOccurs."); + e.printStackTrace(); + Assert.fail("Failure: File " + XML_FILE_NAME + " was parsed with a large value of maxOccurs. " + e.getMessage()); + } + + System.out.println("Success: File " + XML_FILE_NAME + " was parsed with a large value of maxOccurs."); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,8 @@ + + +1 +2 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4934208.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4934208.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +import util.DraconianErrorHandler; + +/* + * @bug 4934208 + * @summary Test SAXParser can parse keyref constraint with a selector that is a union xpath expression selecting a node and its child. + */ +public class Bug4934208 { + @Test + public void test1() throws Exception { + parse(new InputSource(Bug4934208.class.getResourceAsStream("test1.xml"))); + } + + @Test + public void test2() throws Exception { + try { + parse(new InputSource(Bug4934208.class.getResourceAsStream("test2.xml"))); + } catch (SAXException e) { + Assert.assertTrue(e.getMessage().startsWith("cvc-complex-type.2.4.a")); + } + } + + private void parse(InputSource is) throws Exception { + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); + spf.setValidating(true); + SAXParser parser = spf.newSAXParser(); + + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", Bug4934208.class.getResourceAsStream("test.xsd")); + + XMLReader r = parser.getXMLReader(); + + r.setErrorHandler(new DraconianErrorHandler()); + r.parse(is); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4967002.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4967002.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.StringReader; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; + +/* + * @bug 4967002 + * @summary Test DocumentBuilderFactory.newDocumentBuilder() throws ParserConfigurationException + * when it uses the "http://java.sun.com/xml/jaxp/properties/schemaSource" property + * and/or the "http://java.sun.com/xml/jaxp/properties/schemaLanguage" property + * in conjunction with setting a Schema object. + */ +public class Bug4967002 { + String schemaSource = "\n" + "\n" + " \n" + + " \n" + " \n" + " \n" + + " \n" + " \n" + "\n"; + + Schema createSchema() { + SchemaFactory schFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + try { + Schema sch = schFactory.newSchema(new StreamSource(new StringReader(schemaSource))); + return sch; + } catch (Exception se) { + throw new IllegalStateException("No Schema : " + se); + } + } + + @Test + public void test1() { + setAttr(true); + } + + @Test + public void test2() { + setAttr(false); + } + + void setAttr(boolean setSrc) { + DocumentBuilderFactory docBFactory = DocumentBuilderFactory.newInstance(); + Schema sch = createSchema(); + docBFactory.setSchema(sch); + docBFactory.setNamespaceAware(true); + docBFactory.setValidating(true); + + final String aSchemaLanguage = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + final String aSchemaSource = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + docBFactory.setAttribute(aSchemaLanguage, "http://www.w3.org/2001/XMLSchema"); + // System.out.println("---- Set schemaLanguage: " + + // docBFactory.getAttribute(aSchemaLanguage)); + if (setSrc) { + docBFactory.setAttribute(aSchemaSource, new InputSource(new StringReader(schemaSource))); + // System.out.println("---- Set schemaSource: " + + // docBFactory.getAttribute(aSchemaSource)); + } + + try { + docBFactory.newDocumentBuilder(); + Assert.fail("ParserConfigurationException expected"); + } catch (ParserConfigurationException pce) { + return; // success + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4985486.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4985486.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 4985486 + * @summary Test SAXParser can parse large characters(more than 10000). + */ +public class Bug4985486 { + + @Test + public void test1() throws Exception { + SAXParserFactory spf = SAXParserFactory.newInstance(); + System.out.println(spf.getClass().getName()); + spf.setNamespaceAware(true); + spf.newSAXParser().parse(Bug4985486.class.getResourceAsStream("Bug4985486.xml"), new Handler()); + } + + private class Handler extends DefaultHandler { + StringBuffer buf = new StringBuffer(); + + public void characters(char[] ch, int start, int length) throws SAXException { + buf.append(ch, start, length); + } + + public void endDocument() throws SAXException { + String contents = buf.toString(); + Assert.assertTrue(contents.endsWith("[END]")); + while (contents.length() >= 10) { + Assert.assertTrue(contents.startsWith("0123456789")); + contents = contents.substring(10); + } + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4985486.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4985486.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + +0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789[END] diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.annotations.Test; + +/* + * @bug 4991020 + * @summary Test XPath like "node_name/." can be parsed. + */ +public class Bug4991020 { + + protected static SAXParser createParser() throws Exception { + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); + spf.setValidating(true); + SAXParser parser = spf.newSAXParser(); + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); + + return parser; + } + + @Test + public void test1() throws Exception { + SAXParser parser = createParser(); + parser.parse(Bug4991020.class.getResource("Bug4991020.xml").toExternalForm(), new util.DraconianErrorHandler()); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,5 @@ + +123 diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.annotations.Test; + +/* + * @bug 4991946 + * @summary Can parse the element type is anyType in the schema and is substituted by the simple type via the 'xsi:type' attribute in xml document. + */ +public class Bug4991946 { + + protected static SAXParser createParser() throws Exception { + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); + spf.setValidating(true); + SAXParser parser = spf.newSAXParser(); + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); + + return parser; + } + + @Test + public void test1() throws Exception { + SAXParser parser = createParser(); + parser.parse(Bug4991946.class.getResource("Bug4991946.xml").toExternalForm(), new util.DraconianErrorHandler()); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,7 @@ + + + 123 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5010072.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5010072.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 5010072 + * @summary Test SchemaFactory throws SAXException if xpath is "@". + */ +public class Bug5010072 { + + protected static class ErrorHandler extends DefaultHandler { + public int errorCounter = 0; + + public void error(SAXParseException e) throws SAXException { + + System.err.println("Error: " + "[[" + e.getPublicId() + "][" + e.getSystemId() + "]]" + "[[" + e.getLineNumber() + "][" + e.getColumnNumber() + + "]]" + e); + + errorCounter++; + + throw e; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.err.println("Fatal Error: " + e); + errorCounter++; + } + } + + @Test + public void test1() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + ErrorHandler errorHandler = new ErrorHandler(); + schemaFactory.setErrorHandler(errorHandler); + + try { + schemaFactory.newSchema(Bug5010072.class.getResource("Bug5010072.xsd")); + Assert.fail("should fail to compile"); + } catch (SAXException e) { + ; // as expected + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5010072.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5010072.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5025825.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5025825.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.StringReader; + +import javax.xml.XMLConstants; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/* + * @bug 5025825 + * @summary Test if SAXParserFactory set a Schema object, when SAXParser sets "http://java.sun.com/xml/jaxp/properties/schemaSource" property + * and/or "http://java.sun.com/xml/jaxp/properties/schemaLanguage" property, it shall throw SAXException. + */ +public class Bug5025825 { + + String schemaSource = "\n" + "\n" + " \n" + + " \n" + " \n" + " \n" + + " \n" + " \n" + "\n"; + + private Schema createSchema() throws SAXException { + SchemaFactory schFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + return schFactory.newSchema(new StreamSource(new StringReader(schemaSource))); + } + + @Test + public void test1() throws Exception { + Schema sch = createSchema(); + Assert.assertNotNull(sch); + + SAXParserFactory spFactory = SAXParserFactory.newInstance(); + spFactory.setNamespaceAware(true); + spFactory.setValidating(true); + spFactory.setSchema(sch); + + SAXParser sParser = spFactory.newSAXParser(); + + final String aSchemaLanguage = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + final String aSchemaSource = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + try { + sParser.setProperty(aSchemaLanguage, "http://www.w3.org/2001/XMLSchema"); + Assert.fail("---- Set schemaLanguage: " + sParser.getProperty(aSchemaLanguage)); + } catch (SAXException e) { + ; // as expected + } + + try { + sParser.setProperty(aSchemaSource, new InputSource(new StringReader(schemaSource))); + Assert.fail("---- Set schemaSource: " + sParser.getProperty(aSchemaSource)); + } catch (SAXException e) { + ; // as expected + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6309988.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6309988.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.File; +import java.io.InputStream; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXParseException; + +/* + * @bug 6309988 + * @summary Test elementAttributeLimit, maxOccurLimit, entityExpansionLimit. + */ +public class Bug6309988 { + + DocumentBuilderFactory dbf = null; + static boolean _isSecureMode = false; + static { + if (System.getSecurityManager() != null) { + _isSecureMode = true; + System.out.println("Security Manager is present"); + } else { + System.out.println("Security Manager is NOT present"); + } + } + + /* + * Given XML document has more than 10000 attributes. Exception is expected + */ + @Test + public void testDOMParserElementAttributeLimit() { + try { + dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document doc = parser.parse(this.getClass().getResourceAsStream("DosTest.xml")); + Assert.fail("SAXParserException is expected, as given XML document contains more than 10000 attributes"); + } catch (SAXParseException e) { + System.out.println(e.getMessage()); + } catch (Exception e) { + Assert.fail("Exception " + e.getMessage()); + } + } + + /* + * Given XML document has more than 10000 attributes. It should report an + * error. + */ + @Test + public void testDOMNSParserElementAttributeLimit() { + try { + dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document doc = parser.parse(this.getClass().getResourceAsStream("DosTest.xml")); + Assert.fail("SAXParserException is expected, as given XML document contains more than 10000 attributes"); + } catch (SAXParseException e) { + System.out.println(e.getMessage()); + } catch (Exception e) { + Assert.fail("Exception " + e.getMessage()); + } + } + + /* + * Given XML document has more than 10000 attributes. Parsing this XML + * document in non-secure mode, should not report any error. + */ + @Test + public void testDOMNSParserElementAttributeLimitWithoutSecureProcessing() { + if (_isSecureMode) + return; // jaxp secure feature can not be turned off when security + // manager is present + try { + dbf = DocumentBuilderFactory.newInstance(); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false); + dbf.setNamespaceAware(true); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document doc = parser.parse(this.getClass().getResourceAsStream("DosTest.xml")); + + } catch (SAXParseException e) { + Assert.fail(e.getMessage()); + } catch (Exception e) { + Assert.fail("Exception " + e.getMessage()); + } + } + + /* + * Before 8014530: Given XML document has 3 attributes and System property + * is set to 2. Parsing this XML document in non-secure mode, should not + * report an error. + * After 8014530: System properties will override FSP, the result of this + * test should be the same as + * testSystemElementAttributeLimitWithSecureProcessing + */ + @Test + public void testSystemElementAttributeLimitWithoutSecureProcessing() { + if (_isSecureMode) + return; // jaxp secure feature can not be turned off when security + // manager is present + try { + dbf = DocumentBuilderFactory.newInstance(); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false); + dbf.setNamespaceAware(true); + System.setProperty("elementAttributeLimit", "2"); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document doc = parser.parse(this.getClass().getResourceAsStream("DosTest3.xml")); + + Assert.fail("SAXParserException is expected, as given XML document contains more than 2 attributes"); + } catch (Exception e) { + String errMsg = e.getMessage(); + Throwable cause = e.getCause(); + if (cause != null) { + errMsg += cause.getMessage(); + } + if (errMsg.contains("JAXP0001")) { + // expected + } else { + Assert.fail("Unexpected error: " + e.getMessage()); + } + } finally { + System.clearProperty("elementAttributeLimit"); + } + } + + /* + * Given XML document has 3 attributes and System property is set to 2. + * Parsing this XML document in secure mode, should report an error. + */ + @Test + public void testSystemElementAttributeLimitWithSecureProcessing() { + try { + dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + System.setProperty("elementAttributeLimit", "2"); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document doc = parser.parse(this.getClass().getResourceAsStream("DosTest3.xml")); + Assert.fail("SAXParserException is expected, as given XML document contains more than 2 attributes"); + } catch (SAXParseException e) { + System.out.println(e.getMessage()); + } catch (Exception e) { + Assert.fail("Exception " + e.getMessage()); + } finally { + System.setProperty("elementAttributeLimit", ""); + } + } + + /* + * Default value for secure processing feature should be true. + */ + @Test + public void testDOMSecureProcessingDefaultValue() { + try { + dbf = DocumentBuilderFactory.newInstance(); + Assert.assertTrue(dbf.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING), "Default value for secureProcessing feature should be true"); + + } catch (Exception e) { + Assert.fail("Exception " + e.getMessage()); + } + } + + /* + * Default value for secure processing feature should be true. + */ + @Test + public void testSAXSecureProcessingDefaultValue() { + try { + SAXParserFactory spf = SAXParserFactory.newInstance(); + Assert.assertTrue(spf.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING), "Default value for secureProcessing feature should be true"); + + } catch (Exception e) { + Assert.fail("Exception " + e.getMessage()); + } + } + + /* + * This method sets system property for maxOccurLimit=2 and secure process + * feature is off. Given doument contains more than 2 elements and hence an + * error should be reported. + */ + @Test + public void testSystemMaxOccurLimitWithoutSecureProcessing() { + if (_isSecureMode) + return; // jaxp secure feature can not be turned off when security + // manager is present + try { + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false); + spf.setValidating(true); + System.setProperty("maxOccurLimit", "2"); + // Set the properties for Schema Validation + String SCHEMA_LANG = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + String SCHEMA_TYPE = "http://www.w3.org/2001/XMLSchema"; + // Get the Schema location as a File object + File schemaFile = new File(this.getClass().getResource("toys.xsd").toURI()); + // Get the parser + SAXParser parser = spf.newSAXParser(); + parser.setProperty(SCHEMA_LANG, SCHEMA_TYPE); + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schemaFile); + + InputStream is = this.getClass().getResourceAsStream("toys.xml"); + MyErrorHandler eh = new MyErrorHandler(); + parser.parse(is, eh); + Assert.assertFalse(eh.errorOccured, "Not Expected Error"); + System.setProperty("maxOccurLimit", ""); + } catch (Exception e) { + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + /* + * This test will take longer time to execute( abt 120sec). This method + * tries to validate a document. This document contains an element whose + * maxOccur is '3002'. Since secure processing feature is off, document + * should be parsed without any errors. + */ + @Test + public void testValidMaxOccurLimitWithOutSecureProcessing() { + if (_isSecureMode) + return; // jaxp secure feature can not be turned off when security + // manager is present + try { + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false); + spf.setValidating(true); + // Set the properties for Schema Validation + String SCHEMA_LANG = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + String SCHEMA_TYPE = "http://www.w3.org/2001/XMLSchema"; + // Get the Schema location as a File object + File schemaFile = new File(this.getClass().getResource("toys3002.xsd").toURI()); + // Get the parser + SAXParser parser = spf.newSAXParser(); + parser.setProperty(SCHEMA_LANG, SCHEMA_TYPE); + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schemaFile); + + InputStream is = this.getClass().getResourceAsStream("toys.xml"); + MyErrorHandler eh = new MyErrorHandler(); + parser.parse(is, eh); + Assert.assertFalse(eh.errorOccured, "Expected Error as maxOccurLimit is exceeded"); + + } catch (Exception e) { + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + /* + * Before 8014530: System property is set to 2. Given XML document has more + * than 2 entity references. Parsing this document in non-secure mode, + * should *not* report an error. + * After 8014530: System properties will override FSP, the result of this + * test should be the same as + * testSystemElementAttributeLimitWithSecureProcessing + */ + @Test + public void testSystemEntityExpansionLimitWithOutSecureProcessing() { + if (_isSecureMode) + return; // jaxp secure feature can not be turned off when security + // manager is present + try { + System.setProperty("entityExpansionLimit", "2"); + dbf = DocumentBuilderFactory.newInstance(); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false); + dbf.setValidating(true); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document doc = parser.parse(this.getClass().getResourceAsStream("entity.xml")); + Assert.fail("SAXParserException is expected, as given XML document contains more 2 entity references"); + } catch (Exception e) { + String errMsg = e.getMessage(); + Throwable cause = e.getCause(); + if (cause != null) { + errMsg += cause.getMessage(); + } + if (errMsg.contains("JAXP0001")) { + // expected + } else { + Assert.fail("Unexpected error: " + e.getMessage()); + } + } finally { + System.clearProperty("entityExpansionLimit"); + } + } + + /* + * System property is set to 2. Given XML document has more than 2 entity + * references. Parsing this document in secure mode, should report an error. + */ + @Test + public void testSystemEntityExpansionLimitWithSecureProcessing() { + try { + dbf = DocumentBuilderFactory.newInstance(); + dbf.setValidating(true); + System.setProperty("entityExpansionLimit", "2"); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document doc = parser.parse(this.getClass().getResourceAsStream("entity.xml")); + Assert.fail("SAXParserException is expected, as given XML document contains more 2 entity references"); + + } catch (SAXParseException e) { + System.out.println(e.getMessage()); + } catch (Exception e) { + Assert.fail("Exception " + e.getMessage()); + } finally { + System.setProperty("entityExpansionLimit", ""); + } + } + + /* + * Given XML document has more than 64000 entity references. Parsing this + * document in secure mode, should report an error. + */ + @Test + public void testEntityExpansionLimitWithSecureProcessing() { + try { + dbf = DocumentBuilderFactory.newInstance(); + dbf.setValidating(true); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document doc = parser.parse(this.getClass().getResourceAsStream("entity64K.xml")); + Assert.fail("SAXParserException is expected, as given XML document contains more 2 entity references"); + + } catch (SAXParseException e) { + System.out.println(e.getMessage()); + } catch (Exception e) { + Assert.fail("Exception " + e.getMessage()); + } finally { + System.setProperty("entityExpansionLimit", ""); + } + } + + /* + * Given XML document has more than 64000 entity references. Parsing this + * document in non-secure mode, should not report any error. + */ + @Test + public void testEntityExpansionLimitWithOutSecureProcessing() { + if (_isSecureMode) + return; // jaxp secure feature can not be turned off when security + // manager is present + try { + dbf = DocumentBuilderFactory.newInstance(); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false); + dbf.setValidating(true); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document doc = parser.parse(this.getClass().getResourceAsStream("entity64K.xml")); + + } catch (SAXParseException e) { + Assert.fail("Exception " + e.getMessage()); + } catch (Exception e) { + Assert.fail("Exception " + e.getMessage()); + } finally { + System.setProperty("entityExpansionLimit", ""); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6341770.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6341770.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.File; +import java.io.FileWriter; +import java.io.PrintWriter; + +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6341770 + * @summary Test external entity linked to non-ASCII base URL. + */ +public class Bug6341770 { + + // naming a file "aux" would fail on windows. + @Test + public void testNonAsciiURI() { + try { + File dir = File.createTempFile("sko\u0159ice", null); + dir.delete(); + dir.mkdir(); + File main = new File(dir, "main.xml"); + PrintWriter w = new PrintWriter(new FileWriter(main)); + w.println("]>"); + w.println("&aux;"); + w.flush(); + w.close(); + File aux = new File(dir, "aux1.xml"); + w = new PrintWriter(new FileWriter(aux)); + w.println(""); + w.flush(); + w.close(); + System.out.println("Parsing: " + main); + SAXParserFactory.newInstance().newSAXParser().parse(main, new DefaultHandler() { + public void startElement(String uri, String localname, String qname, Attributes attr) throws SAXException { + System.out.println("encountered <" + qname + ">"); + } + }); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception: " + e.getMessage()); + } + System.out.println("OK."); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6361283.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6361283.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6361283 + * @summary Test SAXParser returns version as 1.1 for XML 1.1 document. + */ +public class Bug6361283 { + + @Test + public void testXMLVersion() { + try { + SAXParserFactory factory = SAXParserFactory.newInstance(); + SAXParser parser = factory.newSAXParser(); + Assert.assertTrue(factory.getFeature("http://xml.org/sax/features/use-locator2"), "use-locator2 should have value as true"); + MyDefaultHandler dh = new MyDefaultHandler(); + parser.parse(this.getClass().getResourceAsStream("catalog.xml"), dh); + Assert.assertTrue(dh.xmlVersion.equals("1.1"), "XML Document version should be 1.1"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6506304Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6506304Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.XMLReader; + +/* + * @bug 6506304 + * @summary Test MalformedURLException: unknown protocol won't be thrown when there is a space within the full path file name. + */ +public class Bug6506304Test { + public static boolean isWindows = false; + static { + if (System.getProperty("os.name").indexOf("Windows") > -1) { + isWindows = true; + } + }; + + @Test + public void testPath() throws Exception { + if (isWindows) { + try { + SAXParserFactory factory = SAXParserFactory.newInstance(); + factory.setNamespaceAware(true); + SAXParser jaxpParser = factory.newSAXParser(); + XMLReader reader = jaxpParser.getXMLReader(); + reader.parse("C:/space error/x.xml"); + System.exit(0); + } catch (Exception e) { + System.out.println(e.getMessage()); + if (e.getMessage().equalsIgnoreCase("unknown protocol: c")) { + Assert.fail("jdk5 allowed the above form"); + } else if (e.getMessage().indexOf("(The system cannot find the path specified)") > 0) { + // expected + } + } + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6518733.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6518733.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.FileReader; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/* + * @bug 6518733 + * @summary Test SAX parser handles several attributes that each contain a newline within the attribute value. + */ +public class Bug6518733 { + + @Test + public void test() { + SAXParserFactory factory = SAXParserFactory.newInstance(); + try { + SAXParser saxParser = factory.newSAXParser(); + saxParser.parse(new InputSource(new FileReader(getClass().getResource("Bug6518733.xml").getFile())), new Handler()); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + static class Handler extends org.xml.sax.helpers.DefaultHandler { + public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { + // Make sure that the value of attribute q7 is "7 G" + if (qName.equals("obj")) { + Assert.assertTrue(attrs.getValue("", "q7").equals("7 G")); + } + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6518733.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6518733.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,32 @@ + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.Text; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6564400 + * @summary Test ignorable whitespace handling with schema validation. + */ +public class Bug6564400 { + private boolean sawIgnorable = false; + Schema schema = null; + + public Bug6564400(String name) { + String xsdFile = "Bug6564400.xsd"; + File schemaFile = new File(xsdFile); + + // Now attempt to load up the schema + try { + SchemaFactory schFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + schema = schFactory.newSchema(new StreamSource(getClass().getResourceAsStream(xsdFile))); + } catch (Exception e) { + // Nevermind, bad things will happen later + } + } + + @Test + public void testDOM() throws ParserConfigurationException, SAXException, IOException { + InputStream xmlFile = getClass().getResourceAsStream("Bug6564400.xml"); + + // Set the options on the DocumentFactory to remove comments, remove + // whitespace + // and validate against the schema. + DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); + docFactory.setIgnoringComments(true); + docFactory.setIgnoringElementContentWhitespace(true); + docFactory.setSchema(schema); + + DocumentBuilder parser = docFactory.newDocumentBuilder(); + Document xmlDoc = parser.parse(xmlFile); + + boolean ok = dump(xmlDoc, true); + Assert.assertEquals(true, ok); + } + + @Test + public void testSAX() throws ParserConfigurationException, SAXException, IOException { + InputStream xmlFile = getClass().getResourceAsStream("Bug6564400.xml"); + + // Parse with SAX + SAXParserFactory saxFactory = SAXParserFactory.newInstance(); + saxFactory.setSchema(schema); + + SAXParser saxparser = saxFactory.newSAXParser(); + + sawIgnorable = false; + saxparser.parse(xmlFile, new MyHandler()); + Assert.assertEquals(true, sawIgnorable); + } + + @Test + public void testConformantDOM() throws ParserConfigurationException, SAXException, IOException { + InputStream xmlFile = getClass().getResourceAsStream("Bug6564400.xml"); + + // Set the options on the DocumentFactory to remove comments, remove + // whitespace + // and validate against the schema. + DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); + docFactory.setIgnoringComments(true); + docFactory.setIgnoringElementContentWhitespace(true); + docFactory.setSchema(schema); + docFactory.setFeature("http://java.sun.com/xml/schema/features/report-ignored-element-content-whitespace", true); + + DocumentBuilder parser = docFactory.newDocumentBuilder(); + Document xmlDoc = parser.parse(xmlFile); + + boolean ok = dump(xmlDoc, true); + Assert.assertEquals(false, ok); + } + + @Test + public void testConformantSAX() throws ParserConfigurationException, SAXException, IOException { + InputStream xmlFile = getClass().getResourceAsStream("Bug6564400.xml"); + + // Parse with SAX + SAXParserFactory saxFactory = SAXParserFactory.newInstance(); + saxFactory.setSchema(schema); + saxFactory.setFeature("http://java.sun.com/xml/schema/features/report-ignored-element-content-whitespace", true); + + SAXParser saxparser = saxFactory.newSAXParser(); + + sawIgnorable = false; + saxparser.parse(xmlFile, new MyHandler()); + Assert.assertEquals(false, sawIgnorable); + } + + private boolean dump(Node node) { + return dump(node, false); + } + + private boolean dump(Node node, boolean silent) { + return dump(node, silent, 0); + } + + private boolean dump(Node node, boolean silent, int depth) { + boolean ok = true; + if (!silent) { + for (int i = 0; i < depth; i++) { + System.out.print(" "); + } + System.out.println(node); + } + + if (node.getNodeType() == Node.TEXT_NODE) { + String text = ((Text) node).getData(); + ok = ok && text.trim().length() > 0; + } + + if (node.getNodeType() == Node.ELEMENT_NODE || node.getNodeType() == Node.DOCUMENT_NODE) { + Node child = node.getFirstChild(); + while (child != null) { + ok = ok && dump(child, silent, depth + 1); + child = child.getNextSibling(); + } + } + return ok; + } + + public class MyHandler extends DefaultHandler { + public void ignorableWhitespace(char[] ch, int start, int length) { + sawIgnorable = true; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,4 @@ + + Doofus + McGee + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6573786.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6573786.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.InputStream; +import java.io.StringBufferInputStream; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6573786 + * @summary Test parser error messages are formatted. + */ +public class Bug6573786 { + String _cache = ""; + + @Test + public void test() { + final String XML = "" + "" + ""; + + runTest(XML); + + } + + @Test + public void test1() { + final String XML = "" + "" + ""; + runTest(XML); + + } + + void runTest(String xmlString) { + Bug6573786ErrorHandler handler = new Bug6573786ErrorHandler(); + try { + InputStream is = new StringBufferInputStream(xmlString); + SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); + parser.parse(is, handler); + } catch (Exception e) { + if (handler.fail) { + Assert.fail("The value of standalone attribute should be merged into the error message."); + } + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6573786ErrorHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6573786ErrorHandler.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +public class Bug6573786ErrorHandler extends DefaultHandler { + public boolean fail = false; + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println(e.getMessage()); + if (e.getMessage().indexOf("bad_value") < 0) { + fail = true; + } + } // fatalError () + + public void error(SAXParseException e) throws SAXException { + System.out.println(e.getMessage()); + } // error () + + public void warning(SAXParseException e) throws SAXException { + System.out.println(e.getMessage()); + } // warning () +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6594813.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6594813.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.StringReader; +import java.io.StringWriter; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6594813 + * @summary Test SAXParser output is wellformed with name space. + */ +public class Bug6594813 { + + public Bug6594813(String name) { + } + + private static final String TESTXML = "\n" + + "\n" + + "\n" + "\n" + "\n" + + "soapenv:Server\n" + "\n" + "com.sun.ts.tests.jaxws.sharedwebservices.faultservice.DummyException\n" + + "\n" + "\n" + "\n" + "dummyString1\n" + "\n" + "dummyString2\n" + + "\n" + "\n" + "\n" + "\n" + "\n"; + + // simplest XML to re-declare same prefix/namespace mappings + private static final String SIMPLE_TESTXML = "\n" + "\n" + + "\n" + "\n" + "\n"; + + private String runTransform(SAXParser sp) throws Exception { + // Run identity transform using SAX parser + SAXSource src = new SAXSource(sp.getXMLReader(), new InputSource(new StringReader(TESTXML))); + Transformer transformer = TransformerFactory.newInstance().newTransformer(); + StringWriter sw = new StringWriter(); + transformer.transform(src, new StreamResult(sw)); + + String result = sw.getBuffer().toString(); + // System.out.println(result); + return result; + } + + private void checkWellFormedness(String xml) throws Exception { + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); // Same as default + spf.setFeature("http://xml.org/sax/features/namespace-prefixes", true); + SAXParser sp = spf.newSAXParser(); + + // Re-parse output to make sure that it is well formed + sp.parse(new InputSource(new StringReader(xml)), new DefaultHandler()); + } + + /** + * Test an identity transform of an XML document with NS decls using a + * non-ns-aware parser. Output result to a StreamSource. Set ns-awareness to + * FALSE and prefixes to FALSE. + */ + @Test + public void testXMLNoNsAwareStreamResult1() { + try { + // Create SAX parser *without* enabling ns + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(false); // Same as default + spf.setFeature("http://xml.org/sax/features/namespace-prefixes", false); + SAXParser sp = spf.newSAXParser(); + + // Make sure that the output is well formed + String xml = runTransform(sp); + checkWellFormedness(xml); + } catch (Throwable ex) { + Assert.fail(ex.toString()); + } + } + + /** + * Test an identity transform of an XML document with NS decls using a + * non-ns-aware parser. Output result to a StreamSource. Set ns-awareness to + * FALSE and prefixes to TRUE. + */ + @Test + public void testXMLNoNsAwareStreamResult2() { + try { + // Create SAX parser *without* enabling ns + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(false); // Same as default + spf.setFeature("http://xml.org/sax/features/namespace-prefixes", true); + SAXParser sp = spf.newSAXParser(); + + // Make sure that the output is well formed + String xml = runTransform(sp); + checkWellFormedness(xml); + } catch (Throwable ex) { + Assert.fail(ex.toString()); + } + } + + /** + * Test an identity transform of an XML document with NS decls using a + * non-ns-aware parser. Output result to a StreamSource. Set ns-awareness to + * TRUE and prefixes to FALSE. + */ + @Test + public void testXMLNoNsAwareStreamResult3() { + try { + // Create SAX parser *without* enabling ns + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); // Same as default + spf.setFeature("http://xml.org/sax/features/namespace-prefixes", false); + SAXParser sp = spf.newSAXParser(); + + // Make sure that the output is well formed + String xml = runTransform(sp); + checkWellFormedness(xml); + } catch (Throwable ex) { + Assert.fail(ex.toString()); + } + } + + /** + * Test an identity transform of an XML document with NS decls using a + * non-ns-aware parser. Output result to a StreamSource. Set ns-awareness to + * TRUE and prefixes to TRUE. + */ + @Test + public void testXMLNoNsAwareStreamResult4() { + try { + // Create SAX parser *without* enabling ns + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); // Same as default + spf.setFeature("http://xml.org/sax/features/namespace-prefixes", true); + SAXParser sp = spf.newSAXParser(); + + // Make sure that the output is well formed + String xml = runTransform(sp); + checkWellFormedness(xml); + } catch (Throwable ex) { + Assert.fail(ex.toString()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ + + +%xhtml; diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.File; +import java.io.IOException; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.annotations.Test; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6608841 + * @summary Test SAX parses external parameter entity. + */ +public class Bug6608841 { + public Bug6608841(String name) { + } + + @Test + public void testParse() throws ParserConfigurationException, SAXException, IOException { + String file = getClass().getResource("Bug6608841.xml").getFile(); + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser parser = spf.newSAXParser(); + parser.parse(new File(file), new MyHandler()); + } + + public class MyHandler extends DefaultHandler { + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + +Some Title + + +

Some Title

+

This is a test. This is only a test.

+ + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841_xhtml11-flat.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841_xhtml11-flat.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,1 @@ + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6690015.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6690015.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.FileInputStream; + +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +/* + * @bug 6518733 + * @summary Test SAX parser handles several attributes with newlines. + */ +public class Bug6690015 { + + public Bug6690015() { + } + + @Test + public void test() { + try { + FileInputStream fis = new FileInputStream(getClass().getResource("bug6690015.xml").getFile()); + + Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(fis)); + Element root = doc.getDocumentElement(); + NodeList textnodes = root.getElementsByTagName("text"); + int len = textnodes.getLength(); + int index = 0; + int attindex = 0; + int attrlen = 0; + NamedNodeMap attrs = null; + + while (index < len) { + Element te = (Element) textnodes.item(index); + attrs = te.getAttributes(); + attrlen = attrs.getLength(); + attindex = 0; + Node node = null; + + while (attindex < attrlen) { + node = attrs.item(attindex); + System.out.println("attr: " + node.getNodeName() + " is shown holding value: " + node.getNodeValue()); + attindex++; + } + index++; + System.out.println("-------------"); + } + fis.close(); + } catch (Exception e) { + Assert.fail("Exception: " + e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6760982.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6760982.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.File; +import java.io.FileReader; +import java.io.Reader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +/* + * @bug 6518733 + * @summary Test SAX parser handles several attributes with containing ">". + */ +public class Bug6760982 { + + @Test + public void test() { + try { + Document xmlDoc = _Parse(new File(getClass().getResource("bug6760982.xml").getFile())); + Node node = xmlDoc.getDocumentElement(); + + _ProcessNode(node, 0); + _Flush(); + } catch (Exception e) { + _ErrPrintln("Exception: " + e.toString()); + Assert.fail("Exception: " + e.getMessage()); + } + } + + private static void _Flush() { + System.out.flush(); + System.err.flush(); + } + + private static void _Println(String str, int level) { + for (int i = 0; i < level; i++) + System.out.print(" "); + + System.out.println(str); + System.out.flush(); + } + + private static void _ErrPrintln(String aStr) { + System.out.flush(); + System.err.println(aStr); + System.err.flush(); + } + + private static Document _Parse(File f) throws Exception { + FileReader rd = new FileReader(f); + Document doc = _Parse(rd); + + rd.close(); + + return doc; + } + + private static Document _Parse(Reader src) throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + + dbf.setValidating(false); // to improve performance + + DocumentBuilder xmlParser = dbf.newDocumentBuilder(); + InputSource is = new InputSource(src); + + return xmlParser.parse(is); + } + + private static void _PrintAttributes(Node n, int level) { + NamedNodeMap nnmap = n.getAttributes(); + + if (nnmap != null && nnmap.getLength() > 0) { + _Println(" (" + nnmap.getClass() + "):", level + 1); + + for (int i = 0; i < nnmap.getLength(); i++) { + Node an = nnmap.item(i); + + String nameStr = an.getNodeName(); + String valueStr = an.getNodeValue(); + + if (valueStr != "") + nameStr += " = " + valueStr; + + _Println(nameStr, level + 2); + } + } + } + + private static void _ProcessChildren(Node n, int level) throws Exception { + NodeList nlist = n.getChildNodes(); + + if (nlist != null) + for (int i = 0; i < nlist.getLength(); i++) + _ProcessNode(nlist.item(i), level + 1); + } + + private static void _ProcessNode(Node n, int level) throws Exception { + n.getAttributes(); + n.getChildNodes(); + + // At this point, for JVM 1.6 and Xerces <= 1.3.1, + // Test-XML.xml::mytest:Y's attribute is (already) bad. + + switch (n.getNodeType()) { + + case Node.TEXT_NODE: + String str = n.getNodeValue().trim(); + + /* ...Only print non-empty strings... */ + if (str.length() > 0) { + String valStr = n.getNodeValue(); + + _Println(valStr, level); + } + break; + + case Node.COMMENT_NODE: + break; + + default: { + String nodeNameStr = n.getNodeName(); + + _Println(nodeNameStr + " (" + n.getClass() + "):", level); + + /* ...Print children... */ + _ProcessChildren(n, level); + + /* ...Print optional node attributes... */ + _PrintAttributes(n, level); + } + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6849942Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6849942Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.ByteArrayInputStream; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.ProcessingInstruction; +import org.xml.sax.InputSource; + +/* + * @bug 6849942 + * @summary Test parsing an XML that starts with a processing instruction and no prolog. + */ +public class Bug6849942Test { + + @Test + public void test() throws Exception { + try { + ByteArrayInputStream bais = new ByteArrayInputStream("".getBytes()); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder xmlParser = factory.newDocumentBuilder(); + // DOMParser p = new DOMParser(); + Document document = xmlParser.parse(new InputSource(bais)); + String result = ((ProcessingInstruction) document.getFirstChild()).getData(); + System.out.println(result); + if (!result.equalsIgnoreCase("foo")) { + Assert.fail("missing PI data"); + } + + } catch (Exception e) { + } + } + + @Test + public void testWProlog() throws Exception { + try { + ByteArrayInputStream bais = new ByteArrayInputStream("".getBytes()); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder xmlParser = factory.newDocumentBuilder(); + // DOMParser p = new DOMParser(); + Document document = xmlParser.parse(new InputSource(bais)); + String result = ((ProcessingInstruction) document.getFirstChild()).getData(); + System.out.println(result); + if (!result.equalsIgnoreCase("foo")) { + Assert.fail("missing PI data"); + } + } catch (Exception e) { + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug7157608.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug7157608.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,1 @@ + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug7157608.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug7157608.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,13 @@ + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug7157608Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug7157608Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.File; +import java.io.IOException; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 7157608 + * @summary Test feature standard-uri-conformant works. + */ +public class Bug7157608Test { + public static boolean isWindows = false; + static { + if (System.getProperty("os.name").indexOf("Windows") > -1) { + isWindows = true; + } + }; + + String xml1, xml2; + + @BeforeMethod + protected void setUp() throws IOException { + File file1 = new File(getClass().getResource("Bug7157608.xml").getFile()); + xml1 = file1.getPath().replace("\\", "\\\\"); + File file2 = new File(getClass().getResource("Bug7157608_1.xml").getFile()); + xml2 = file2.getPath(); + } + + // case 1 + // standard-uri-confomant is false + // dtd-validation is false + @Test + public void test1() { + if (isWindows) { + try { + ParserSettings ps = new ParserSettings(); + + DocumentBuilder db = getDocumentBuilder(ps); + InputSource is = new InputSource(); + is.setSystemId(xml1); + Document doc = db.parse(is); + System.out.println("test1() :OK"); + } catch (Exception e) { + Assert.fail("test1() :NG"); + + } + } + } + + // case 2 + // standard-uri-confomant is false + // dtd-validation is true + @Test + public void test2() { + if (isWindows) { + try { + ParserSettings ps = new ParserSettings(); + ps.validating = true; + + DocumentBuilder db = getDocumentBuilder(ps); + InputSource is = new InputSource(xml2); + Document doc = db.parse(is); + System.out.println("test2() :OK"); + } catch (Exception e) { + Assert.fail("test2() :NG"); + // logger.info(e.getMessage()); + } + } + } + + // case 3 + // standard-uri-confomant is true + @Test + public void test3() { + if (isWindows) { + try { + ParserSettings ps = new ParserSettings(); + ps.standardUriConformant = true; + + DocumentBuilder db = getDocumentBuilder(ps); + InputSource is = new InputSource(); + is.setSystemId(xml1); + Document doc = db.parse(is); + Assert.fail("test3() :NG"); + } catch (IOException e) { + String returnedErr = e.getMessage(); + String expectedStr = "Opaque part contains invalid character"; + + if (returnedErr.indexOf(expectedStr) >= 0) { + System.out.println("test3() :OK"); + } else { + Assert.fail("test3() :NG"); + } + } catch (Exception e) { + System.out.println("test3() :NG"); + } + } + } + + // case 4 + // standard-uri-confomant is true + // dtd-validation is true + @Test + public void test4() { + if (isWindows) { + try { + ParserSettings ps = new ParserSettings(); + ps.standardUriConformant = true; + ps.validating = true; + + DocumentBuilder db = getDocumentBuilder(ps); + InputSource is = new InputSource(xml2); + Document doc = db.parse(is); + Assert.fail("test4() :NG"); + } catch (IOException e) { + String returnedErr = e.getMessage(); + String expectedStr = "Opaque part contains invalid character"; + + if (returnedErr.indexOf(expectedStr) >= 0) { + System.out.println("test3() :OK"); + } else { + Assert.fail("test3() :NG"); + } + } catch (Exception e) { + Assert.fail("test4() :NG"); + } + } + } + + public DocumentBuilder getDocumentBuilder(ParserSettings ps) { + DocumentBuilder db = null; + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + if (ps.standardUriConformant) { + dbf.setFeature("http://apache.org/xml/features/standard-uri-conformant", true); + } + dbf.setValidating(ps.validating); + db = dbf.newDocumentBuilder(); + db.setErrorHandler(new MyHandler()); + } catch (Exception e) { + Assert.fail("standard-uri-conformant not recognized"); + } + return db; + } + + class MyHandler extends DefaultHandler { + @Override + public void warning(SAXParseException e) throws SAXException { + printDetail("**Warning**", e); + } + + @Override + public void error(SAXParseException e) throws SAXException { + printDetail("**Error**", e); + throw new SAXException("Error encountered"); + } + + @Override + public void fatalError(SAXParseException e) throws SAXException { + printDetail("**Fatal Error**", e); + throw new SAXException("Fatal Error encountered"); + } + + public void printDetail(String msg, SAXParseException e) { + System.out.println(msg); + System.out.println(e.getMessage()); + System.out.println(" Line: " + e.getLineNumber()); + System.out.println(" Column: " + e.getColumnNumber()); + System.out.println(" URI: " + e.getSystemId()); + } + + } + + class ParserSettings { + boolean standardUriConformant = false; + boolean validating = false; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug7157608_1.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug7157608_1.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,14 @@ + + + + + + +test + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug7166896Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug7166896Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.IOException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +/* + * @bug 7166896 + * @summary Test DocumentBuilder.parse(String uri) supports IPv6 format. + */ +public class Bug7166896Test { + + @Test + public void test() throws Exception { + final String url = "http://[fe80::la03:73ff:fead:f7b0]/note.xml"; + final DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); + domFactory.setNamespaceAware(true); + DocumentBuilder builder; + Document doc = null; + System.out.println("URL is " + url); + try { + builder = domFactory.newDocumentBuilder(); + // here comes the MalformedURLException. With Java6 / 7 it looks + // like this: + // java.net.MalformedURLException: For input string: + // ":la03:73ff:fead:f7b0%5D" + // which is not fine. + // with xerces 2.11.0 it complains about a non-existing host, which + // is fine + System.out.println("passing URL to DocumentBuilder.parse()"); + doc = builder.parse(url); + + } catch (SAXException e) { + e.printStackTrace(); + } catch (IOException e) { + String em = e.getMessage(); + System.err.println("Error message: " + em); + if (em.contains("For input string: \":la03:73ff:fead:f7b0%5D\"")) { + Assert.fail("failed to accept IPv6 address"); + } + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug8003147Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug8003147Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.FileOutputStream; +import java.util.ArrayList; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import com.sun.org.apache.bcel.internal.classfile.ClassParser; +import com.sun.org.apache.bcel.internal.classfile.ConstantClass; +import com.sun.org.apache.bcel.internal.classfile.ConstantPool; +import com.sun.org.apache.bcel.internal.classfile.ConstantUtf8; +import com.sun.org.apache.bcel.internal.classfile.JavaClass; +import com.sun.org.apache.bcel.internal.classfile.Method; +import com.sun.org.apache.bcel.internal.generic.ClassGen; +import com.sun.org.apache.bcel.internal.generic.MethodGen; + +/* + * @bug 8003147 + * @summary Test port fix for BCEL bug 39695. + */ +public class Bug8003147Test { + + @Test + public void test() throws Exception { + String classfile = getClass().getResource("Bug8003147Test.class").getPath(); + JavaClass jc = new ClassParser(classfile).parse(); + // rename class + ConstantPool cp = jc.getConstantPool(); + int cpIndex = ((ConstantClass) cp.getConstant(jc.getClassNameIndex())).getNameIndex(); + cp.setConstant(cpIndex, new ConstantUtf8("javax/xml/parsers/Bug8003147TestPrime")); + ClassGen gen = new ClassGen(jc); + Method[] methods = jc.getMethods(); + int index; + for (index = 0; index < methods.length; index++) { + if (methods[index].getName().equals("doSomething")) { + break; + } + } + Method m = methods[index]; + MethodGen mg = new MethodGen(m, gen.getClassName(), gen.getConstantPool()); + gen.replaceMethod(m, mg.getMethod()); + String path = classfile.replace("Bug8003147Test", "Bug8003147TestPrime"); + gen.getJavaClass().dump(new FileOutputStream(path)); + + try { + Class.forName("javax.xml.parsers.Bug8003147TestPrime"); + } catch (ClassFormatError cfe) { + cfe.printStackTrace(); + Assert.fail("modified version of class does not pass verification"); + } + } + + public void doSomething(double d, ArrayList list) { + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/DosTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/DosTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2031 @@ + + + + + Boss Big + chief@foo.com + + + + + Worker One + one@foo.com + + + + + Worker Two + two@foo.com + + + + + Worker Three + three@foo.com + + + + + Worker Four + four@foo.com + + + + + Worker Five + five@foo.com + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/DosTest3.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/DosTest3.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,42 @@ + + + + + Boss Big + chief@foo.com + + + + + Worker One + one@foo.com + + + + + Worker Two + two@foo.com + + + + + Worker Three + three@foo.com + + + + + Worker Four + four@foo.com + + + + + Worker Five + five@foo.com + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/FactoryFindTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/FactoryFindTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.net.URL; +import java.net.URLClassLoader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test Classloader for SAXParserFactory. + */ +public class FactoryFindTest { + + boolean myClassLoaderUsed = false; + + @Test + public void testFactoryFind() { + try { + // System.setProperty("jaxp.debug", "true"); + + SAXParserFactory factory = SAXParserFactory.newInstance(); + Assert.assertTrue(factory.getClass().getClassLoader() == null); + + Thread.currentThread().setContextClassLoader(null); + factory = SAXParserFactory.newInstance(); + Assert.assertTrue(factory.getClass().getClassLoader() == null); + + Thread.currentThread().setContextClassLoader(new MyClassLoader()); + factory = SAXParserFactory.newInstance(); + if (System.getSecurityManager() == null) + Assert.assertTrue(myClassLoaderUsed); + else + Assert.assertFalse(myClassLoaderUsed); + } catch (Exception ex) { + } + + } + + class MyClassLoader extends URLClassLoader { + + public MyClassLoader() { + super(new URL[0]); + } + + public Class loadClass(String name) throws ClassNotFoundException { + myClassLoaderUsed = true; + return super.loadClass(name); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/MyDefaultHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/MyDefaultHandler.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.ext.Locator2; +import org.xml.sax.helpers.DefaultHandler; + +public class MyDefaultHandler extends DefaultHandler { + + private Locator myLocator = null; + String xmlVersion = ""; + + public void setDocumentLocator(Locator locator) { + myLocator = locator; + } + + public void startElement(String uri, String localName, String qName, Attributes attributes) { + try { + xmlVersion = ((Locator2) myLocator).getXMLVersion(); + } catch (Exception e) { + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/MyErrorHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/MyErrorHandler.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +public class MyErrorHandler extends DefaultHandler { + + public boolean errorOccured = false; + + public void error(SAXParseException e) throws SAXException { + + System.err.println("Error: " + "[[" + e.getPublicId() + "]" + "[" + e.getSystemId() + "]]" + "[[" + e.getLineNumber() + "]" + "[" + e.getColumnNumber() + + "]] " + e); + + errorOccured = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + + System.err.println("Fatal Error: " + e); + + errorOccured = true; + } + + public void warning(SAXParseException e) throws SAXException { + + System.err.println("Warning: " + e); + + errorOccured = true; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/ParseEmptyStream.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/ParseEmptyStream.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers; + +import java.io.StringReader; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @summary Test SAXParser doesn't accept empty stream. + */ +public class ParseEmptyStream { + + SAXParserFactory factory = null; + + public ParseEmptyStream(String name) { + try { + factory = SAXParserFactory.newInstance(); + factory.setNamespaceAware(true); + } catch (Exception ex) { + Assert.fail(ex.getMessage()); + } + } + + @Test + public void testEmptyStream() { + try { + SAXParser parser = factory.newSAXParser(); + InputSource source = new InputSource(new StringReader("")); + parser.parse(source, new MyHandler()); + Assert.fail("Inputstream without document element accepted"); + } catch (Exception ex) { + System.out.println("Exception thrown: " + ex.getMessage()); + // Premature end of file exception expected + } + } + + @Test + public void testXmlDeclOnly() { + try { + SAXParser parser = factory.newSAXParser(); + InputSource source = new InputSource(new StringReader("")); + parser.parse(source, new MyHandler()); + Assert.fail("Inputstream without document element accepted"); + } catch (Exception ex) { + System.out.println("Exception thrown: " + ex.getMessage()); + // Premature end of file exception expected + } + } + + static class MyHandler extends DefaultHandler { + public void startDocument() { + System.out.println("Start document called"); + } + + public void endDocument() { + System.out.println("End document called"); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/bug6690015.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/bug6690015.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,6 @@ + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/bug6760982.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/bug6760982.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,13 @@ + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/catalog.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/catalog.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + +<_test01><_test-04>T%e!s#t$
1000509.90.0860833333333333345134545.22916666666667114.44-16.886.70A1Vn

2000503.80.08438888888888889-003011-0.503055555555555698.33-61.146.29gG9

3Psc33 Psc000520.10.08891666666666666-054227-5.707500000000000593.75-65.934.61K0IIIbCN-0.5

4Peg86 Peg000542.00.09513234613.39611111111111106.19-47.985.51G5III

5000616.00.1044444444444444558261258.43666666666666117.03-03.925.96G5V

6000619.00.10527777777777779-490430-49.075321.61-66.385.70G1IV

7Cas10 Cas000626.50.1073611111111111264114664.19611111111111118.061.755.59B9III

8000636.80.1102222222222222229011729.02138888888889111.26-32.836.13K0V

9000650.10.11391666666666667-230627-23.107552.21-79.146.18A7V

10000718.20.12172222222222222-172311-17.38638888888888874.36-75.906.19A6Vn
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/catalog.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/catalog.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/entity.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/entity.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,8 @@ + + + + + +]> +&writer;©right;&something;&something; diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/entity64K.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/entity64K.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,4 @@ + + +]> &s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;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s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s;&s; diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/test.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/test.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/test1.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/test1.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + + + + + + id2 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/test2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/test2.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,4 @@ + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/toys.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/toys.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,39 @@ + + + + + + + Lego-Model01 + 65.99 + + + Lego-Model2 + 69.99 + + + Lego-Model3 + 14.99 + + + Barbie-Pink + 12.99 + + + Barbie-Blue + 13.99 + + + Barbie-White + 13.99 + + + Barbie-Plain + 13.99 + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/toys.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/toys.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/toys3002.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/toys3002.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/xinclude/Bug6794483Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/xinclude/Bug6794483Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.parsers.xinclude; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +/* + * @bug 6794483 + * @summary Test JAXP parser can parse xml file using to include another xml, which has an empty element. + */ +public class Bug6794483Test { + + @Test + public final void test() { + String xml = getClass().getResource("test1.xml").getPath(); + Document doc = parseXmlFile(xml); + + StringWriter sw = new StringWriter(); + StreamResult result = new StreamResult(sw); + + TransformerFactory transformerFact = TransformerFactory.newInstance(); + transformerFact.setAttribute("indent-number", new Integer(4)); + Transformer transformer; + + try { + transformer = transformerFact.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty(OutputKeys.METHOD, "xml"); + transformer.setOutputProperty(OutputKeys.MEDIA_TYPE, "text/xml"); + + // "true" indicate Append content If file exist in system + transformer.transform(new DOMSource(doc), result); + System.out.println("test" + sw); + + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + Assert.fail("unexpected TransformerConfigurationException"); + } catch (TransformerException ex) { + ex.printStackTrace(); + Assert.fail("unexpected TransformerException"); + } + + } + + public Document parseXmlFile(String fileName) { + System.out.println("Parsing XML file... " + fileName); + DocumentBuilder docBuilder = null; + Document doc = null; + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); + docBuilderFactory.setCoalescing(true); + docBuilderFactory.setXIncludeAware(true); + System.out.println("Include: " + docBuilderFactory.isXIncludeAware()); + docBuilderFactory.setNamespaceAware(true); + docBuilderFactory.setExpandEntityReferences(true); + + try { + docBuilder = docBuilderFactory.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } + + File sourceFile = new File(fileName); + try { + doc = docBuilder.parse(sourceFile); + } catch (SAXException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + System.out.println("XML file parsed"); + return doc; + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/xinclude/test1.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/xinclude/test1.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/xinclude/test2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/xinclude/test2.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,12 @@ + + +Node1 Value +Node2 Value + +Node4 Value + +Node6 Value + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/AttributeLocalNameTest/AttributeLocalNameTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/AttributeLocalNameTest/AttributeLocalNameTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.AttributeLocalNameTest; + +import java.io.StringReader; + +import javax.xml.stream.StreamFilter; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLStreamReader.getAttributeLocalName(). + */ +public class AttributeLocalNameTest { + + static final String XML = "" + ""; + + @Test + public void testOne() { + try { + XMLInputFactory factory = XMLInputFactory.newInstance(); + XMLStreamReader reader = factory.createFilteredReader(factory.createXMLStreamReader(new StringReader(XML)), new Filter()); + reader.next(); + reader.hasNext(); // force filter to cache + Assert.assertTrue(reader.getAttributeLocalName(0) != null); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Unexpected Exception: " + e.getMessage()); + } + } + + class Filter implements StreamFilter { + + public boolean accept(XMLStreamReader reader) { + return true; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6370703.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6370703.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6370703 + * @summary Test StAX parser can parse attribute default value when START_ELEMENT. + */ +public class Bug6370703 { + + private static String INPUT_FILE = "sgml.xml"; + + @Test + public void testStartElement() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + XMLStreamReader xsr = xif.createXMLStreamReader(this.getClass().getResource(INPUT_FILE).toExternalForm(), + this.getClass().getResourceAsStream(INPUT_FILE)); + + while (xsr.hasNext()) { + int event = xsr.next(); + if (event == XMLStreamReader.START_ELEMENT) { + String localName = xsr.getLocalName(); + boolean print = "para".equals(localName); + int nrOfAttr = xsr.getAttributeCount(); + if (print) { + Assert.assertTrue(nrOfAttr > 0, "Default attribute declared in DTD is missing"); + } + + } + } + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6378422.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6378422.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import javax.xml.stream.XMLInputFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6378422 + * @summary Test setting reuse-instance property on StAX factory. + */ +public class Bug6378422 { + + @Test + public void testReuseInstanceProp() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty("reuse-instance", Boolean.valueOf(true)); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6380870.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6380870.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6380870 + * @summary Test StAX parser can parse VoiceXML DTD. + */ +public class Bug6380870 { + + private static String INPUT_FILE = "basic-form.vxml"; + + @Test + public void testStreamReader() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + XMLStreamReader reader = xif.createXMLStreamReader(this.getClass().getResource(INPUT_FILE).toExternalForm(), + this.getClass().getResourceAsStream(INPUT_FILE)); + while (reader.hasNext()) + reader.next(); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6489502.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6489502.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6489502 + * @summary Test XMLInputFactory works correctly in case it repeats to create reader. + */ +public class Bug6489502 { + + public java.io.File input; + public final String filesDir = "./"; + protected XMLInputFactory inputFactory = XMLInputFactory.newInstance(); + protected XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); + + private static String xml = "The Tragedy of Hamlet, Prince of Denmark"; + + @Test + public void testEventReader1() { + try { + // Check if event reader returns the correct event + XMLEventReader e1 = inputFactory.createXMLEventReader(inputFactory.createXMLStreamReader(new java.io.StringReader(xml))); + Assert.assertEquals(e1.peek().getEventType(), XMLStreamConstants.START_DOCUMENT); + + // Repeat same steps to test factory state + XMLEventReader e2 = inputFactory.createXMLEventReader(inputFactory.createXMLStreamReader(new java.io.StringReader(xml))); + Assert.assertEquals(e2.peek().getEventType(), XMLStreamConstants.START_DOCUMENT); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + @Test + public void testEventReader2() { + try { + // Now advance underlying reader and then call peek on event reader + XMLStreamReader s1 = inputFactory.createXMLStreamReader(new java.io.StringReader(xml)); + Assert.assertEquals(s1.getEventType(), XMLStreamConstants.START_DOCUMENT); + s1.next(); + s1.next(); // advance to + Assert.assertTrue(s1.getLocalName().equals("TITLE")); + + XMLEventReader e3 = inputFactory.createXMLEventReader(s1); + Assert.assertEquals(e3.peek().getEventType(), XMLStreamConstants.START_ELEMENT); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6509774.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6509774.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6509774 + * @summary Test Property javax.xml.stream.supportDTD, DTD events are now returned even if supportDTD=false. + */ +public class Bug6509774 { + + @Test + public void test0() { + + try { + + XMLInputFactory xif = XMLInputFactory.newInstance(); + + xif.setProperty("javax.xml.stream.supportDTD", Boolean.TRUE); + + XMLStreamReader xsr = xif.createXMLStreamReader( + + getClass().getResource("sgml_Bug6509774.xml").toString(), + + getClass().getResourceAsStream("sgml_Bug6509774.xml")); + + Assert.assertTrue(xsr.getEventType() == XMLStreamConstants.START_DOCUMENT); + + int event = xsr.next(); + + // Must be a DTD event since DTDs are supported + + Assert.assertTrue(event == XMLStreamConstants.DTD); + + while (xsr.hasNext()) { + + event = xsr.next(); + + } + + Assert.assertTrue(event == XMLStreamConstants.END_DOCUMENT); + + xsr.close(); + + } + + catch (Exception e) { + + Assert.fail(e.getMessage()); + + } + + } + + @Test + public void test1() { + + try { + + XMLInputFactory xif = XMLInputFactory.newInstance(); + + xif.setProperty("javax.xml.stream.supportDTD", Boolean.FALSE); + + XMLStreamReader xsr = xif.createXMLStreamReader( + + getClass().getResource("sgml_Bug6509774.xml").toString(), + + getClass().getResourceAsStream("sgml_Bug6509774.xml")); + + Assert.assertTrue(xsr.getEventType() == XMLStreamConstants.START_DOCUMENT); + + int event = xsr.next(); + + // Should not be a DTD event since they are ignored + + Assert.assertTrue(event == XMLStreamConstants.DTD); + + while (xsr.hasNext()) { + + event = xsr.next(); + + } + + Assert.assertTrue(event == XMLStreamConstants.END_DOCUMENT); + + xsr.close(); + + } + + catch (Exception e) { + + Assert.fail(e.getMessage()); + + } + + } + + @Test + public void test2() { + + try { + + XMLInputFactory xif = XMLInputFactory.newInstance(); + + xif.setProperty("javax.xml.stream.supportDTD", Boolean.FALSE); + + XMLStreamReader xsr = xif.createXMLStreamReader( + + getClass().getResource("sgml-bad-systemId.xml").toString(), + + getClass().getResourceAsStream("sgml-bad-systemId.xml")); + + Assert.assertTrue(xsr.getEventType() == XMLStreamConstants.START_DOCUMENT); + + int event = xsr.next(); + + // Should not be a DTD event since they are ignored + + Assert.assertTrue(event == XMLStreamConstants.DTD); + + while (xsr.hasNext()) { + + event = xsr.next(); + + } + + Assert.assertTrue(event == XMLStreamConstants.END_DOCUMENT); + + xsr.close(); + + } + + catch (Exception e) { + + // Bogus systemId in XML document should not result in exception + + Assert.fail(e.getMessage()); + + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6688002Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6688002Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6688002 + * @summary Test single instance of XMLOutputFactory/XMLInputFactory create multiple Writer/Readers in parallel. + */ +public class Bug6688002Test { + + private static final XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); + private static final XMLInputFactory inputFactory = XMLInputFactory.newInstance(); + private static final int NO_THREADS = 3; + + @Test + public void testMultiThread() throws Exception { + Thread[] threads = new Thread[NO_THREADS]; + for (int i = 0; i < NO_THREADS; i++) { + threads[i] = new Thread(new MyRunnable(i)); + } + for (int i = 0; i < NO_THREADS; i++) { + threads[i].start(); + } + for (int i = 0; i < NO_THREADS; i++) { + threads[i].join(); + } + } + + public class MyRunnable implements Runnable { + final int no; + + MyRunnable(int no) { + this.no = no; + } + + public void run() { + try { + FileOutputStream fos = new FileOutputStream("" + no); + XMLStreamWriter w = getWriter(fos); + // System.out.println("Writer="+w+" Thread="+Thread.currentThread()); + w.writeStartDocument(); + w.writeStartElement("hello"); + for (int j = 0; j < 50; j++) { + w.writeStartElement("a" + j); + w.writeEndElement(); + } + w.writeEndElement(); + w.writeEndDocument(); + w.close(); + fos.close(); + + FileInputStream fis = new FileInputStream("" + no); + XMLStreamReader r = getReader(fis); + while (r.hasNext()) { + r.next(); + } + r.close(); + fis.close(); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + } + + public static/* synchronized */XMLStreamReader getReader(InputStream is) throws Exception { + return inputFactory.createXMLStreamReader(is); + // return XMLStreamReaderFactory.create(null, is, true); + } + + public static/* synchronized */XMLStreamWriter getWriter(OutputStream os) throws Exception { + return outputFactory.createXMLStreamWriter(os); + // return XMLStreamWriterFactory.createXMLStreamWriter(os); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6976938.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6976938.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,1810 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<vf:root xmlns:vf="http://www.xxx.com/oss/xml/TroubleTicket"> + <vf:troubleDescription> +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + +<a111111111a> + <b111111111b> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <c111111111c> + <b111111111b> +<a111111111a> + + </vf:troubleDescription> +</vf:root> + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6976938Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Bug6976938Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import javax.xml.namespace.QName; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6976938 + * @summary Test StAX parser won't throw StackOverflowError while reading valid XML file, in case the text content of an XML element contains many lines like "< ... >". + */ +public class Bug6976938Test { + + private static final String INPUT_FILE = "Bug6976938.xml"; + + public static final String VF_GENERIC_TT_NAMESPACE = "http://www.vodafone.com/oss/xml/TroubleTicket"; + + public static final QName ATTACHMENT_NAME = new QName(VF_GENERIC_TT_NAMESPACE, "attachment"); + + @Test + public void testEventReader() { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE); + eventReaderTest(xif); + } + + @Test + public void testEventReader1() { + XMLInputFactory xif = XMLInputFactory.newInstance(); + eventReaderTest(xif); + } + + public void eventReaderTest(XMLInputFactory xif) { + XMLEventReader eventReader = null; + try { + eventReader = xif.createXMLEventReader(this.getClass().getResourceAsStream(INPUT_FILE)); + XMLEventReader filteredEventReader = xif.createFilteredReader(eventReader, new EventFilter() { + public boolean accept(XMLEvent event) { + if (!event.isStartElement()) { + return false; + } + QName elementQName = event.asStartElement().getName(); + if ((elementQName.getLocalPart().equals(ATTACHMENT_NAME.getLocalPart()) || elementQName.getLocalPart().equals("Attachment")) + && elementQName.getNamespaceURI().equals(VF_GENERIC_TT_NAMESPACE)) { + return true; + } + return false; + } + }); + if (filteredEventReader.hasNext()) { + System.out.println("containsAttachments() returns true"); + } + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + + } finally { + if (eventReader != null) { + try { + eventReader.close(); + } catch (XMLStreamException xse) { + // Ignored by intention + } + } + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/CoalesceTest/CoalesceTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/CoalesceTest/CoalesceTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package javax.xml.stream.CoalesceTest; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test Coalesce property works. + */ +public class CoalesceTest { + + String countryElementContent = "START India CS}}}}}} India END"; + String descriptionElementContent = "a&b"; + String fooElementContent = "&< cdatastart<><>>><>><<<<cdataend entitystart insert entityend"; + + @Test + public void testCoalesceProperty() { + try { + XMLInputFactory xifactory = XMLInputFactory.newInstance(); + xifactory.setProperty(XMLInputFactory.IS_COALESCING, new Boolean(true)); + InputStream xml = this.getClass().getResourceAsStream("coalesce.xml"); + XMLStreamReader streamReader = xifactory.createXMLStreamReader(xml); + while (streamReader.hasNext()) { + int eventType = streamReader.next(); + if (eventType == XMLStreamConstants.START_ELEMENT && streamReader.getLocalName().equals("country")) { + eventType = streamReader.next(); + if (eventType == XMLStreamConstants.CHARACTERS) { + String text = streamReader.getText(); + if (!text.equals(countryElementContent)) { + System.out.println("String dont match"); + System.out.println("text = " + text); + System.out.println("countryElementContent = " + countryElementContent); + } + // assertTrue(text.equals(countryElementContent)); + } + } + if (eventType == XMLStreamConstants.START_ELEMENT && streamReader.getLocalName().equals("description")) { + eventType = streamReader.next(); + if (eventType == XMLStreamConstants.CHARACTERS) { + String text = streamReader.getText(); + if (!text.equals(descriptionElementContent)) { + System.out.println("String dont match"); + System.out.println("text = " + text); + System.out.println("descriptionElementContent = " + descriptionElementContent); + } + Assert.assertTrue(text.equals(descriptionElementContent)); + } + } + if (eventType == XMLStreamConstants.START_ELEMENT && streamReader.getLocalName().equals("foo")) { + eventType = streamReader.next(); + if (eventType == XMLStreamConstants.CHARACTERS) { + String text = streamReader.getText(); + if (!text.equals(fooElementContent)) { + System.out.println("String dont match"); + System.out.println("text = " + text); + System.out.println("fooElementContent = " + fooElementContent); + } + + Assert.assertTrue(text.equals(fooElementContent)); + } + } + + } + } catch (XMLStreamException ex) { + + if (ex.getNestedException() != null) { + ex.getNestedException().printStackTrace(); + } + // ex.printStackTrace() ; + } catch (Exception ex) { + ex.printStackTrace(); + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/CoalesceTest/coalesce.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/CoalesceTest/coalesce.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE city [ +<!ENTITY a "insert"> +<!ENTITY b "<element1>subtree</element1>"> + +]> +<city name = "Bangalore" population = "100000"> + + <country state = "Karnatka">START India <![CDATA[CS}}}}}}]]> India END</country> + <foo>&< <![CDATA[cdatastart<><>>><>><<<<cdataend]]> entitystart &a; entityend</foo> + &b; + <description>a&b</description> + <?CityHotels Information about the hotels is passed to different appications for processing. ?> + +</city> diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/EntitiesTest/EntityTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/EntitiesTest/EntityTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.EntitiesTest; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.LineNumberReader; +import java.io.Reader; +import java.io.StringReader; +import java.net.URL; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/* + * @summary Test StAX parses entity. + */ +public class EntityTest { + + XMLInputFactory factory = null; + String output = ""; + + @BeforeMethod + protected void setUp() { + try { + factory = XMLInputFactory.newInstance(); + } catch (Exception ex) { + Assert.fail("Could not create XMLInputFactory"); + } + } + + @AfterMethod + protected void tearDown() { + factory = null; + } + + @Test + public void testProperties() { + Assert.assertTrue(factory.isPropertySupported("javax.xml.stream.isReplacingEntityReferences")); + } + + @Test + public void testCharacterReferences() { + try { + URL fileName = EntityTest.class.getResource("testCharRef.xml"); + URL outputFileName = EntityTest.class.getResource("testCharRef.xml.output"); + XMLStreamReader xmlr = factory.createXMLStreamReader(new InputStreamReader(fileName.openStream())); + int eventType = 0; + while (xmlr.hasNext()) { + eventType = xmlr.next(); + handleEvent(xmlr, eventType); + } + System.out.println("Output:"); + System.out.println(output); + Assert.assertTrue(compareOutput(new InputStreamReader(outputFileName.openStream()), new StringReader(output))); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail(ex.getMessage()); + } + } + + private void handleEvent(XMLStreamReader xmlr, int eventType) { + switch (eventType) { + case XMLEvent.START_ELEMENT: + handleStartElement(xmlr); + break; + case XMLEvent.END_ELEMENT: + handleEndElement(xmlr); + break; + case XMLEvent.CHARACTERS: + handleCharacters(xmlr); + break; + case XMLEvent.COMMENT: + handleComment(xmlr); + break; + case XMLEvent.ENTITY_REFERENCE: + break; + case XMLEvent.ATTRIBUTE: + break; + case XMLEvent.DTD: + break; + case XMLEvent.CDATA: + break; + default: + break; + } + } + + private void handleStartElement(XMLStreamReader xmlr) { + output += "<"; + output += xmlr.getLocalName(); + if (xmlr.hasText()) + output += xmlr.getText(); + printAttributes(xmlr); + output += ">"; + } + + private void handleEndElement(XMLStreamReader xmlr) { + output += "</"; + output += xmlr.getLocalName(); + output += ">"; + } + + private void handleComment(XMLStreamReader xmlr) { + if (xmlr.hasText()) + output += xmlr.getText(); + } + + private void handleCharacters(XMLStreamReader xmlr) { + if (xmlr.hasText()) + output += xmlr.getText(); + } + + private void printAttributes(XMLStreamReader xmlr) { + if (xmlr.getAttributeCount() > 0) { + int count = xmlr.getAttributeCount(); + for (int i = 0; i < count; i++) { + output += xmlr.getAttributeName(i); + output += "="; + output += xmlr.getAttributeValue(i); + /* + * String name = xmlr.getAttributeName(i) ; String value = + * xmlr.getAttributeValue(i) ; + * System.out.println(name+"="+value); + */ + } + } + } + + protected boolean compareOutput(Reader expected, Reader actual) throws IOException { + LineNumberReader expectedOutput = new LineNumberReader(expected); + LineNumberReader actualOutput = new LineNumberReader(actual); + + while (expectedOutput.ready() && actualOutput.ready()) { + String expectedLine = expectedOutput.readLine(); + String actualLine = actualOutput.readLine(); + if (!expectedLine.equals(actualLine)) { + System.out.println("Entityreference expansion failed, line no: " + expectedOutput.getLineNumber()); + System.out.println("Expected: " + expectedLine); + System.out.println("Actual : " + actualLine); + return false; + } + } + expectedOutput.close(); + actualOutput.close(); + return true; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/EntitiesTest/testCharRef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/EntitiesTest/testCharRef.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding='UTF-8'?> +<!DOCTYPE juicers [ +<!ENTITY ch1 "T"> +]> +<juicers> + +<reftest>TES&ch1;CHARREF</reftest> + +</juicers> diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/EntitiesTest/testCharRef.xml.output --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/EntitiesTest/testCharRef.xml.output Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,5 @@ +<juicers> + +<reftest>TESTCHARREF</reftest> + +</juicers> diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/EventReaderDelegateTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/EventReaderDelegateTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import org.testng.annotations.Test; +import org.testng.Assert; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + +import javax.xml.stream.events.XMLEvent; +import javax.xml.stream.util.EventReaderDelegate; + +/* + * @summary Test EventReaderDelegate. + */ +public class EventReaderDelegateTest { + + public EventReaderDelegateTest(String name) { + } + + @Test + public void testGetElementText() { + try { + XMLInputFactory ifac = XMLInputFactory.newFactory(); + XMLEventReader reader = ifac.createXMLEventReader(new FileInputStream(new File(getClass().getResource("toys.xml").getFile()))); + EventReaderDelegate delegate = new EventReaderDelegate(reader); + while (delegate.hasNext()) { + XMLEvent event = (XMLEvent) delegate.next(); + switch (event.getEventType()) { + case XMLStreamConstants.START_ELEMENT: { + String name = event.asStartElement().getName().toString(); + if (name.equals("name") || name.equals("price")) { + System.out.println(delegate.getElementText()); + } else { + try { + delegate.getElementText(); + } catch (XMLStreamException e) { + System.out.println("Expected XMLStreamException in getElementText()"); + } + } + + } + } + } + delegate.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("FileNotFoundException in testGetElementText()"); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testGetElementText()"); + } catch (FactoryConfigurationError e) { + e.printStackTrace(); + Assert.fail("FactoryConfigurationError in testGetElementText()"); + } + + } + + @Test + public void testRemove() { + try { + XMLInputFactory ifac = XMLInputFactory.newFactory(); + XMLEventReader reader = ifac.createXMLEventReader(new FileInputStream(new File(getClass().getResource("toys.xml").getFile()))); + EventReaderDelegate delegate = new EventReaderDelegate(reader); + delegate.remove(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("FileNotFoundException in testRemove()"); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testRemove()"); + } catch (FactoryConfigurationError e) { + e.printStackTrace(); + Assert.fail("FactoryConfigurationError in testRemove()"); + } catch (UnsupportedOperationException e) { + System.out.println("Expected exception in remove()"); + } + + } + + @Test + public void testPeek() { + try { + XMLInputFactory ifac = XMLInputFactory.newFactory(); + XMLEventReader reader = ifac.createXMLEventReader(new FileInputStream(new File(getClass().getResource("toys.xml").getFile()))); + EventReaderDelegate delegate = new EventReaderDelegate(); + delegate.setParent(reader); + while (delegate.hasNext()) { + XMLEvent peekevent = delegate.peek(); + XMLEvent event = (XMLEvent) delegate.next(); + if (peekevent != event) { + Assert.fail("peek() does not return same XMLEvent with next()"); + } + } + delegate.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("FileNotFoundException in testPeek()"); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testPeek()"); + } catch (FactoryConfigurationError e) { + e.printStackTrace(); + Assert.fail("FactoryConfigurationError in testPeek()"); + } + } + + @Test + public void testNextTag() { + try { + XMLInputFactory ifac = XMLInputFactory.newFactory(); + ifac.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE); + XMLEventReader reader = ifac.createXMLEventReader(new FileInputStream(new File(getClass().getResource("toys.xml").getFile()))); + EventReaderDelegate delegate = new EventReaderDelegate(reader); + if ((Boolean) (delegate.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)) != Boolean.FALSE) { + Assert.fail("getProperty() does not return correct value"); + } + while (delegate.hasNext()) { + XMLEvent event = delegate.peek(); + if (event.isEndElement() || event.isStartElement()) { + XMLEvent nextevent = delegate.nextTag(); + if (!(nextevent.getEventType() == XMLStreamConstants.START_ELEMENT || nextevent.getEventType() == XMLStreamConstants.END_ELEMENT)) { + Assert.fail("nextTag() does not return correct event type"); + } + } else { + delegate.next(); + } + } + delegate.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("FileNotFoundException in testNextTag()"); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testNextTag()"); + } catch (FactoryConfigurationError e) { + e.printStackTrace(); + Assert.fail("FactoryConfigurationError in testNextTag()"); + } + } + + @Test + public void testNextEvent() { + try { + XMLInputFactory ifac = XMLInputFactory.newFactory(); + ifac.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE); + XMLEventReader reader = ifac.createXMLEventReader(new FileInputStream(new File(getClass().getResource("toys.xml").getFile()))); + EventReaderDelegate delegate = new EventReaderDelegate(); + delegate.setParent(reader); + if ((Boolean) (delegate.getParent().getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)) != Boolean.FALSE) { + Assert.fail("XMLEventReader.getProperty() does not return correct value"); + } + if ((Boolean) (delegate.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)) != Boolean.FALSE) { + Assert.fail("EventReaderDelegate.getProperty() does not return correct value"); + } + while (delegate.hasNext()) { + XMLEvent event = delegate.nextEvent(); + switch (event.getEventType()) { + case XMLStreamConstants.START_ELEMENT: { + System.out.println(event.asStartElement().getName()); + break; + } + case XMLStreamConstants.END_ELEMENT: { + System.out.println(event.asEndElement().getName()); + break; + } + case XMLStreamConstants.END_DOCUMENT: { + System.out.println(event.isEndDocument()); + break; + } + case XMLStreamConstants.START_DOCUMENT: { + System.out.println(event.isStartDocument()); + break; + } + case XMLStreamConstants.CHARACTERS: { + System.out.println(event.asCharacters().getData()); + break; + } + case XMLStreamConstants.COMMENT: { + System.out.println(event.toString()); + break; + } + } + + } + delegate.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("FileNotFoundException in testNextEvent()"); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testNextEvent()"); + } catch (FactoryConfigurationError e) { + e.printStackTrace(); + Assert.fail("FactoryConfigurationError in testNextEvent()"); + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Events/Issue41Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Events/Issue41Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.Events; + +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Iterator; +import java.util.List; + +import javax.xml.namespace.QName; +import javax.xml.stream.XMLEventFactory; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.Attribute; +import javax.xml.stream.events.Characters; +import javax.xml.stream.events.Comment; +import javax.xml.stream.events.DTD; +import javax.xml.stream.events.EndDocument; +import javax.xml.stream.events.EndElement; +import javax.xml.stream.events.Namespace; +import javax.xml.stream.events.ProcessingInstruction; +import javax.xml.stream.events.StartDocument; +import javax.xml.stream.events.StartElement; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6631268 + * @summary Test XMLEvent.writeAsEncodedUnicode can output the event content. + */ +public class Issue41Test { + + public java.io.File input; + public final String filesDir = "./"; + protected XMLInputFactory inputFactory; + protected XMLOutputFactory outputFactory; + + @Test + public void testEvents() { + XMLEventFactory f = XMLEventFactory.newInstance(); + final String contents = "test <some> text & more! [[]] --"; + final String prefix = "prefix"; + final String uri = "http://foo"; + final String localName = "elem"; + + try { + StartDocument sd = f.createStartDocument(); + writeAsEncodedUnicode(sd); + + Comment c = f.createComment("some comments"); + writeAsEncodedUnicode(c); + + StartElement se = f.createStartElement(prefix, uri, localName); + + ProcessingInstruction pi = f.createProcessingInstruction("target", "data"); + writeAsEncodedUnicode(pi); + + Namespace ns = f.createNamespace(prefix, uri); + writeAsEncodedUnicode(ns); + + Characters characters = f.createCharacters(contents); + writeAsEncodedUnicode(characters); + // CData + Characters cdata = f.createCData(contents); + writeAsEncodedUnicode(cdata); + + // Attribute + QName attrName = new QName("http://test.com", "attr", "ns"); + Attribute attr = f.createAttribute(attrName, "value"); + writeAsEncodedUnicode(attr); + + // prefix, uri, localName + EndElement ee = f.createEndElement(prefix, uri, localName); + writeAsEncodedUnicode(ee); + + EndDocument ed = f.createEndDocument(); + writeAsEncodedUnicode(ed); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + } + + /** + * DTDEvent instances constructed via event reader are missing the notation + * and entity declaration information + */ + @Test + public void testDTDEvent() { + String XML = "<?xml version='1.0' ?>" + "<!DOCTYPE root [\n" + "<!ENTITY intEnt 'internal'>\n" + "<!ENTITY extParsedEnt SYSTEM 'url:dummy'>\n" + + "<!NOTATION notation PUBLIC 'notation-public-id'>\n" + "<!NOTATION notation2 SYSTEM 'url:dummy'>\n" + + "<!ENTITY extUnparsedEnt SYSTEM 'url:dummy2' NDATA notation>\n" + "]>" + "<root />"; + + try { + XMLEventReader er = getReader(XML); + XMLEvent evt = er.nextEvent(); // StartDocument + evt = er.nextEvent(); // DTD + if (evt.getEventType() != XMLStreamConstants.DTD) { + Assert.fail("Expected DTD event"); + } + DTD dtd = (DTD) evt; + writeAsEncodedUnicode(dtd); + List entities = dtd.getEntities(); + if (entities == null) { + Assert.fail("No entity found. Expected 3."); + } else { + writeAsEncodedUnicode((XMLEvent) entities.get(0)); + writeAsEncodedUnicode((XMLEvent) entities.get(1)); + writeAsEncodedUnicode((XMLEvent) entities.get(2)); + } + + List notations = dtd.getNotations(); + if (notations == null) { + Assert.fail("No notation found. Expected 2."); + } else { + writeAsEncodedUnicode((XMLEvent) notations.get(0)); + writeAsEncodedUnicode((XMLEvent) notations.get(1)); + } + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + private XMLEventReader getReader(String XML) throws Exception { + inputFactory = XMLInputFactory.newInstance(); + + // Check if event reader returns the correct event + XMLEventReader er = inputFactory.createXMLEventReader(new StringReader(XML)); + return er; + } + + + + /** + * The return of XMLEvent writeAsEncodedUnicode method is not defined This + * method merely tests that the output exists + */ + public void writeAsEncodedUnicode(XMLEvent evt) throws XMLStreamException { + if (evt.getEventType() == XMLStreamConstants.END_DOCUMENT) { + return; + } + StringWriter sw = new StringWriter(); + evt.writeAsEncodedUnicode(sw); + + Assert.assertTrue(sw.toString().length() > 0); + System.out.println(sw.toString()); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Events/Issue48Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Events/Issue48Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.Events; + +import java.io.StringReader; +import java.util.Iterator; +import java.util.List; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.events.DTD; +import javax.xml.stream.events.EntityDeclaration; +import javax.xml.stream.events.NotationDeclaration; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6620632 + * @summary Test XMLEventReader can parse notation and entity information from DTD Event. + */ +public class Issue48Test { + + public java.io.File input; + public final String filesDir = "./"; + protected XMLInputFactory inputFactory; + protected XMLOutputFactory outputFactory; + + /** + * DTDEvent instances constructed via event reader are missing the notation + * and entity declaration information + */ + @Test + public void testDTDEvent() { + String XML = "<?xml version='1.0' ?>" + "<!DOCTYPE root [\n" + "<!ENTITY intEnt 'internal'>\n" + "<!ENTITY extParsedEnt SYSTEM 'url:dummy'>\n" + + "<!NOTATION notation PUBLIC 'notation-public-id'>\n" + "<!NOTATION notation2 SYSTEM 'url:dummy'>\n" + + "<!ENTITY extUnparsedEnt SYSTEM 'url:dummy2' NDATA notation>\n" + "]>" + "<root />"; + + try { + XMLEventReader er = getReader(XML); + XMLEvent evt = er.nextEvent(); // StartDocument + evt = er.nextEvent(); // DTD + if (evt.getEventType() != XMLStreamConstants.DTD) { + Assert.fail("Expected DTD event"); + } + DTD dtd = (DTD) evt; + List entities = dtd.getEntities(); + if (entities == null) { + Assert.fail("No entity found. Expected 3."); + } else { + Assert.assertEquals(entities.size(), 3); + } + // Let's also verify they are all of right type... + testListElems(entities, EntityDeclaration.class); + + List notations = dtd.getNotations(); + if (notations == null) { + Assert.fail("No notation found. Expected 2."); + } else { + Assert.assertEquals(notations.size(), 2); + } + // Let's also verify they are all of right type... + testListElems(notations, NotationDeclaration.class); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + private XMLEventReader getReader(String XML) throws Exception { + inputFactory = XMLInputFactory.newInstance(); + + // Check if event reader returns the correct event + XMLEventReader er = inputFactory.createXMLEventReader(new StringReader(XML)); + return er; + } + + + private void testListElems(List l, Class expType) { + Iterator it = l.iterator(); + while (it.hasNext()) { + Object o = it.next(); + Assert.assertNotNull(o); + Assert.assertTrue(expType.isAssignableFrom(o.getClass())); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Events/Issue53Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Events/Issue53Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.Events; + +import javax.xml.stream.XMLEventFactory; +import javax.xml.stream.events.StartDocument; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test encodingSet/standaloneSet returns correct result in case encoding/standalone is set when constructing StartDocument. + */ +public class Issue53Test { + + @Test + public void testEncodingSet() { + XMLEventFactory f = XMLEventFactory.newInstance(); + + try { + StartDocument sd = f.createStartDocument("UTF-8"); + System.out.println("Encoding: " + sd.getCharacterEncodingScheme()); + System.out.println("Encoding set: " + sd.encodingSet()); + Assert.assertTrue(sd.encodingSet(), "encoding is set, should return true."); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + } + + @Test + public void testStandaloneSet() { + XMLEventFactory f = XMLEventFactory.newInstance(); + + try { + StartDocument sd = f.createStartDocument("UTF-8", "1.0", true); + System.out.println(sd.isStandalone()); + System.out.println(sd.standaloneSet()); + Assert.assertTrue(sd.standaloneSet(), "standalone is set, should return true."); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Events/Issue58Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/Events/Issue58Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.Events; + +import java.io.StringReader; + +import javax.xml.stream.Location; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLEvent.getLocation() returns a non-volatile Location. + */ +public class Issue58Test { + + public java.io.File input; + public final String filesDir = "./"; + protected XMLInputFactory inputFactory; + protected XMLOutputFactory outputFactory; + + @Test + public void testLocation() { + String XML = "<?xml version='1.0' ?>" + "<!DOCTYPE root [\n" + "<!ENTITY intEnt 'internal'>\n" + "<!ENTITY extParsedEnt SYSTEM 'url:dummy'>\n" + + "<!NOTATION notation PUBLIC 'notation-public-id'>\n" + "<!NOTATION notation2 SYSTEM 'url:dummy'>\n" + + "<!ENTITY extUnparsedEnt SYSTEM 'url:dummy2' NDATA notation>\n" + "]>\n" + "<root />"; + + try { + XMLEventReader er = getReader(XML); + XMLEvent evt = er.nextEvent(); // StartDocument + Location loc1 = evt.getLocation(); + System.out.println("Location 1: " + loc1.getLineNumber() + "," + loc1.getColumnNumber()); + evt = er.nextEvent(); // DTD + // loc1 should not change so its line number should still be 1 + Assert.assertTrue(loc1.getLineNumber() == 1); + Location loc2 = evt.getLocation(); + System.out.println("Location 2: " + loc2.getLineNumber() + "," + loc2.getColumnNumber()); + evt = er.nextEvent(); // root + System.out.println("Location 1: " + loc1.getLineNumber() + "," + loc1.getColumnNumber()); + Assert.assertTrue(loc1.getLineNumber() == 1); + Assert.assertTrue(loc2.getLineNumber() == 7); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + private XMLEventReader getReader(String XML) throws Exception { + inputFactory = XMLInputFactory.newInstance(); + + // Check if event reader returns the correct event + XMLEventReader er = inputFactory.createXMLEventReader(new StringReader(XML)); + return er; + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/FactoryFindTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/FactoryFindTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Properties; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/* + * @summary Test SaTX factory using factory property and using ContextClassLoader. + */ +public class FactoryFindTest { + + boolean myClassLoaderUsed = false; + + final static String FACTORY_KEY = "javax.xml.stream.XMLInputFactory"; + + @BeforeClass + public void setup(){ + policy.PolicyUtil.changePolicy(getClass().getResource("FactoryFindTest.policy").getFile()); + } + + @Test + public void testFactoryFindUsingStaxProperties() { + // If property is defined, will take precendence so this test + // is ignored :( + if (System.getProperty(FACTORY_KEY) != null) { + return; + } + + Properties props = new Properties(); + String configFile = System.getProperty("java.home") + File.separator + "lib" + File.separator + "stax.properties"; + + File f = new File(configFile); + if (f.exists()) { + try { + FileInputStream fis = new FileInputStream(f); + props.load(fis); + fis.close(); + } catch (FileNotFoundException e) { + return; + } catch (IOException e) { + return; + } + } else { + props.setProperty(FACTORY_KEY, "com.sun.xml.internal.stream.XMLInputFactoryImpl"); + try { + FileOutputStream fos = new FileOutputStream(f); + props.store(fos, null); + fos.close(); + f.deleteOnExit(); + } catch (FileNotFoundException e) { + return; + } catch (IOException e) { + return; + } + } + + XMLInputFactory factory = XMLInputFactory.newInstance(); + Assert.assertTrue(factory.getClass().getName().equals(props.getProperty(FACTORY_KEY))); + } + + @Test + public void testFactoryFind() { + try { + // System.setProperty("jaxp.debug", "true"); + + XMLInputFactory factory = XMLInputFactory.newInstance(); + Assert.assertTrue(factory.getClass().getClassLoader() == null); + + Thread.currentThread().setContextClassLoader(null); + factory = XMLInputFactory.newInstance(); + Assert.assertTrue(factory.getClass().getClassLoader() == null); + + Thread.currentThread().setContextClassLoader(new MyClassLoader()); + factory = XMLInputFactory.newInstance(); + if (System.getSecurityManager() == null) + Assert.assertTrue(myClassLoaderUsed); + else + Assert.assertFalse(myClassLoaderUsed); + + XMLOutputFactory ofactory = XMLOutputFactory.newInstance(); + Assert.assertTrue(ofactory.getClass().getClassLoader() == null); + + Thread.currentThread().setContextClassLoader(null); + ofactory = XMLOutputFactory.newInstance(); + Assert.assertTrue(ofactory.getClass().getClassLoader() == null); + + Thread.currentThread().setContextClassLoader(new MyClassLoader()); + ofactory = XMLOutputFactory.newInstance(); + if (System.getSecurityManager() == null) + Assert.assertTrue(myClassLoaderUsed); + else + Assert.assertFalse(myClassLoaderUsed); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + class MyClassLoader extends URLClassLoader { + + public MyClassLoader() { + super(new URL[0]); + } + + public Class loadClass(String name) throws ClassNotFoundException { + myClassLoaderUsed = true; + return super.loadClass(name); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/FactoryFindTest.policy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/FactoryFindTest.policy Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,23 @@ +grant { + permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; + permission java.lang.RuntimePermission "accessDeclaredMembers"; + + permission java.io.FilePermission "${test.classes}/../../-", "read, write, delete"; + permission java.io.FilePermission ".", "read, write, delete"; + permission java.util.PropertyPermission "*", "read, write"; + + permission java.lang.RuntimePermission "setSecurityManager"; + permission java.lang.RuntimePermission "createSecurityManager"; + permission java.lang.RuntimePermission "createClassLoader"; + permission java.lang.RuntimePermission "setIO"; + permission java.lang.RuntimePermission "setContextClassLoader"; + permission java.security.SecurityPermission "getPolicy"; + + permission java.io.FilePermission "${test.src}/-", "read, write, delete"; + permission java.io.FilePermission "${user.dir}/-", "read, write, delete"; + permission java.io.FilePermission "${java.io.tmpdir}/-", "read, write, delete"; + + + permission java.io.FilePermission "${java.home}/lib/stax.properties", "read, write, delete"; + +}; diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/IgnoreExternalDTDTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/IgnoreExternalDTDTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import java.io.StringReader; + +import org.testng.annotations.Test; + +/* + * @summary Test feature ignore-external-dtd. + */ +public class IgnoreExternalDTDTest { + + final static String FACTORY_KEY = "javax.xml.stream.XMLInputFactory"; + static final String IGNORE_EXTERNAL_DTD = "ignore-external-dtd"; + static final String ZEPHYR_PROPERTY_PREFIX = "http://java.sun.com/xml/stream/properties/"; + + @Test + public void testFeaturePositive() throws Exception { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(ZEPHYR_PROPERTY_PREFIX + IGNORE_EXTERNAL_DTD, Boolean.TRUE); + parse(xif); + } + + @Test + public void testFeatureNegative() throws Exception { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(ZEPHYR_PROPERTY_PREFIX + IGNORE_EXTERNAL_DTD, Boolean.FALSE); + try { + parse(xif); + // refer to 6440324, absent of that change, an exception would be + // thrown; + // due to the change made for 6440324, parsing will continue without + // exception + // fail(); + } catch (XMLStreamException e) { + // the error is expected that no DTD was found + } + } + + private void parse(XMLInputFactory xif) throws XMLStreamException { + XMLStreamReader xsr = xif.createXMLStreamReader(new StringReader("<?xml version='1.0'?><!DOCTYPE root PUBLIC 'abc' 'def'><abc />")); + while (xsr.next() != XMLStreamConstants.END_DOCUMENT) + ; + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/ProcessingInstruction/ProcessingInstructionTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/ProcessingInstruction/ProcessingInstructionTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.ProcessingInstruction; + +import java.io.InputStream; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLStreamReader parses Processing Instruction. + */ +public class ProcessingInstructionTest { + + @Test + public void testPITargetAndData() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + String PITarget = "soffice"; + String PIData = "WebservicesArchitecture"; + String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<?" + PITarget + " " + PIData + "?>" + "<foo></foo>"; + // System.out.println("XML = " + xml) ; + InputStream is = new java.io.ByteArrayInputStream(xml.getBytes()); + XMLStreamReader sr = xif.createXMLStreamReader(is); + while (sr.hasNext()) { + int eventType = sr.next(); + if (eventType == XMLStreamConstants.PROCESSING_INSTRUCTION) { + String target = sr.getPITarget(); + String data = sr.getPIData(); + Assert.assertTrue(target.equals(PITarget) && data.equals(PIData)); + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/StreamReaderDelegateTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/StreamReaderDelegateTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,374 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.Iterator; + +import javax.xml.namespace.NamespaceContext; +import javax.xml.stream.util.StreamReaderDelegate; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test StreamReaderDelegate. + */ +public class StreamReaderDelegateTest { + + /** + * Tested xml file looks as below: <?xml version="1.0" standalone="no" ?> + * <ns1:foo attr1="defaultAttr1" ns1:attr1="ns1Attr1" ns2:attr1="ns2Attr1" + * attr2="defaultAttr2" attr3="defaultAttr3" xmlns:ns1="http://ns1.java.com" + * xmlns:ns2="http://ns2.java.com"> <!--description--> content text + * <![CDATA[<greeting>Hello</greeting>]]> other content </ns1:foo> + **/ + @Test + public void testAttribute() { + StreamReaderDelegate delegate = null; + try { + System.out.println("===in testAttribute()==="); + XMLInputFactory ifac = XMLInputFactory.newFactory(); + XMLStreamReader reader = ifac.createXMLStreamReader(new FileInputStream(new File(getClass().getResource("testfile1.xml").getFile()))); + delegate = new StreamReaderDelegate(reader); + + Assert.assertTrue(delegate.standaloneSet()); + Assert.assertFalse(delegate.isStandalone()); + while (delegate.hasNext()) { + delegate.next(); + if (delegate.getEventType() == XMLStreamConstants.START_ELEMENT || delegate.getEventType() == XMLStreamConstants.ATTRIBUTE) { + if (delegate.getLocalName().equals("foo")) { + Assert.assertTrue(delegate.getAttributeCount() == 5); + Assert.assertTrue(delegate.getAttributeType(1) == "CDATA"); + + Assert.assertTrue(delegate.getAttributeValue(0).equals("defaultAttr1")); + Assert.assertTrue(delegate.getAttributeValue(delegate.getAttributeCount() - 2).equals("defaultAttr2")); + Assert.assertTrue(delegate.getAttributeValue(delegate.getAttributeCount() - 1).equals("defaultAttr3")); + + Assert.assertTrue(delegate.getAttributeValue("http://ns1.java.com", "attr1").equals("ns1Attr1")); + Assert.assertTrue(delegate.getAttributeValue("http://ns2.java.com", "attr1").equals("ns2Attr1")); + + Assert.assertTrue(delegate.getAttributeValue(null, "attr2").equals("defaultAttr2")); + Assert.assertTrue(delegate.getAttributeValue(null, "attr3").equals("defaultAttr3")); + + Assert.assertTrue(delegate.getAttributeNamespace(0) == null); + Assert.assertTrue(delegate.getAttributeNamespace(1).equals("http://ns1.java.com")); + Assert.assertTrue(delegate.getAttributePrefix(1).equals("ns1")); + Assert.assertTrue(delegate.getAttributeName(1).toString() + .equals("{" + delegate.getAttributeNamespace(1) + "}" + delegate.getAttributeLocalName(1))); + Assert.assertTrue(delegate.getAttributeLocalName(1).equals("attr1")); + + // negative test. Should return null for out of + // attribute array index + Assert.assertTrue(delegate.getAttributeNamespace(delegate.getAttributeCount()) == null); + Assert.assertTrue(delegate.getAttributePrefix(delegate.getAttributeCount()) == null); + Assert.assertTrue(delegate.getAttributeName(delegate.getAttributeCount()) == null); + Assert.assertTrue(delegate.getAttributeLocalName(delegate.getAttributeCount()) == null); + Assert.assertTrue(delegate.getAttributeType(delegate.getAttributeCount()) == null); + } + } else { + try { + delegate.getAttributeCount(); + } catch (IllegalStateException e) { + System.out.println("expected exception for incorrect event type"); + } + } + + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("FileNotFoundException in testAttribute()"); + } catch (XMLStreamException e) { + e.printStackTrace(); + System.out.println(delegate.getLocation()); + Assert.fail("XMLStreamException in testAttribute()"); + } catch (FactoryConfigurationError e) { + e.printStackTrace(); + Assert.fail("FactoryConfigurationError in testAttribute()"); + } finally { + try { + delegate.close(); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testAttribute()"); + } + } + } + + /** + * Tested xml file looks as below: <?xml version="1.0" encoding="UTF-8"?> + * <ns1:foo xmlns:ns="http://ns1.java.com" xmlns:ns1="http://ns1.java.com" + * xmlns:ns2="http://ns2.java.com" > <!--description-->content text + * <![CDATA[<greeting>Hello</greeting>]]> other content </ns1:foo> + **/ + @Test + public void testNamespace() { + StreamReaderDelegate delegate = null; + try { + System.out.println("===in testNamespace()==="); + XMLStreamReader reader = XMLInputFactory.newFactory().createXMLStreamReader( + new FileInputStream(new File(getClass().getResource("testfile2.xml").getFile()))); + delegate = new StreamReaderDelegate(); + delegate.setParent(reader); + while (delegate.hasNext()) { + delegate.next(); + if (delegate.getEventType() == XMLStreamConstants.START_ELEMENT || delegate.getEventType() == XMLStreamConstants.ATTRIBUTE) { + + if (delegate.getName().getLocalPart().equals("foo")) { + Assert.assertTrue(("{" + delegate.getNamespaceURI(delegate.getPrefix()) + "}" + delegate.getLocalName()).equals(delegate.getName() + .toString())); + System.out.println(delegate.getLocation()); + + Assert.assertTrue(delegate.getNamespaceCount() == 3); + Assert.assertTrue(delegate.getNamespaceURI().equals("http://ns1.java.com")); + Assert.assertTrue(delegate.getNamespaceURI(2).equals("http://ns2.java.com")); + Assert.assertTrue(delegate.getNamespaceURI("ns").equals("http://ns1.java.com")); + + Assert.assertTrue(delegate.getNamespacePrefix(1).equals("ns1")); + + NamespaceContext nsCtx = delegate.getNamespaceContext(); + nsCtx.getNamespaceURI("ns"); + Iterator prefixes = nsCtx.getPrefixes("http://ns1.java.com"); + boolean hasns = false; + boolean hasns1 = false; + while (prefixes.hasNext()) { + String prefix = (String) prefixes.next(); + if (prefix.equals("ns")) { + hasns = true; + } else if (prefix.equals("ns1")) { + hasns1 = true; + } + } + Assert.assertTrue(hasns && hasns1); + } + } + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("FileNotFoundException in testNamespace()"); + } catch (XMLStreamException e) { + e.printStackTrace(); + System.out.println(delegate.getLocation()); + Assert.fail("XMLStreamException in testNamespace()"); + } catch (FactoryConfigurationError e) { + e.printStackTrace(); + Assert.fail("FactoryConfigurationError in testNamespace()"); + } finally { + try { + delegate.close(); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testNamespace()"); + } + } + } + + /** + * <?xml version="1.0" encoding="utf-8" ?> <ns1:foo + * xmlns:ns1="http://ns1.java.com" xmlns:ns2="http://ns2.java.com"> + * <!--description--> content text <![CDATA[<greeting>Hello</greeting>]]> + * other content </ns1:foo> + **/ + @Test + public void testText() { + String property = "javax.xml.stream.isCoalescing"; + System.out.println("===in testText()===="); + StreamReaderDelegate delegate = null; + try { + XMLInputFactory ifac = XMLInputFactory.newFactory(); + ifac.setProperty(property, Boolean.TRUE); + XMLStreamReader reader = ifac.createXMLStreamReader(new FileInputStream(new File(getClass().getResource("testfile3.xml").getFile())), "iso8859-1"); + delegate = new StreamReaderDelegate(); + delegate.setParent(reader); + + Assert.assertTrue(delegate.getParent().equals(reader)); + Assert.assertTrue(delegate.getProperty(property).equals(Boolean.TRUE)); + Assert.assertTrue(delegate.getCharacterEncodingScheme().equalsIgnoreCase("utf-8")); + Assert.assertTrue(delegate.getEncoding().equalsIgnoreCase("iso8859-1")); + Assert.assertTrue(delegate.getVersion().equals("1.0")); + while (delegate.hasNext()) { + delegate.next(); + if (delegate.getEventType() == XMLStreamConstants.CHARACTERS) { + char[] target1 = new char[delegate.getTextLength()]; + delegate.getTextCharacters(delegate.getTextStart(), target1, 0, target1.length); + char[] target2 = delegate.getTextCharacters(); + + Assert.assertTrue(delegate.getText().trim().equals(new String(target1).trim())); + Assert.assertTrue(delegate.getText().trim().equals(new String(target2).trim())); + } + } + + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("FileNotFoundException in testText()"); + } catch (XMLStreamException e) { + e.printStackTrace(); + System.out.println(delegate.getLocation()); + Assert.fail("XMLStreamException in testText()"); + } catch (FactoryConfigurationError e) { + e.printStackTrace(); + Assert.fail("FactoryConfigurationError in testText()"); + } finally { + try { + delegate.close(); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testText()"); + } + } + } + + @Test + public void testWhiteSpace() { + System.out.println("===in testWhiteSpace()==="); + StreamReaderDelegate delegate = null; + try { + XMLInputFactory ifac = XMLInputFactory.newFactory(); + ifac.setProperty("javax.xml.stream.isCoalescing", Boolean.TRUE); + XMLStreamReader reader = ifac.createXMLStreamReader(new FileInputStream(new File(getClass().getResource("testfile4.xml").getFile()))); + + delegate = new StreamReaderDelegate(); + delegate.setParent(reader); + while (delegate.hasNext()) { + int i = delegate.next(); + switch (i) { + case XMLStreamConstants.CHARACTERS: { + Assert.assertTrue(delegate.isCharacters()); + Assert.assertTrue(delegate.hasText()); + Assert.assertTrue(delegate.isWhiteSpace()); + break; + } + case XMLStreamConstants.START_ELEMENT: { + Assert.assertTrue(delegate.isStartElement()); + Assert.assertTrue(delegate.isAttributeSpecified(0)); + Assert.assertTrue(delegate.hasName()); + delegate.require(XMLStreamConstants.START_ELEMENT, delegate.getNamespaceURI(), delegate.getLocalName()); + break; + } + case XMLStreamConstants.END_ELEMENT: { + Assert.assertTrue(delegate.isEndElement()); + Assert.assertTrue(delegate.hasName()); + delegate.require(XMLStreamConstants.END_ELEMENT, delegate.getNamespaceURI(), delegate.getLocalName()); + break; + } + } + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("FileNotFoundException in testWhiteSpace()"); + } catch (XMLStreamException e) { + e.printStackTrace(); + System.out.println(delegate.getLocation()); + Assert.fail("XMLStreamException in testWhiteSpace()"); + } catch (FactoryConfigurationError e) { + e.printStackTrace(); + Assert.fail("FactoryConfigurationError in testWhiteSpace()"); + } finally { + try { + delegate.close(); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testWhitespace()"); + } + } + + } + + @Test + public void testElementText() { + System.out.println("===in testElementText()==="); + StreamReaderDelegate delegate = null; + try { + XMLInputFactory ifac = XMLInputFactory.newFactory(); + XMLStreamReader reader = ifac.createXMLStreamReader(new FileInputStream(new File(getClass().getResource("toys.xml").getFile()))); + + delegate = new StreamReaderDelegate(); + delegate.setParent(reader); + while (delegate.hasNext()) { + if (delegate.getEventType() == XMLStreamConstants.START_ELEMENT) { + if (delegate.getLocalName().equals("name") || delegate.getLocalName().equals("price")) { + System.out.println(delegate.getElementText()); + } + delegate.nextTag(); + } else { + delegate.next(); + } + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("FileNotFoundException in testElementText()"); + } catch (XMLStreamException e) { + e.printStackTrace(); + System.out.println(delegate.getLocation()); + Assert.fail("XMLStreamException in testElementText()"); + } catch (FactoryConfigurationError e) { + e.printStackTrace(); + Assert.fail("FactoryConfigurationError in testElementText()"); + } finally { + try { + delegate.close(); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testElementText()"); + } + } + } + + @Test + public void testPITargetAndData() { + System.out.println("===in testPITargetAndData()==="); + StreamReaderDelegate delegate = null; + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + String PITarget = "soffice"; + String PIData = "WebservicesArchitecture"; + String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<?" + PITarget + " " + PIData + "?>" + "<foo></foo>"; + InputStream is = new java.io.ByteArrayInputStream(xml.getBytes()); + XMLStreamReader sr = xif.createXMLStreamReader(is); + delegate = new StreamReaderDelegate(sr); + while (delegate.hasNext()) { + int eventType = delegate.next(); + if (eventType == XMLStreamConstants.PROCESSING_INSTRUCTION) { + String target = delegate.getPITarget(); + String data = delegate.getPIData(); + Assert.assertTrue(target.equals(PITarget)); + Assert.assertTrue(data.equals(PIData)); + } + } + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail("Exception in testPITargetAndData()"); + } finally { + try { + delegate.close(); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("XMLStreamException in testPITargetAndData()"); + } + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventLocationTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventLocationTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream; + +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLEvent Location. + */ +public class XMLEventLocationTest { + + @Test + public void testNonNullLocation() { + XMLEventFactory factory = XMLEventFactory.newInstance(); + XMLEvent event = factory.createComment("some comment"); + Assert.assertNotNull(event.getLocation()); + } + + @Test + public void testSetLocation() { + XMLEventFactory factory = XMLEventFactory.newInstance(); + Location loc = new MyLocation(); + factory.setLocation(loc); + XMLEvent event = factory.createComment("some comment"); + Assert.assertEquals(event.getLocation().getLineNumber(), 15); + } + + class MyLocation implements Location { + public MyLocation() { + } + + public int getCharacterOffset() { + return 5; + } + + public int getColumnNumber() { + return 10; + } + + public int getLineNumber() { + return 15; + } + + public String getPublicId() { + return "-//My//DTD Public Id//EN"; + } + + public String getSystemId() { + return "http://example.org/system/id"; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6489890.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6489890.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLEventReaderTest; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6489890 + * @summary Test XMLEventReader's initial state is an undefined state, and nextEvent() is START_DOCUMENT. + */ +public class Bug6489890 { + + @Test + public void test0() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + + XMLStreamReader xsr = xif.createXMLStreamReader(getClass().getResource("sgml.xml").toString(), getClass().getResourceAsStream("sgml.xml")); + + XMLEventReader xer = xif.createXMLEventReader(xsr); + + Assert.assertTrue(xer.peek().getEventType() == XMLEvent.START_DOCUMENT); + Assert.assertTrue(xer.peek() == xer.nextEvent()); + xsr.close(); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + @Test + public void test1() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + + XMLStreamReader xsr = xif.createXMLStreamReader(getClass().getResource("sgml.xml").toString(), getClass().getResourceAsStream("sgml.xml")); + + XMLEventReader xer = xif.createXMLEventReader(xsr); + + Assert.assertTrue(xer.nextEvent().getEventType() == XMLEvent.START_DOCUMENT); + xsr.close(); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6555001.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6555001.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package javax.xml.stream.XMLEventReaderTest; + +import java.io.StringReader; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.events.EntityReference; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6555001 + * @summary Test StAX parser replaces the entity reference as setting. + */ +public class Bug6555001 { + private static final String XML = "" + "<!DOCTYPE doc SYSTEM 'file:///tmp/this/does/not/exist/but/that/is/ok' [" + "<!ENTITY def '<para/>'>" + "]>" + + "<doc>&def;&undef;</doc>"; + + @Test + public void testReplacing() throws Exception { + XMLInputFactory factory = XMLInputFactory.newInstance(); + factory.setProperty("javax.xml.stream.isReplacingEntityReferences", true); + + StringReader sr = new StringReader(XML); + XMLEventReader reader = factory.createXMLEventReader(sr); + + boolean sawUndef = false; + boolean sawDef = false; + + while (reader.hasNext()) { + XMLEvent event = reader.nextEvent(); + // System.out.println("Event: " + event); + if (event.isEntityReference()) { + EntityReference ref = (EntityReference) event; + if ("def".equals(ref.getName())) { + sawDef = true; + } else if ("undef".equals(ref.getName())) { + sawUndef = true; + } else { + throw new IllegalArgumentException("Unexpected entity name"); + } + } + } + + Assert.assertEquals(false, sawDef); + Assert.assertEquals(true, sawUndef); + reader.close(); + } + + @Test + public void testNotReplacing() throws Exception { + XMLInputFactory factory = XMLInputFactory.newInstance(); + factory.setProperty("javax.xml.stream.isReplacingEntityReferences", false); + + StringReader sr = new StringReader(XML); + XMLEventReader reader = factory.createXMLEventReader(sr); + + boolean sawUndef = false; + boolean sawDef = false; + + while (reader.hasNext()) { + XMLEvent event = reader.nextEvent(); + // System.out.println("Event: " + event); + if (event.isEntityReference()) { + EntityReference ref = (EntityReference) event; + if ("def".equals(ref.getName())) { + sawDef = true; + } else if ("undef".equals(ref.getName())) { + sawUndef = true; + } else { + throw new IllegalArgumentException("Unexpected entity name"); + } + } + } + + Assert.assertEquals(true, sawDef); + Assert.assertEquals(true, sawUndef); + reader.close(); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6586466Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6586466Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLEventReaderTest; + +import org.testng.annotations.Test; +import org.testng.Assert; +import java.io.ByteArrayInputStream; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.XMLEvent; + +/* + * @bug 6586466 + * @summary Test XMLEventReader.nextTag() shall update internal event state. + */ +public class Bug6586466Test { + + @Test + public void test() { + String xmlData = "<?xml version=\"1.0\"?><Test>Hello</Test>"; + try { + XMLEventReader xmlReader = XMLInputFactory.newInstance().createXMLEventReader(new ByteArrayInputStream(xmlData.getBytes())); + + XMLEvent event = xmlReader.nextEvent(); + System.out.println(event.getClass()); + + // xmlReader.peek(); // error in both cases with/without peek() + event = xmlReader.nextTag(); // nextEvent() would work fine + // nextTag() forgets to set fLastEvent + System.out.println(event.getClass()); + + String text = xmlReader.getElementText(); + System.out.println(text); + } catch (XMLStreamException e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6613059Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6613059Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLEventReaderTest; + +import org.testng.annotations.Test; +import org.testng.Assert; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.XMLEvent; + +/* + * @bug 6613059 + * @summary Test XMLEventReader.nextTag() shall update internal event state, same as 6586466. + */ +public class Bug6613059Test { + + @Test + public void test() { + String xmlFile = "bug6613059.xml"; + XMLEventReader xer = null; + XMLInputFactory xif = XMLInputFactory.newInstance(); + try { + xer = xif.createXMLEventReader(xif.createXMLStreamReader(getClass().getResource(xmlFile).getFile(), getClass().getResourceAsStream(xmlFile))); + } catch (XMLStreamException e) { + System.out.println("Error while reading XML: " + e.getClass().getName() + " " + e.getMessage()); + } + + try { + while (xer.hasNext()) { + XMLEvent event = xer.nextTag(); + if (event.isEndElement() && event.asEndElement().getName().equals(new QName("menubar"))) { + break; + } + + if (event.asStartElement().getName().equals(new QName("menu"))) { + // nextTag should be used when processing element-only + // content, assuming "addMenu" in + // the user's code handles the menu part properly + addMenu(xer, event); + } + + } + } catch (XMLStreamException e) { + Assert.fail("Exception while reading " + xmlFile + ": " + e.getClass().getName() + " " + e.getMessage()); + } + } + + void addMenu(XMLEventReader xer, XMLEvent event) throws XMLStreamException { + // user did not submit this part of code, just jump to the end of menu + // element + int eventType = 0; + while (true) { + event = xer.nextEvent(); + // System.out.println("event: " + event); + eventType = event.getEventType(); + if (eventType == XMLStreamConstants.END_ELEMENT && event.asEndElement().getName().equals(new QName("menu"))) { + break; + } + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6668115Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6668115Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLEventReaderTest; + +import java.io.File; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6668115 + * @summary Test XMLEventReader.getElementText() shall update last event even if no peek. + */ +public class Bug6668115Test { + + public java.io.File input; + public final String filesDir = "./"; + protected XMLInputFactory inputFactory; + protected XMLOutputFactory outputFactory; + + /** + * The reason the following call sequence is a problem is that with a + * peekevent, getElementText calls nextEvent which does properly update the + * lastEvent + */ + @Test + public void testNextTag() { + try { + XMLEventReader er = getReader(); + er.nextTag(); + er.nextTag(); + + System.out.println(er.getElementText()); + er.nextTag(); + System.out.println(er.getElementText()); + + } catch (Exception e) { + System.out.println(e.getMessage()); + e.printStackTrace(); + Assert.fail(e.getMessage()); + } + } + + @Test + public void testNextTagWPeek() { + try { + XMLEventReader er = getReader(); + er.nextTag(); + er.nextTag(); + + XMLEvent event = er.peek(); + System.out.println(er.getElementText()); + er.nextTag(); + System.out.println(er.getElementText()); + + } catch (Exception e) { + System.out.println(e.getMessage()); + e.printStackTrace(); + Assert.fail(e.getMessage()); + } + } + + private XMLEventReader getReader() throws Exception { + inputFactory = XMLInputFactory.newInstance(); + input = new File(getClass().getResource("play2.xml").getFile()); + // Check if event reader returns the correct event + XMLEventReader er = inputFactory.createXMLEventReader(inputFactory.createXMLStreamReader(new java.io.FileInputStream(input), "UTF-8")); + return er; + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6846133Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Bug6846133Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLEventReaderTest; + +import javax.xml.stream.XMLStreamException; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6846133 + * @summary Test method getDocumentTypeDeclaration() of DTD Event returns a valid value. + */ +public class Bug6846133Test { + private static final String xml = "<!DOCTYPE html PUBLIC \"-//W3C//DTDXHTML 1.0 Transitional//EN\" " + + "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" + "<html><body><p>I am some simple html</p></body> </html>"; + + @Test + public void test() { + try { + javax.xml.stream.XMLInputFactory factory = javax.xml.stream.XMLInputFactory.newInstance(); + factory.setXMLResolver(new DTDResolver()); + factory.setProperty(javax.xml.stream.XMLInputFactory.SUPPORT_DTD, true); + factory.setProperty(javax.xml.stream.XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, true); + java.io.ByteArrayInputStream is = new java.io.ByteArrayInputStream(xml.getBytes("UTF-8")); + + // createXMLEventReader (source) not supported + // javax.xml.transform.stream.StreamSource source = new + // javax.xml.transform.stream.StreamSource (is); + // javax.xml.stream.XMLEventReader reader = + // factory.createXMLEventReader (source); + + javax.xml.stream.XMLEventReader reader = factory.createXMLEventReader(is); + while (reader.hasNext()) { + javax.xml.stream.events.XMLEvent event = reader.nextEvent(); + if (event.getEventType() == javax.xml.stream.XMLStreamConstants.DTD) { + String temp = ((javax.xml.stream.events.DTD) event).getDocumentTypeDeclaration(); + if (temp.length() < 120) { + Assert.fail("DTD truncated"); + } + System.out.println(temp); + } + } + } catch (XMLStreamException xe) { + Assert.fail(xe.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + class DTDResolver implements javax.xml.stream.XMLResolver { + public Object resolveEntity(String arg0, String arg1, String arg2, String arg3) throws XMLStreamException { + System.out.println("DTD is parsed"); + return new java.io.ByteArrayInputStream(new byte[0]); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Issue40Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Issue40Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLEventReaderTest; + +import java.io.File; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLEventReader.getElementText() works after calling peek(). + */ +public class Issue40Test { + + public java.io.File input; + public final String filesDir = "./"; + protected XMLInputFactory inputFactory; + protected XMLOutputFactory outputFactory; + + /** + * test without peek + */ + @Test + public void testWOPeek() { + try { + XMLEventReader er = getReader(); + XMLEvent e = er.nextEvent(); + Assert.assertEquals(e.getEventType(), XMLStreamConstants.START_DOCUMENT); + // we have two start elements in this file + Assert.assertEquals(er.nextEvent().getEventType(), XMLStreamConstants.START_ELEMENT); + Assert.assertEquals(er.nextEvent().getEventType(), XMLStreamConstants.START_ELEMENT); + System.out.println(er.getElementText()); + + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + /** + * test with peek + */ + @Test + public void testWPeek() { + try { + XMLEventReader er = getReader(); + XMLEvent e = er.nextEvent(); + Assert.assertEquals(e.getEventType(), XMLStreamConstants.START_DOCUMENT); + // we have two start elements in this file + while (er.peek().getEventType() == XMLStreamConstants.START_ELEMENT) { + e = er.nextEvent(); + } + Assert.assertEquals(e.getEventType(), XMLStreamConstants.START_ELEMENT); + System.out.println(er.getElementText()); + + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + private XMLEventReader getReader() throws Exception { + inputFactory = XMLInputFactory.newInstance(); + input = new File(getClass().getResource("play.xml").getFile()); + + // Check if event reader returns the correct event + XMLEventReader er = inputFactory.createXMLEventReader(inputFactory.createXMLStreamReader(new java.io.FileInputStream(input), "UTF-8")); + return er; + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/bug6613059.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/bug6613059.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ +<?xml version='1.0' encoding='UTF-8'?> +<menubar> + <menu> + <id>file</id> + <item> + <id>exit</id> + <method>doExit 0</method> + <type>all</type> + </item> + </menu> + <menu> + <id>edit</id> + <item> + <id>prefs</id> + <method>showPrefsWindow 0</method> + <type>all</type> + </item> + </menu> +</menubar> + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/play.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/play.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,4 @@ +<?xml version="1.0"?><PLAY><TITLE> + The Tragedy of Hamlet + Prince of Denmark + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/play2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/play2.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,9 @@ + + The Tragedy of Hamlet + Prince of Denmark + + + William Shakespeare + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/sgml.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/sgml.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,100 @@ + +Getting started with SGML + +The business challenge + +With the ever-changing and growing global market, companies and + large organizations are searching for ways to become more viable and + competitive. Downsizing and other cost-cutting measures demand more + efficient use of corporate resources. One very important resource is + an organization's information. +As part of the move toward integrated information management, +whole industries are developing and implementing standards for +exchanging technical information. This report describes how one such +standard, the Standard Generalized Markup Language (SGML), works as +part of an overall information management strategy. + + +Getting to know SGML + +While SGML is a fairly recent technology, the use of +markup in computer-generated documents has existed for a +while. +
+What is markup, or everything you always wanted to know about +document preparation but were afraid to ask? + +Markup is everything in a document that is not content. The +traditional meaning of markup is the manual marking up +of typewritten text to give instructions for a typesetter or +compositor about how to fit the text on a page and what typefaces to +use. This kind of markup is known as procedural markup. + +Procedural markup +Most electronic publishing systems today use some form of +procedural markup. Procedural markup codes are good for one +presentation of the information. + +Generic markup +Generic markup (also known as descriptive markup) describes the +purpose of the text in a document. A basic concept of +generic markup is that the content of a document must be separate from +the style. Generic markup allows for multiple presentations of the +information. + +Drawbacks of procedural markup +Industries involved in technical documentation increasingly +prefer generic over procedural markup schemes. When a company changes +software or hardware systems, enormous data translation tasks arise, +often resulting in errors.
+
+What <emph>is</emph> SGML in the grand scheme of the universe, anyway? + +SGML defines a strict markup scheme with a syntax for defining +document data elements and an overall framework for marking up +documents. +SGML can describe and create documents that are not dependent on +any hardware, software, formatter, or operating system. Since SGML documents +conform to an international standard, they are portable.
+
+How is SGML and would you recommend it to your grandmother? + +You can break a typical document into three layers: structure, +content, and style. SGML works by separating these three aspects and +deals mainly with the relationship between structure and content. + +Structure +At the heart of an SGML application is a file called the DTD, or +Document Type Definition. The DTD sets up the structure of a document, +much like a database schema describes the types of information it +handles. +A database schema also defines the relationships between the +various types of data. Similarly, a DTD specifies rules +to help ensure documents have a consistent, logical structure. + +Content +Content is the information itself. The method for identifying +the information and its meaning within this framework is called +tagging. Tagging must +conform to the rules established in the DTD (see ). + + +Style +SGML does not standardize style or other processing methods for +information stored in SGML.
+ +Resources +
+Conferences, tutorials, and training + +The Graphic Communications Association has been +instrumental in the development of SGML. GCA provides conferences, +tutorials, newsletters, and publication sales for both members and +non-members. +Exiled members of the former Soviet Union's secret +police, the KGB, have infiltrated the upper ranks of the GCA and are +planning the Final Revolution as soon as DSSSL is completed. + +
+
+
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLEventWriterTest; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; + +import javax.xml.stream.XMLEventFactory; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLEventWriter; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLEventWriter. + */ +public class ReaderToWriterTest { + + private static final XMLEventFactory XML_EVENT_FACTORY = XMLEventFactory.newInstance(); + private static final XMLInputFactory XML_INPUT_FACTORY = XMLInputFactory.newInstance(); + private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance(); + + private static final String INPUT_FILE = "W2JDLR4002TestService.wsdl.data"; + private static final String OUTPUT_FILE = "Encoded.wsdl"; + + /** + * Unit test for writing namespaces when namespaceURI == null. + */ + @Test + public void testWriteNamespace() { + + /** Platform default encoding. */ + final String DEFAULT_CHARSET = java.nio.charset.Charset.defaultCharset().name(); + System.out.println("DEFAULT_CHARSET = " + DEFAULT_CHARSET); + + final String EXPECTED_OUTPUT = ""; + final String EXPECTED_OUTPUT_NO_ENCODING = ""; + + // new Writer + XMLEventWriter xmlEventWriter = null; + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + try { + xmlEventWriter = XML_OUTPUT_FACTORY.createXMLEventWriter(byteArrayOutputStream); + } catch (XMLStreamException xmlStreamException) { + xmlStreamException.printStackTrace(); + Assert.fail(xmlStreamException.toString()); + } + + try { + // start a valid event stream + XMLEvent startDocumentEvent = XML_EVENT_FACTORY.createStartDocument(DEFAULT_CHARSET); + XMLEvent startElementEvent = XML_EVENT_FACTORY.createStartElement("prefix", "http://example.com", "root"); + xmlEventWriter.add(startDocumentEvent); + xmlEventWriter.add(startElementEvent); + + // try using a null default namespaceURI + XMLEvent namespaceEvent = XML_EVENT_FACTORY.createNamespace(null); + xmlEventWriter.add(namespaceEvent); + + // try using a null prefix'd namespaceURI + XMLEvent namespacePrefixEvent = XML_EVENT_FACTORY.createNamespace("null", null); + xmlEventWriter.add(namespacePrefixEvent); + + // close event stream + XMLEvent endElementEvent = XML_EVENT_FACTORY.createEndElement("prefix", "http://example.com", "root"); + XMLEvent endDocumentEvent = XML_EVENT_FACTORY.createEndDocument(); + xmlEventWriter.add(endElementEvent); + xmlEventWriter.add(endDocumentEvent); + xmlEventWriter.flush(); + } catch (XMLStreamException xmlStreamException) { + xmlStreamException.printStackTrace(); + Assert.fail(xmlStreamException.toString()); + } + + // get XML document as String + String actualOutput = byteArrayOutputStream.toString(); + + // is output as expected? + if (!actualOutput.equals(EXPECTED_OUTPUT) && !actualOutput.equals(EXPECTED_OUTPUT_NO_ENCODING)) { + Assert.fail("Expected: " + EXPECTED_OUTPUT + ", actual: " + actualOutput); + } + } + + /** + * Test: 6419687 NPE in XMLEventWriterImpl. + */ + @Test + public void testCR6419687() { + + try { + InputStream in = getClass().getResourceAsStream("ReaderToWriterTest.wsdl"); + OutputStream out = new FileOutputStream("ReaderToWriterTest-out.xml"); + + XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in); + XMLEventWriter writer = XML_OUTPUT_FACTORY.createXMLEventWriter(out, "UTF-8"); + while (reader.hasNext()) { + XMLEvent event = reader.nextEvent(); + writer.add(event); + } + reader.close(); + writer.close(); + } catch (XMLStreamException xmlStreamException) { + xmlStreamException.printStackTrace(); + Assert.fail(xmlStreamException.toString()); + } catch (FileNotFoundException fileNotFoundException) { + fileNotFoundException.printStackTrace(); + Assert.fail(fileNotFoundException.toString()); + } + } + + /* + * Reads UTF-16 encoding file and writes it to UTF-8 encoded format. + */ + @Test + public void testUTF8Encoding() { + try { + InputStream in = util.BOMInputStream.createStream("UTF-16BE", this.getClass().getResourceAsStream(INPUT_FILE)); + OutputStream out = new FileOutputStream(OUTPUT_FILE); + + XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in); + XMLEventWriter writer = XML_OUTPUT_FACTORY.createXMLEventWriter(out, "UTF-8"); + + writeEvents(reader, writer); + checkOutput(OUTPUT_FILE); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } finally { + File file = new File(OUTPUT_FILE); + if (file.exists()) + file.delete(); + } + } + + private void writeEvents(XMLEventReader reader, XMLEventWriter writer) throws XMLStreamException { + while (reader.hasNext()) { + XMLEvent event = reader.nextEvent(); + writer.add(event); + } + reader.close(); + writer.close(); + } + + private void checkOutput(String output) throws Exception { + InputStream in = new FileInputStream(output); + XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in); + while (reader.hasNext()) { + reader.next(); + } + reader.close(); + } + + /* + * Reads UTF-16 encoding file and writes it with default encoding. + */ + @Test + public void testNoEncoding() { + try { + InputStream in = util.BOMInputStream.createStream("UTF-16BE", this.getClass().getResourceAsStream(INPUT_FILE)); + OutputStream out = new FileOutputStream(OUTPUT_FILE); + + XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in); + XMLEventWriter writer = XML_OUTPUT_FACTORY.createXMLEventWriter(out); + + writeEvents(reader, writer); + checkOutput(OUTPUT_FILE); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } finally { + File file = new File(OUTPUT_FILE); + if (file.exists()) + file.delete(); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.wsdl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.wsdl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,523 @@ + + + + + + + + + Comment describing your root element + + + + + + + + + + + + + + + + + + + + Canonical Data Model for service checkAddress (result) + Generation Date: 20.12.2005 + naming convention for prefixes: + CDM - object type + DOM - reference data type + + + + + + + + + + + + + + + + + + + + + + physical existing postal address + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Address with special geographical information (GIS) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Deutschland + + + + + + + + + + + + + + + + + + + + + + + + + + + + Comment describing your root element + + + + + + + + + + + Comment describing your root element + + + + + + + + + + + + + + + + + + + + Canonical Data Model for service checkAddress + Generation Date: 20.12.2005 + naming convention for prefixes: + CDM - object type + DOM - reference data type + + + + + + physical existing postal address + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Address with special geographical information (GIS) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Deutschland + + + + + + + + + + + + + + + + + + + + + + + + + + + + Comment describing your root element + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The operation has no documentation + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/W2JDLR4002TestService.wsdl.data --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/W2JDLR4002TestService.wsdl.data Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/XMLEventWriterTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/XMLEventWriterTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLEventWriterTest; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; + +import javax.xml.namespace.QName; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLEventWriter; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.events.XMLEvent; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLEventWriter. + */ +public class XMLEventWriterTest { + + /** + * Test XMLStreamWriter parsing a file with an external entity reference. + */ + @Test + public void testXMLStreamWriter() { + + try { + XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); + XMLEventWriter eventWriter = outputFactory.createXMLEventWriter(System.out); + XMLInputFactory inputFactory = XMLInputFactory.newInstance(); + String file = getClass().getResource("XMLEventWriterTest.xml").getPath(); + XMLEventReader eventReader = inputFactory.createXMLEventReader(new StreamSource(new File(file))); + + // adds the event to the consumer. + eventWriter.add(eventReader); + eventWriter.flush(); + eventWriter.close(); + + // expected success + } catch (Exception exception) { + exception.printStackTrace(); + Assert.fail(exception.toString()); + } + } + + /** + * Inspired by CR 6245284 Sun Stax /sjsxp.jar does not behave properly + * during merge of xml files. + */ + @Test + public void testMerge() { + + try { + // Create the XML input factory + XMLInputFactory factory = XMLInputFactory.newInstance(); + + // Create XML event reader 1 + InputStream inputStream1 = new FileInputStream(new File(XMLEventWriterTest.class.getResource("merge-1.xml").toURI())); + XMLEventReader r1 = factory.createXMLEventReader(inputStream1); + + // Create XML event reader 2 + InputStream inputStream2 = new FileInputStream(new File(XMLEventWriterTest.class.getResource("merge-2.xml").toURI())); + XMLEventReader r2 = factory.createXMLEventReader(inputStream2); + + // Create the output factory + XMLOutputFactory xmlof = XMLOutputFactory.newInstance(); + + // Create XML event writer + XMLEventWriter xmlw = xmlof.createXMLEventWriter(System.out); + + // Read to first element in document 1 + // and output to result document + QName bName = new QName("b"); + + while (r1.hasNext()) { + // Read event to be written to result document + XMLEvent event = r1.nextEvent(); + + if (event.getEventType() == XMLEvent.END_ELEMENT) { + + // Start element - stop at element + QName name = event.asEndElement().getName(); + if (name.equals(bName)) { + + QName zName = new QName("z"); + + boolean isZr = false; + + while (r2.hasNext()) { + // Read event to be written to result document + XMLEvent event2 = r2.nextEvent(); + // Output event + if (event2.getEventType() == XMLEvent.START_ELEMENT && event2.asStartElement().getName().equals(zName)) { + isZr = true; + } + + if (xmlw != null && isZr) { + xmlw.add(event2); + } + + // stop adding events after + // i.e. do not write END_DOCUMENT :) + if (isZr && event2.getEventType() == XMLEvent.END_ELEMENT && event2.asEndElement().getName().equals(zName)) { + isZr = false; + } + } + xmlw.flush(); + } + } + + // Output event + if (xmlw != null) { + xmlw.add(event); + } + } + + // Read to first element in document 1 + // without writing to result document + xmlw.close(); + + // expected success + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail(ex.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/XMLEventWriterTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/XMLEventWriterTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,29 @@ + + + +]> +&replace; diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/merge-1.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/merge-1.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,32 @@ + + + + + + + + ccccccc + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/merge-2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/merge-2.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,26 @@ + + +zzzzzzzzz diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/replace1.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/replace1.txt Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ +replace1 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/Bug6756677Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/Bug6756677Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLInputFactoryTest; + +import javax.xml.stream.XMLInputFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6756677 + * @summary Test XMLInputFactory.newFactory(String factoryId, ClassLoader classLoader). + */ +public class Bug6756677Test { + + @Test + public void testNewInstance() { + String myFactory = "javax.xml.stream.XMLInputFactoryTest.MyInputFactory"; + try { + System.setProperty("MyInputFactory", myFactory); + XMLInputFactory xif = XMLInputFactory.newInstance("MyInputFactory", null); + System.out.println(xif.getClass().getName()); + Assert.assertTrue(xif.getClass().getName().equals(myFactory)); + + } catch (UnsupportedOperationException oe) { + Assert.fail(oe.getMessage()); + } + + } + + // newFactory was added in StAX 1.2 + @Test + public void testNewFactory() { + String myFactory = "javax.xml.stream.XMLInputFactoryTest.MyInputFactory"; + ClassLoader cl = null; + try { + System.setProperty("MyInputFactory", myFactory); + XMLInputFactory xif = XMLInputFactory.newFactory("MyInputFactory", cl); + System.out.println(xif.getClass().getName()); + Assert.assertTrue(xif.getClass().getName().equals(myFactory)); + + } catch (UnsupportedOperationException oe) { + Assert.fail(oe.getMessage()); + } + + } + + String Temp_Result = ""; + boolean PASSED = true; + boolean FAILED = false; + + String XMLInputFactoryClassName = "com.sun.xml.internal.stream.XMLInputFactoryImpl"; + String XMLInputFactoryID = "javax.xml.stream.XMLInputFactory"; + ClassLoader CL = null; + + // jaxp-test jaxp-product-tests javax.xml.jaxp14.ptests.FactoryTest + @Test + public void test() { + if (!test29()) { + Assert.fail(Temp_Result); + } + if (!test31()) { + Assert.fail(Temp_Result); + } + } + + /* + * test for XMLInputFactory.newInstance(java.lang.String factoryClassName, + * java.lang.ClassLoader classLoader) classloader is null and + * factoryClassName points to correct implementation of + * javax.xml.stream.XMLInputFactory , should return newInstance of + * XMLInputFactory + */ + @Test + public boolean test29() { + try { + System.setProperty(XMLInputFactoryID, XMLInputFactoryClassName); + XMLInputFactory xif = XMLInputFactory.newInstance(XMLInputFactoryID, CL); + if (xif instanceof XMLInputFactory) { + System.out.println(" test29() passed"); + return PASSED; + } else { + System.out.println(" test29() failed"); + Temp_Result = "test29() failed: xif not an instance of XMLInputFactory "; + return FAILED; + } + } catch (javax.xml.stream.FactoryConfigurationError fce) { + System.out.println("Failed : FactoryConfigurationError in test29 " + fce); + Temp_Result = "test29() failed "; + return FAILED; + } catch (Exception e) { + System.out.println("Failed : Exception in test29 " + e); + Temp_Result = "test29() failed "; + return FAILED; + } + } + + /* + * test for XMLInputFactory.newInstance(java.lang.String factoryClassName, + * java.lang.ClassLoader classLoader) classloader is + * default(Class.getClassLoader()) and factoryClassName points to correct + * implementation of javax.xml.stream.XMLInputFactory , should return + * newInstance of XMLInputFactory + */ + @Test + public boolean test31() { + try { + Bug6756677Test test3 = new Bug6756677Test(); + ClassLoader cl = (test3.getClass()).getClassLoader(); + System.setProperty(XMLInputFactoryID, XMLInputFactoryClassName); + XMLInputFactory xif = XMLInputFactory.newInstance(XMLInputFactoryID, cl); + if (xif instanceof XMLInputFactory) { + System.out.println(" test31() passed"); + return PASSED; + } else { + System.out.println(" test31() failed"); + Temp_Result = "test31() failed: xif not an instance of XMLInputFactory "; + return FAILED; + } + } catch (javax.xml.stream.FactoryConfigurationError fce) { + System.out.println("Failed : FactoryConfigurationError in test31 " + fce); + Temp_Result = "test31() failed "; + return FAILED; + } catch (Exception e) { + System.out.println("Failed : Exception in test31 " + e); + Temp_Result = "test31() failed "; + return FAILED; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/Bug6909759Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/Bug6909759Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLInputFactoryTest; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6909759 + * @summary Test createXMLStreamReader with StreamSource. + */ +public class Bug6909759Test { + + + @Test + public void testCreateXMLStreamReader() { + + try { + StreamSource ss = new StreamSource(getClass().getResourceAsStream("play.xml")); + XMLInputFactory xif = XMLInputFactory.newInstance(); + // File file = new File("./tests/XMLStreamReader/sgml.xml"); + // FileInputStream inputStream = new FileInputStream(file); + XMLStreamReader xsr; + xsr = xif.createXMLStreamReader(ss); + + while (xsr.hasNext()) { + int eventType = xsr.next(); + } + + } catch (UnsupportedOperationException oe) { + Assert.fail("StreamSource should be supported"); + } catch (XMLStreamException ex) { + Assert.fail("fix the test"); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/IssueTracker38.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/IssueTracker38.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLInputFactoryTest; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test createXMLEventReader from DOM or SAX source is unsupported. + */ +public class IssueTracker38 { + + @Test + public void testXMLEventReaderFromDOMSource() throws Exception { + try { + createEventReaderFromSource(new DOMSource()); + Assert.fail("Expected UnsupportedOperationException not thrown"); + } catch (UnsupportedOperationException e) { + } + } + + @Test + public void testXMLStreamReaderFromDOMSource() throws Exception { + try { + createStreamReaderFromSource(new DOMSource()); + Assert.fail("Expected UnsupportedOperationException not thrown"); + } catch (UnsupportedOperationException oe) { + } + } + + @Test + public void testXMLEventReaderFromSAXSource() throws Exception { + try { + createEventReaderFromSource(new SAXSource()); + Assert.fail("Expected UnsupportedOperationException not thrown"); + } catch (UnsupportedOperationException e) { + } + } + + @Test + public void testXMLStreamReaderFromSAXSource() throws Exception { + try { + createStreamReaderFromSource(new SAXSource()); + Assert.fail("Expected UnsupportedOperationException not thrown"); + } catch (UnsupportedOperationException oe) { + } + } + + private void createEventReaderFromSource(Source source) throws Exception { + XMLInputFactory xIF = XMLInputFactory.newInstance(); + xIF.createXMLEventReader(source); + } + + private void createStreamReaderFromSource(Source source) throws Exception { + XMLInputFactory xIF = XMLInputFactory.newInstance(); + xIF.createXMLStreamReader(source); + } + + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/MyInputFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/MyInputFactory.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLInputFactoryTest; + +import java.io.InputStream; +import java.io.Reader; + +import javax.xml.stream.EventFilter; +import javax.xml.stream.StreamFilter; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLReporter; +import javax.xml.stream.XMLResolver; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.util.XMLEventAllocator; +import javax.xml.transform.Source; + +public class MyInputFactory extends javax.xml.stream.XMLInputFactory { + + @Override + public XMLStreamReader createXMLStreamReader(Reader reader) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLStreamReader createXMLStreamReader(Source source) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLStreamReader createXMLStreamReader(InputStream stream) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLStreamReader createXMLStreamReader(InputStream stream, String encoding) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLStreamReader createXMLStreamReader(String systemId, InputStream stream) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLStreamReader createXMLStreamReader(String systemId, Reader reader) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLEventReader createXMLEventReader(Reader reader) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLEventReader createXMLEventReader(String systemId, Reader reader) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLEventReader createXMLEventReader(XMLStreamReader reader) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLEventReader createXMLEventReader(Source source) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLEventReader createXMLEventReader(InputStream stream) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLEventReader createXMLEventReader(InputStream stream, String encoding) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLEventReader createXMLEventReader(String systemId, InputStream stream) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter) throws XMLStreamException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLResolver getXMLResolver() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setXMLResolver(XMLResolver resolver) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLReporter getXMLReporter() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setXMLReporter(XMLReporter reporter) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setProperty(String name, Object value) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getProperty(String name) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isPropertySupported(String name) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setEventAllocator(XMLEventAllocator allocator) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XMLEventAllocator getEventAllocator() { + throw new UnsupportedOperationException("Not supported yet."); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/play.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/play.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,6 @@ + + The Tragedy of Hamlet + Prince of Denmark + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/Bug6846132Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/Bug6846132Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLOutputFactoryTest; + +import javax.xml.stream.XMLEventWriter; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; +import javax.xml.transform.sax.SAXResult; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6846132 + * @summary Test createXMLStreamWriter with SAXResult won't throw a NullPointerException. + */ +public class Bug6846132Test { + + @Test + public void testSAXResult() { + DefaultHandler handler = new DefaultHandler(); + + final String EXPECTED_OUTPUT = ""; + try { + SAXResult saxResult = new SAXResult(handler); + // saxResult.setSystemId("jaxp-ri/unit-test/javax/xml/stream/XMLOutputFactoryTest/cr6846132.xml"); + XMLOutputFactory ofac = XMLOutputFactory.newInstance(); + XMLStreamWriter writer = ofac.createXMLStreamWriter(saxResult); + writer.writeStartDocument("1.0"); + writer.writeStartElement("root"); + writer.writeEndElement(); + writer.writeEndDocument(); + writer.flush(); + writer.close(); + } catch (Exception e) { + if (e instanceof UnsupportedOperationException) { + // expected + } else { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + } + + @Test + public void testSAXResult1() { + DefaultHandler handler = new DefaultHandler(); + + try { + SAXResult saxResult = new SAXResult(handler); + XMLOutputFactory ofac = XMLOutputFactory.newInstance(); + XMLEventWriter writer = ofac.createXMLEventWriter(saxResult); + } catch (Exception e) { + if (e instanceof UnsupportedOperationException) { + // expected + } else { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/DuplicateNSDeclarationTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/DuplicateNSDeclarationTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLOutputFactoryTest; + +import java.io.ByteArrayOutputStream; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test the writing of duplicate namespace declarations when IS_REPAIRING_NAMESPACES is ture. + */ +public class DuplicateNSDeclarationTest { + + @Test + public void testDuplicateNSDeclaration() { + + // expect only 1 Namespace Declaration + final String EXPECTED_OUTPUT = "" + "" + ""; + + // have XMLOutputFactory repair Namespaces + XMLOutputFactory ofac = XMLOutputFactory.newInstance(); + ofac.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true)); + + // send output to a Stream + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + StreamResult sr = new StreamResult(buffer); + XMLStreamWriter w = null; + + // write a duplicate Namespace Declaration + try { + w = ofac.createXMLStreamWriter(sr); + w.writeStartDocument(); + w.writeStartElement("ns1", "foo", "http://example.com/"); + w.writeNamespace("ns1", "http://example.com/"); + w.writeNamespace("ns1", "http://example.com/"); + w.writeEndElement(); + w.writeEndDocument(); + w.close(); + } catch (XMLStreamException xmlStreamException) { + xmlStreamException.printStackTrace(); + Assert.fail(xmlStreamException.toString()); + } + + // debugging output for humans + System.out.println(); + System.out.println("actual: \"" + buffer.toString() + "\""); + System.out.println("expected: \"" + EXPECTED_OUTPUT + "\""); + + // are results as expected? + Assert.assertEquals(EXPECTED_OUTPUT, buffer.toString()); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/StreamResultTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/StreamResultTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLOutputFactoryTest; + +import java.io.ByteArrayOutputStream; + +import javax.xml.stream.XMLEventFactory; +import javax.xml.stream.XMLEventWriter; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; +import javax.xml.transform.stax.StAXResult; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test create XMLWriter with variant Result. + */ +public class StreamResultTest { + + @Test + public void testStreamResult() { + final String EXPECTED_OUTPUT = ""; + try { + XMLOutputFactory ofac = XMLOutputFactory.newInstance(); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + StreamResult sr = new StreamResult(buffer); + XMLStreamWriter writer = ofac.createXMLStreamWriter(sr); + writer.writeStartDocument("1.0"); + writer.writeStartElement("root"); + writer.writeEndElement(); + writer.writeEndDocument(); + writer.close(); + Assert.assertEquals(buffer.toString(), EXPECTED_OUTPUT); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + @Test + public void testStreamWriterWithStAXResultNStreamWriter() { + final String EXPECTED_OUTPUT = ""; + + try { + XMLOutputFactory ofac = XMLOutputFactory.newInstance(); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + XMLStreamWriter writer = ofac.createXMLStreamWriter(buffer); + StAXResult res = new StAXResult(writer); + writer = ofac.createXMLStreamWriter(res); + writer.writeStartDocument("1.0"); + writer.writeStartElement("root"); + writer.writeEndElement(); + writer.writeEndDocument(); + writer.close(); + Assert.assertEquals(buffer.toString(), EXPECTED_OUTPUT); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + @Test + public void testEventWriterWithStAXResultNStreamWriter() { + String encoding = ""; + if (System.getProperty("file.encoding").equals("UTF-8")) { + encoding = " encoding=\"UTF-8\""; + } + final String EXPECTED_OUTPUT = ""; + + try { + XMLOutputFactory ofac = XMLOutputFactory.newInstance(); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + XMLStreamWriter swriter = ofac.createXMLStreamWriter(buffer); + StAXResult res = new StAXResult(swriter); + XMLEventWriter writer = ofac.createXMLEventWriter(res); + + XMLEventFactory efac = XMLEventFactory.newInstance(); + writer.add(efac.createStartDocument(null, "1.0")); + writer.add(efac.createStartElement("", "", "root")); + writer.add(efac.createEndElement("", "", "root")); + writer.add(efac.createEndDocument()); + writer.close(); + + Assert.assertEquals(buffer.toString(), EXPECTED_OUTPUT); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + @Test + public void testEventWriterWithStAXResultNEventWriter() { + String encoding = ""; + if (System.getProperty("file.encoding").equals("UTF-8")) { + encoding = " encoding=\"UTF-8\""; + } + final String EXPECTED_OUTPUT = ""; + + try { + XMLOutputFactory ofac = XMLOutputFactory.newInstance(); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + XMLEventWriter writer = ofac.createXMLEventWriter(buffer); + StAXResult res = new StAXResult(writer); + writer = ofac.createXMLEventWriter(res); + + XMLEventFactory efac = XMLEventFactory.newInstance(); + writer.add(efac.createStartDocument(null, "1.0")); + writer.add(efac.createStartElement("", "", "root")); + writer.add(efac.createEndElement("", "", "root")); + writer.add(efac.createEndDocument()); + writer.close(); + + Assert.assertEquals(buffer.toString(), EXPECTED_OUTPUT); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + @Test + public void testStreamWriterWithStAXResultNEventWriter() throws Exception { + try { + XMLOutputFactory ofac = XMLOutputFactory.newInstance(); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + XMLEventWriter writer = ofac.createXMLEventWriter(buffer); + StAXResult res = new StAXResult(writer); + XMLStreamWriter swriter = ofac.createXMLStreamWriter(res); + Assert.fail("Expected an Exception as XMLStreamWriter can't be created " + "with a StAXResult which has EventWriter."); + } catch (Exception e) { + System.out.println(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/XMLResolverTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/XMLResolverTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLResolverTest; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLResolver; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLResolver. + */ +public class XMLResolverTest { + + @Test + public void testXMLResolver() { + try { + XMLInputFactory xifactory = XMLInputFactory.newInstance(); + xifactory.setProperty(XMLInputFactory.RESOLVER, new MyStaxResolver()); + File file = new File(getClass().getResource("XMLResolverTest.xml").getFile()); + String systemId = file.toURI().toString(); + InputStream entityxml = new FileInputStream(file); + XMLStreamReader streamReader = xifactory.createXMLStreamReader(systemId, entityxml); + while (streamReader.hasNext()) { + int eventType = streamReader.next(); + if (eventType == XMLStreamConstants.START_ELEMENT) { + eventType = streamReader.next(); + if (eventType == XMLStreamConstants.CHARACTERS) { + String text = streamReader.getText(); + Assert.assertTrue(text.contains("replace2")); + } + } + } + } catch (XMLStreamException ex) { + + if (ex.getNestedException() != null) { + ex.getNestedException().printStackTrace(); + } + // ex.printStackTrace() ; + } catch (Exception io) { + io.printStackTrace(); + } + } + + class MyStaxResolver implements XMLResolver { + + public MyStaxResolver() { + + } + + public Object resolveEntity(String publicId, String systemId, String baseURI, String namespace) throws javax.xml.stream.XMLStreamException { + + Object object = null; + try { + object = new FileInputStream(getClass().getResource("replace2.txt").getFile()); + } catch (Exception ex) { + ex.printStackTrace(); + } + return object; + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/XMLResolverTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/XMLResolverTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,13 @@ + + + + +]> +&replace; diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/replace1.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/replace1.txt Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ +replace1 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/replace2.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/replace2.txt Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ +replace2 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamExceptionTest/ExceptionTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamExceptionTest/ExceptionTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamExceptionTest; + +import java.io.IOException; + +import javax.xml.stream.XMLStreamException; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLStreamException contains the message of the wrapped exception. + */ +public class ExceptionTest { + + @Test + public void testException() { + + final String EXPECTED_OUTPUT = "Test XMLStreamException"; + try { + Exception ex = new IOException("Test XMLStreamException"); + throw new XMLStreamException(ex); + } catch (XMLStreamException e) { + Assert.assertTrue(e.getMessage().contains(EXPECTED_OUTPUT), "XMLStreamException does not contain the message " + "of the wrapped exception"); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/Bug6481615.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/Bug6481615.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamFilterTest; + +import java.io.StringReader; + +import javax.xml.stream.StreamFilter; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6481615 + * @summary Test Filtered XMLStreamReader can return the event type if current state is START_ELEMENT. + */ +public class Bug6481615 { + + static final String XML = "" + ""; + + private XMLInputFactory factory = XMLInputFactory.newInstance(); + + @Test + public void test() { + try { + XMLStreamReader reader = factory.createXMLStreamReader(new StringReader(XML)); + reader.next(); // advance to START_ELEMENT + XMLStreamReader filter = factory.createFilteredReader(reader, new Filter()); + Assert.assertTrue(filter.getEventType() != -1); + } catch (Exception e) { + e.printStackTrace(); + // Assert.fail("Unexpected Exception: " + e.getMessage()); + } + } + + class Filter implements StreamFilter { + + public boolean accept(XMLStreamReader reader) { + return true; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/Bug6481678.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/Bug6481678.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamFilterTest; + +import java.io.InputStream; + +import javax.xml.namespace.NamespaceContext; +import javax.xml.namespace.QName; +import javax.xml.stream.EventFilter; +import javax.xml.stream.StreamFilter; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6481678 + * @summary Test Filtered XMLStreamReader parses namespace correctly. + */ +public class Bug6481678 { + + String rootElement = "fruits"; + String childElement = "varieties"; + String prefixApple = "a"; + String namespaceURIApple = "apple.fruit"; + String prefixOrange = "o"; + String namespaceURIOrange = "orange.fruit"; + String namespaceURIBanana = "banana.fruit"; + + TypeFilter filter; + XMLInputFactory factory; + InputStream is; + + /** Creates a new instance of NamespaceTest */ + public Bug6481678(java.lang.String testName) { + init(); + } + + private void init() { + factory = XMLInputFactory.newInstance(); + factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); + filter = createFilter(); + } + + String getXML() { + StringBuffer sbuffer = new StringBuffer(); + sbuffer.append(""); + sbuffer.append("<" + rootElement + " state=\"WA\""); + sbuffer.append(" xmlns:" + prefixApple + "=\"" + namespaceURIApple + "\""); + sbuffer.append(" xmlns:" + prefixOrange + "=\"" + namespaceURIOrange + "\""); + sbuffer.append(" xmlns=\"" + namespaceURIBanana + "\">"); + sbuffer.append("<" + prefixApple + ":" + childElement + ">"); + sbuffer.append("<" + prefixApple + ":fuji/>"); + sbuffer.append("<" + prefixApple + ":gala/>"); + sbuffer.append(""); + sbuffer.append(""); + // System.out.println("XML = " + sbuffer.toString()) ; + return sbuffer.toString(); + } + + public TypeFilter createFilter() { + + TypeFilter f = new TypeFilter(); + + f.addType(XMLEvent.START_ELEMENT); + f.addType(XMLEvent.END_ELEMENT); + f.addType(XMLEvent.PROCESSING_INSTRUCTION); + f.addType(XMLEvent.CHARACTERS); + f.addType(XMLEvent.COMMENT); + f.addType(XMLEvent.SPACE); + f.addType(XMLEvent.START_DOCUMENT); + f.addType(XMLEvent.END_DOCUMENT); + return f; + } + + /* + * testcase for cr6481678 in our current impl (using cache), the reader + * would read from cache when getters are called before next() is. refter to + * testRootElementNamespace. + */ + @Test + public void testReadingNamespace() { + is = new java.io.ByteArrayInputStream(getXML().getBytes()); + try { + XMLStreamReader sr = factory.createFilteredReader(factory.createXMLStreamReader(is), (StreamFilter) filter); + + while (sr.hasNext()) { + int eventType = sr.getEventType(); + if (eventType == XMLStreamConstants.START_ELEMENT) { + if (sr.getLocalName().equals(rootElement)) { + Assert.assertTrue(sr.getNamespacePrefix(0).equals(prefixApple) && sr.getNamespaceURI(0).equals(namespaceURIApple)); + } + } + eventType = sr.next(); + } + } catch (Exception ex) { + Assert.fail("Exception: " + ex.getMessage()); + } + } + + @Test + public void testRootElementNamespace() { + is = new java.io.ByteArrayInputStream(getXML().getBytes()); + try { + XMLStreamReader sr = factory.createFilteredReader(factory.createXMLStreamReader(is), (StreamFilter) filter); + + while (sr.hasNext()) { + int eventType = sr.next(); + if (eventType == XMLStreamConstants.START_ELEMENT) { + if (sr.getLocalName().equals(rootElement)) { + Assert.assertTrue(sr.getNamespacePrefix(0).equals(prefixApple) && sr.getNamespaceURI(0).equals(namespaceURIApple)); + } + } + } + } catch (Exception ex) { + Assert.fail("Exception: " + ex.getMessage()); + } + } + + @Test + public void testChildElementNamespace() { + is = new java.io.ByteArrayInputStream(getXML().getBytes()); + try { + XMLStreamReader sr = factory.createFilteredReader(factory.createXMLStreamReader(is), (StreamFilter) filter); + while (sr.hasNext()) { + int eventType = sr.next(); + if (eventType == XMLStreamConstants.START_ELEMENT) { + if (sr.getLocalName().equals(childElement)) { + QName qname = sr.getName(); + Assert.assertTrue(qname.getPrefix().equals(prefixApple) && qname.getNamespaceURI().equals(namespaceURIApple) + && qname.getLocalPart().equals(childElement)); + } + } + } + } catch (Exception ex) { + Assert.fail("Exception: " + ex.getMessage()); + } + } + + @Test + public void testNamespaceContext() { + is = new java.io.ByteArrayInputStream(getXML().getBytes()); + try { + XMLStreamReader sr = factory.createFilteredReader(factory.createXMLStreamReader(is), (StreamFilter) filter); + while (sr.hasNext()) { + int eventType = sr.next(); + if (eventType == XMLStreamConstants.START_ELEMENT) { + if (sr.getLocalName().equals(childElement)) { + NamespaceContext context = sr.getNamespaceContext(); + Assert.assertTrue(context.getPrefix(namespaceURIApple).equals(prefixApple)); + } + } + } + } catch (Exception ex) { + Assert.fail("Exception: " + ex.getMessage()); + } + } + + @Test + public void testNamespaceCount() { + is = new java.io.ByteArrayInputStream(getXML().getBytes()); + try { + XMLStreamReader sr = factory.createFilteredReader(factory.createXMLStreamReader(is), (StreamFilter) filter); + while (sr.hasNext()) { + int eventType = sr.next(); + if (eventType == XMLStreamConstants.START_ELEMENT) { + if (sr.getLocalName().equals(rootElement)) { + int count = sr.getNamespaceCount(); + Assert.assertTrue(count == 3); + } + } + } + } catch (Exception ex) { + Assert.fail("Exception: " + ex.getMessage()); + } + } + + class TypeFilter implements EventFilter, StreamFilter { + + protected boolean[] types = new boolean[20]; + + public TypeFilter() { + } + + public void addType(int type) { + types[type] = true; + } + + public boolean accept(XMLEvent e) { + return types[e.getEventType()]; + } + + public boolean accept(XMLStreamReader r) { + return types[r.getEventType()]; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamFilterTest; + +import javax.xml.stream.StreamFilter; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test Filtered XMLStreamReader hasNext() always return the correct value if repeat to call it. + */ +public class HasNextTest { + + private static String INPUT_FILE = "HasNextTest.xml"; + + private HasNextTypeFilter createFilter() { + + HasNextTypeFilter f = new HasNextTypeFilter(); + + f.addType(XMLEvent.START_ELEMENT); + f.addType(XMLEvent.END_ELEMENT); + f.addType(XMLEvent.PROCESSING_INSTRUCTION); + f.addType(XMLEvent.CHARACTERS); + f.addType(XMLEvent.COMMENT); + f.addType(XMLEvent.SPACE); + f.addType(XMLEvent.START_DOCUMENT); + f.addType(XMLEvent.END_DOCUMENT); + return f; + } + + private XMLStreamReader createStreamReader(HasNextTypeFilter f) { + + try { + XMLInputFactory factory = XMLInputFactory.newInstance(); + factory = XMLInputFactory.newInstance(); + return factory.createFilteredReader(factory.createXMLStreamReader(this.getClass().getResourceAsStream(INPUT_FILE)), (StreamFilter) f); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Unexpected Exception: " + e.getMessage()); + return null; + } + } + + private void checkHasNext(XMLStreamReader r1) throws XMLStreamException { + + // try asking 3 times, insure all results are the same + boolean hasNext_1 = r1.hasNext(); + boolean hasNext_2 = r1.hasNext(); + boolean hasNext_3 = r1.hasNext(); + + System.out.println("XMLStreamReader.hasNext() (1): " + hasNext_1); + System.out.println("XMLStreamReader.hasNext() (2): " + hasNext_2); + System.out.println("XMLStreamReader.hasNext() (3): " + hasNext_3); + + Assert.assertTrue((hasNext_1 == hasNext_2) && (hasNext_1 == hasNext_3), + "XMLStreamReader.hasNext() returns inconsistent values for each subsequent call: " + hasNext_1 + ", " + hasNext_2 + ", " + hasNext_3); + } + + @Test + public void testFilterUsingNextTag() { + + try { + HasNextTypeFilter f = createFilter(); + XMLStreamReader r1 = createStreamReader(f); + + while (r1.hasNext()) { + try { + r1.nextTag(); + } catch (Exception e) { + System.err.println("Expected Exception: " + e.getMessage()); + e.printStackTrace(); + } + + checkHasNext(r1); + } + + } catch (XMLStreamException e) { + System.err.println("Unexpected Exception: " + e.getMessage()); + e.printStackTrace(); + Assert.fail("Unexpected Exception: " + e.toString()); + } catch (Exception e) { + // if this is END_DOCUMENT, it is expected + if (e.toString().indexOf("END_DOCUMENT") != -1) { + // expected + System.err.println("Expected Exception:"); + e.printStackTrace(); + } else { + // unexpected + System.err.println("Unexpected Exception: " + e.getMessage()); + e.printStackTrace(); + Assert.fail("Unexpected Exception: " + e.toString()); + } + } + } + + @Test + public void testFilterUsingNext() { + + try { + HasNextTypeFilter f = createFilter(); + XMLStreamReader r1 = createStreamReader(f); + + while (r1.hasNext()) { + r1.next(); + checkHasNext(r1); + } + + } catch (Exception e) { + // unexpected + System.err.println("Unexpected Exception: " + e.getMessage()); + e.printStackTrace(); + Assert.fail("Unexpected Exception: " + e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,9 @@ + +this is some text + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTypeFilter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTypeFilter.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamFilterTest; + +import javax.xml.stream.EventFilter; +import javax.xml.stream.StreamFilter; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; + +public class HasNextTypeFilter implements EventFilter, StreamFilter { + + protected boolean[] types = new boolean[20]; + + public HasNextTypeFilter() { + } + + public void addType(int type) { + types[type] = true; + } + + public boolean accept(XMLEvent e) { + return types[e.getEventType()]; + } + + public boolean accept(XMLStreamReader r) { + return types[r.getEventType()]; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/BOMTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/BOMTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6218794 + * @summary Test XMLStreamReader parses BOM UTF-8 and BOM UTF-16 big endian stream. + */ +public class BOMTest { + // UTF-8 BOM test file + private static final String INPUT_FILE1 = "UTF8-BOM.xml.data"; + // UTF-16 Big Endian test file + private static final String INPUT_FILE2 = "UTF16-BE.wsdl.data"; + + @Test + public void testBOM() { + XMLInputFactory ifac = XMLInputFactory.newInstance(); + try { + XMLStreamReader re = ifac.createXMLStreamReader(this.getClass().getResource(INPUT_FILE1).toExternalForm(), + util.BOMInputStream.createStream("UTF-8", this.getClass().getResourceAsStream(INPUT_FILE1))); + while (re.hasNext()) { + int event = re.next(); + } + XMLStreamReader re2 = ifac.createXMLStreamReader(this.getClass().getResource(INPUT_FILE2).toExternalForm(), + util.BOMInputStream.createStream("UTF-16BE", this.getClass().getResourceAsStream(INPUT_FILE2))); + while (re2.hasNext()) { + + int event = re2.next(); + + } + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6388460.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6388460.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; + +/* + * @bug 6388460 + * @summary Test StAX parser can parse UTF-16 wsdl. + */ +public class Bug6388460 { + + @Test + public void test() { + try { + + Source source = new StreamSource(util.BOMInputStream.createStream("UTF-16BE", this.getClass().getResourceAsStream("Hello.wsdl.data")), + this.getClass().getResource("Hello.wsdl.data").toExternalForm()); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + TransformerFactory factory = TransformerFactory.newInstance(); + Transformer transformer = factory.newTransformer(); + transformer.transform(source, new StreamResult(baos)); + System.out.println(new String(baos.toByteArray())); + ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray()); + InputSource inSource = new InputSource(bis); + + XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); + xmlInputFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); + XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(inSource.getSystemId(), inSource.getByteStream()); + while (reader.hasNext()) { + reader.next(); + } + } catch (Exception ex) { + ex.printStackTrace(System.err); + Assert.fail("Exception occured: " + ex.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6472982Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6472982Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.InputStream; + +import javax.xml.namespace.NamespaceContext; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6472982 + * @summary Test XMLStreamReader.getNamespaceContext().getPrefix("") won't throw IllegalArgumentException. + */ +public class Bug6472982Test { + String namespaceURI = "foobar.com"; + String rootElement = "foo"; + String childElement = "foochild"; + String prefix = "a"; + + @Test + public void testNamespaceContext() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); + InputStream is = new java.io.ByteArrayInputStream(getXML().getBytes()); + XMLStreamReader sr = xif.createXMLStreamReader(is); + NamespaceContext context = sr.getNamespaceContext(); + Assert.assertTrue(context.getPrefix("") == null); + + } catch (IllegalArgumentException iae) { + Assert.fail("NamespacePrefix#getPrefix() should not throw an IllegalArgumentException for empty uri. "); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + String getXML() { + StringBuffer sbuffer = new StringBuffer(); + sbuffer.append(""); + sbuffer.append("<" + rootElement + " xmlns:"); + sbuffer.append(prefix); + sbuffer.append("=\"" + namespaceURI + "\">"); + sbuffer.append("<" + prefix + ":" + childElement + ">"); + sbuffer.append("blahblah"); + sbuffer.append(""); + sbuffer.append(""); + // System.out.println("XML = " + sbuffer.toString()) ; + return sbuffer.toString(); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6767322.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6767322.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,4 @@ + + + Hello World! + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6767322Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6767322Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.ByteArrayInputStream; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6767322 + * @summary Test XMLStreamReader.getVersion() returns null if a version isn't declared. + */ +public class Bug6767322Test { + private static final String INPUT_FILE = "Bug6767322.xml"; + + @Test + public void testVersionSet() { + try { + XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(this.getClass().getResource(INPUT_FILE).toExternalForm(), + this.getClass().getResourceAsStream(INPUT_FILE)); + + String version = r.getVersion(); + System.out.println("Bug6767322.xml: " + version); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testVersionNotSet() { + try { + String xmlText = "Version not declared"; + XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(xmlText.getBytes())); + String version = r.getVersion(); + System.out.println("Version for text \"" + xmlText + "\": " + version); + if (version != null) { + Assert.fail("getVersion should return null"); + } + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6847819Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6847819Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import org.testng.annotations.Test; +import org.testng.Assert; +import java.io.StringReader; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; + +/* + * @bug 6847819 + * @summary Test StAX parser shall throw XMLStreamException for illegal xml declaration. + */ +public class Bug6847819Test { + + @Test + public void testIllegalDecl() throws XMLStreamException { + String xml = "abc]]>xyz"; + String msg = "illegal declaration"; + try { + XMLInputFactory inputFactory = XMLInputFactory.newInstance(); + inputFactory.createXMLStreamReader(new StringReader(xml)); + Assert.fail("Expected an exception for " + msg); + } catch (XMLStreamException ex) { // good + System.out.println("Expected failure: '" + ex.getMessage() + "' " + "(matching message: '" + msg + "')"); + } catch (Exception ex2) { // ok; iff links to XMLStreamException + Throwable t = ex2; + while (t.getCause() != null && !(t instanceof XMLStreamException)) { + t = t.getCause(); + } + if (t instanceof XMLStreamException) { + System.out.println("Expected failure: '" + ex2.getMessage() + "' " + "(matching message: '" + msg + "')"); + } + if (t == ex2) { + Assert.fail("Expected an XMLStreamException (either direct, or getCause() of a primary exception) for " + msg + ", got: " + ex2); + } + Assert.fail("Expected an XMLStreamException (either direct, or getCause() of a primary exception) for " + msg + ", got: " + ex2 + " (root: " + t + ")"); + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/BugTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/BugTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.StringReader; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test StAX parser can parse xml without declaration. + */ +public class BugTest { + + @Test + public static void test1() throws Exception { + XMLInputFactory xif = XMLInputFactory.newInstance(); // new + // com.sun.xml.stream.ZephyrParserFactory(); + XMLStreamReader r = xif.createXMLStreamReader(new StringReader("")); + Assert.assertEquals(XMLStreamConstants.START_DOCUMENT, r.getEventType()); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/DefaultAttributeTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/DefaultAttributeTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.util.Iterator; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.StartElement; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test StAX parses namespace and attribute. + */ +public class DefaultAttributeTest { + + private static final String INPUT_FILE = "ExternalDTD.xml"; + + @Test + public void testStreamReader() { + XMLInputFactory ifac = XMLInputFactory.newInstance(); + XMLOutputFactory ofac = XMLOutputFactory.newInstance(); + + try { + ifac.setProperty(ifac.IS_REPLACING_ENTITY_REFERENCES, new Boolean(false)); + + XMLStreamReader re = ifac.createXMLStreamReader(this.getClass().getResource(INPUT_FILE).toExternalForm(), + this.getClass().getResourceAsStream(INPUT_FILE)); + + while (re.hasNext()) { + int event = re.next(); + if (event == XMLStreamConstants.START_ELEMENT && re.getLocalName().equals("bookurn")) { + Assert.assertTrue(re.getAttributeCount() == 0, "No attributes are expected for "); + Assert.assertTrue(re.getNamespaceCount() == 2, "Two namespaces are expected for "); + } + } + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testEventReader() { + try { + XMLInputFactory ifac = XMLInputFactory.newInstance(); + XMLEventReader read = ifac.createXMLEventReader(this.getClass().getResource(INPUT_FILE).toExternalForm(), + this.getClass().getResourceAsStream(INPUT_FILE)); + while (read.hasNext()) { + XMLEvent event = read.nextEvent(); + if (event.isStartElement()) { + StartElement startElement = event.asStartElement(); + if (startElement.getName().getLocalPart().equals("bookurn")) { + Iterator iterator = startElement.getNamespaces(); + int count = 0; + while (iterator.hasNext()) { + iterator.next(); + count++; + } + Assert.assertTrue(count == 2, "Two namespaces are expected for "); + + Iterator attributes = startElement.getAttributes(); + count = 0; + while (attributes.hasNext()) { + iterator.next(); + count++; + } + Assert.assertTrue(count == 0, "Zero attributes are expected for "); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/DoubleXmlnsTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/DoubleXmlnsTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.StringReader; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test double namespaces and nested namespaces. + */ +public class DoubleXmlnsTest { + + @Test + public void testDoubleNS() throws Exception { + + final String INVALID_XML = ""; + + try { + XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(INVALID_XML)); + + while (xsr.hasNext()) { + xsr.next(); + } + + Assert.fail("Wellformedness error expected: " + INVALID_XML); + } catch (XMLStreamException e) { + ; // this is expected + } + } + + @Test + public void testNestedNS() throws Exception { + + final String VALID_XML = ""; + + try { + XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(VALID_XML)); + + while (xsr.hasNext()) { + xsr.next(); + } + + // expected success + } catch (XMLStreamException e) { + e.printStackTrace(); + + Assert.fail("Wellformedness error is not expected: " + VALID_XML + ", " + e.getMessage()); + } + } + + @Test + public void testDoubleXmlns() throws Exception { + + final String INVALID_XML = ""; + + try { + XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(INVALID_XML)); + + while (xsr.hasNext()) { + xsr.next(); + } + + Assert.fail("Wellformedness error expected :" + INVALID_XML); + } catch (XMLStreamException e) { + ; // this is expected + } + } + + @Test + public void testNestedXmlns() throws Exception { + + final String VALID_XML = ""; + + try { + XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(VALID_XML)); + + while (xsr.hasNext()) { + xsr.next(); + } + + // expected success + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail("Wellformedness error is not expected: " + VALID_XML + ", " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.dtd.bak --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.dtd.bak Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,19 @@ + + +]> + + + The Publishers + + Alfred Publishing + 15535 Morrison + South Oaks CA 91403 + &max; + + eXtensible Markup Language + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.xml.bak --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.xml.bak Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,19 @@ + + +]> + + + The Publishers + + Alfred Publishing + 15535 Morrison + South Oaks CA 91403 + &max; + + eXtensible Markup Language + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Hello.wsdl.data --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Hello.wsdl.data Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6440324 + * @summary Test StAX can accept non-existent DTD if IS_VALIDATING if false. + */ +public class IsValidatingTest { + + /** + * File with non-existent DTD. + */ + private static final String INPUT_FILE = "IsValidatingTest.xml"; + /** + * File with internal subset and non-existent DTD. + */ + private static final String INPUT_FILE_INTERNAL_SUBSET = "IsValidatingTestInternalSubset.xml"; + + /** + * Test StAX with IS_VALIDATING = false and a non-existent DTD. + * Test should pass. + * + * Try to parse an XML file that references a a non-existent DTD. + * Desired behavior: + * If IS_VALIDATING == false, then continue processing. + * + * Note that an attempt is made to read the DTD even if IS_VALIDATING == false. + * This is not required for DTD validation, but for entity resolution. + * The XML specification allows the optional reading of an external DTD + * even for non-validating processors. + * + */ + @Test + public void testStAXIsValidatingFalse() { + + XMLStreamReader reader = null; + Boolean isValidating = null; + String propertyValues = null; + boolean dtdEventOccured = false; + + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE); + + try { + reader = xif.createXMLStreamReader(this.getClass().getResource(INPUT_FILE).toExternalForm(), this.getClass().getResourceAsStream(INPUT_FILE)); + + isValidating = (Boolean) reader.getProperty(XMLInputFactory.IS_VALIDATING); + propertyValues = "IS_VALIDATING=" + isValidating; + + while (reader.hasNext()) { + int e = reader.next(); + if (e == XMLEvent.DTD) { + dtdEventOccured = true; + System.out.println("testStAXIsValidatingFalse(): " + "reader.getText() with Event == DTD: " + reader.getText()); + } + } + + // expected success + + // should have see DTD Event + if (!dtdEventOccured) { + Assert.fail("Unexpected failure: did not see DTD event"); + } + } catch (Exception e) { + // unexpected failure + System.err.println("Exception with reader.getEventType(): " + reader.getEventType()); + e.printStackTrace(); + Assert.fail("Unexpected failure with " + propertyValues + ", " + e.toString()); + } + } + + /** + * Test StAX with IS_VALIDATING = false, an internal subset and a + * non-existent DTD. + * + * Test should pass. + */ + @Test + public void testStAXIsValidatingFalseInternalSubset() { + + XMLStreamReader reader = null; + Boolean isValidating = null; + String propertyValues = null; + boolean dtdEventOccured = false; + boolean entityReferenceEventOccured = false; + + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE); + xif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE); + + try { + reader = xif.createXMLStreamReader(this.getClass().getResource(INPUT_FILE).toExternalForm(), + this.getClass().getResourceAsStream(INPUT_FILE_INTERNAL_SUBSET)); + + isValidating = (Boolean) reader.getProperty(XMLInputFactory.IS_VALIDATING); + propertyValues = "IS_VALIDATING=" + isValidating; + + while (reader.hasNext()) { + int e = reader.next(); + if (e == XMLEvent.DTD) { + dtdEventOccured = true; + System.out.println("testStAXIsValidatingFalseInternalSubset(): " + "reader.getText() with Event == DTD: " + reader.getText()); + } else if (e == XMLEvent.ENTITY_REFERENCE) { + // expected ENTITY_REFERENCE values? + if (reader.getLocalName().equals("foo") && reader.getText().equals("bar")) { + entityReferenceEventOccured = true; + } + + System.out.println("testStAXIsValidatingFalseInternalSubset(): " + "reader.get(LocalName, Text)() with Event " + " == ENTITY_REFERENCE: " + + reader.getLocalName() + " = " + reader.getText()); + } + } + + // expected success + + // should have see DTD Event + if (!dtdEventOccured) { + Assert.fail("Unexpected failure: did not see DTD event"); + } + + // should have seen an ENITY_REFERENCE Event + if (!entityReferenceEventOccured) { + Assert.fail("Unexpected failure: did not see ENTITY_REFERENCE event"); + } + } catch (Exception e) { + // unexpected failure + System.err.println("Exception with reader.getEventType(): " + reader.getEventType()); + e.printStackTrace(); + Assert.fail("Unexpected failure with " + propertyValues + ", " + e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,30 @@ + + + + + + Hello World! + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTestInternalSubset.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTestInternalSubset.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,32 @@ + + + + +]> + + Hello &foo; World! + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Issue44Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Issue44Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6631262 + * @summary Test XMLStreamReader.getName() shall throw IllegalStateException if current event is not start/end element. + */ +public class Issue44Test { + + @Test + public void testStartElement() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + // File file = new File("./tests/XMLStreamReader/sgml.xml"); + // FileInputStream inputStream = new FileInputStream(file); + XMLStreamReader xsr = xif.createXMLStreamReader(this.getClass().getResourceAsStream("sgml.xml")); + + xsr.getName(); + } catch (IllegalStateException ise) { + // expected + System.out.println(ise.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Issue47Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Issue47Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.StringReader; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.AssertJUnit; +import org.testng.annotations.Test; + +/* + * @bug 6631265 + * @summary Test XMLStreamReader.standaloneSet() presents if input document has a value for "standalone" attribute in xml declaration. + */ +public class Issue47Test { + + @Test + public void testStandaloneSet() { + final String xml = ""; + + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + XMLStreamReader r = xif.createXMLStreamReader(new StringReader(xml)); + Assert.assertTrue(!r.standaloneSet() && !r.isStandalone()); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStandaloneSet1() { + final String xml = ""; + + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + XMLStreamReader r = xif.createXMLStreamReader(new StringReader(xml)); + Assert.assertTrue(r.standaloneSet() && !r.isStandalone()); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStandaloneSet2() { + final String xml = ""; + + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + XMLStreamReader r = xif.createXMLStreamReader(new StringReader(xml)); + AssertJUnit.assertTrue(r.standaloneSet() && r.isStandalone()); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker24.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker24.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.StringReader; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test no prefix is represented by "", not null. + */ +public class IssueTracker24 { + + @Test + public void testInconsistentGetPrefixBehaviorWhenNoPrefix() throws Exception { + String xml = ""; + + XMLInputFactory factory = XMLInputFactory.newInstance(); + XMLStreamReader r = factory.createXMLStreamReader(new StringReader(xml)); + r.require(XMLStreamReader.START_DOCUMENT, null, null); + r.next(); + r.require(XMLStreamReader.START_ELEMENT, null, "root"); + Assert.assertEquals(r.getPrefix(), "", "prefix should be empty string"); + r.next(); + r.require(XMLStreamReader.START_ELEMENT, null, "child"); + r.next(); + r.next(); + r.require(XMLStreamReader.START_ELEMENT, null, "anotherchild"); + Assert.assertEquals(r.getPrefix(), "", "prefix should be empty string"); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker35.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker35.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.InputStream; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test StAX parse xsd document including external DTD. + */ +public class IssueTracker35 { + + @Test + public void testSkippingExternalDTD() throws Exception { + XMLInputFactory xif = XMLInputFactory.newInstance(); + try( + InputStream is= getClass().getResourceAsStream("XMLSchema.xsd"); + ) { + XMLStreamReader reader = xif.createXMLStreamReader(getClass().getResource("XMLSchema.xsd").getFile(), is); + int e; + while ((e = reader.next()) == XMLStreamConstants.COMMENT); + + Assert.assertEquals(e, XMLStreamConstants.DTD, "should be DTD"); + reader.nextTag(); + Assert.assertEquals(reader.getLocalName(), "schema", "next tag should be schema"); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker70.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker70.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.File; +import java.io.FileInputStream; +import java.util.function.Consumer; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test it can retrieve attribute with null or empty name space. + */ +public class IssueTracker70 { + + static private final File testFile = new File(IssueTracker70.class.getResource("IssueTracker70.xml").getFile()); + + @Test + public void testGetAttributeValueWithNullNs() throws Exception { + testGetAttributeValueWithNs(null, "attribute2", this::checkNull); + } + + @Test + public void testGetAttributeValueWithEmptyNs() throws Exception { + testGetAttributeValueWithNs("", "attribute1", this::checkNull); + } + + + private void testGetAttributeValueWithNs(String nameSpace, String attrName, Consumer checker) throws Exception { + XMLInputFactory xif = XMLInputFactory.newInstance(); + XMLStreamReader xsr = xif.createXMLStreamReader(new FileInputStream(testFile)); + + while (xsr.hasNext()) { + xsr.next(); + if (xsr.isStartElement()) { + String v; + v = xsr.getAttributeValue(nameSpace, attrName); + checker.accept(v); + } + } + } + + private void checkNull(String value) + { + Assert.assertNotNull(value, "should have attribute value"); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker70.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker70.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req5.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req5.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req5Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req5Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLStreamReader parses namespace declaration within element when NamespaceAware turns off and on. + */ +public class Jsr173MR1Req5Test { + + private static final String INPUT_FILE1 = "Jsr173MR1Req5.xml"; + + @Test + public void testAttributeCountNoNS() { + XMLInputFactory ifac = XMLInputFactory.newInstance(); + + try { + // Turn off NS awareness to count xmlns as attributes + ifac.setProperty("javax.xml.stream.isNamespaceAware", Boolean.FALSE); + + XMLStreamReader re = ifac.createXMLStreamReader(getClass().getResource(INPUT_FILE1).toExternalForm(), + this.getClass().getResourceAsStream(INPUT_FILE1)); + while (re.hasNext()) { + int event = re.next(); + if (event == XMLStreamConstants.START_ELEMENT) { + // System.out.println("#attrs = " + re.getAttributeCount()); + Assert.assertTrue(re.getAttributeCount() == 3); + } + } + re.close(); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testAttributeCountNS() { + XMLInputFactory ifac = XMLInputFactory.newInstance(); + + try { + // Turn on NS awareness to not count xmlns as attributes + ifac.setProperty("javax.xml.stream.isNamespaceAware", Boolean.TRUE); + + XMLStreamReader re = ifac.createXMLStreamReader(getClass().getResource(INPUT_FILE1).toExternalForm(), + this.getClass().getResourceAsStream(INPUT_FILE1)); + while (re.hasNext()) { + int event = re.next(); + if (event == XMLStreamConstants.START_ELEMENT) { + // System.out.println("#attrs = " + re.getAttributeCount()); + Assert.assertTrue(re.getAttributeCount() == 1); + } + } + re.close(); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req8.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req8.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req8Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req8Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLStreamReader parses attribute with namespace aware. + */ +public class Jsr173MR1Req8Test { + + private static final String INPUT_FILE1 = "Jsr173MR1Req8.xml"; + + @Test + public void testDefaultAttrNS() { + XMLInputFactory ifac = XMLInputFactory.newInstance(); + + try { + XMLStreamReader re = ifac.createXMLStreamReader(getClass().getResource(INPUT_FILE1).toExternalForm(), + this.getClass().getResourceAsStream(INPUT_FILE1)); + while (re.hasNext()) { + int event = re.next(); + if (event == XMLStreamConstants.START_ELEMENT) { + // System.out.println("#attrs = " + re.getAttributeCount()); + Assert.assertTrue(re.getAttributeCount() == 2); + // This works if "" is replaced by null too + // System.out.println("attr1 = " + re.getAttributeValue("", + // "attr1")); + Assert.assertTrue(re.getAttributeValue("", "attr1").equals("pass")); + } + } + re.close(); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/NamespaceTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/NamespaceTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.InputStream; + +import javax.xml.namespace.NamespaceContext; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test StAX parser processes namespace. + */ +public class NamespaceTest { + + String namespaceURI = "foobar.com"; + String rootElement = "foo"; + String childElement = "foochild"; + String prefix = "a"; + + // Add test methods here, they have to start with 'test' name. + // for example: + // public void testHello() {} + + String getXML() { + StringBuffer sbuffer = new StringBuffer(); + sbuffer.append(""); + sbuffer.append("<" + rootElement + " xmlns:"); + sbuffer.append(prefix); + sbuffer.append("=\"" + namespaceURI + "\">"); + sbuffer.append("<" + prefix + ":" + childElement + ">"); + sbuffer.append("blahblah"); + sbuffer.append(""); + sbuffer.append(""); + // System.out.println("XML = " + sbuffer.toString()) ; + return sbuffer.toString(); + } + + @Test + public void testRootElementNamespace() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); + InputStream is = new java.io.ByteArrayInputStream(getXML().getBytes()); + XMLStreamReader sr = xif.createXMLStreamReader(is); + while (sr.hasNext()) { + int eventType = sr.next(); + if (eventType == XMLStreamConstants.START_ELEMENT) { + if (sr.getLocalName().equals(rootElement)) { + Assert.assertTrue(sr.getNamespacePrefix(0).equals(prefix) && sr.getNamespaceURI(0).equals(namespaceURI)); + } + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + @Test + public void testChildElementNamespace() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); + InputStream is = new java.io.ByteArrayInputStream(getXML().getBytes()); + XMLStreamReader sr = xif.createXMLStreamReader(is); + while (sr.hasNext()) { + int eventType = sr.next(); + if (eventType == XMLStreamConstants.START_ELEMENT) { + if (sr.getLocalName().equals(childElement)) { + QName qname = sr.getName(); + Assert.assertTrue(qname.getPrefix().equals(prefix) && qname.getNamespaceURI().equals(namespaceURI) + && qname.getLocalPart().equals(childElement)); + } + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + @Test + public void testNamespaceContext() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); + InputStream is = new java.io.ByteArrayInputStream(getXML().getBytes()); + XMLStreamReader sr = xif.createXMLStreamReader(is); + while (sr.hasNext()) { + int eventType = sr.next(); + if (eventType == XMLStreamConstants.START_ELEMENT) { + if (sr.getLocalName().equals(childElement)) { + NamespaceContext context = sr.getNamespaceContext(); + Assert.assertTrue(context.getPrefix(namespaceURI).equals(prefix)); + } + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + @Test + public void testNamespaceCount() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); + InputStream is = new java.io.ByteArrayInputStream(getXML().getBytes()); + XMLStreamReader sr = xif.createXMLStreamReader(is); + while (sr.hasNext()) { + int eventType = sr.next(); + if (eventType == XMLStreamConstants.START_ELEMENT) { + if (sr.getLocalName().equals(rootElement)) { + int count = sr.getNamespaceCount(); + Assert.assertTrue(count == 1); + } + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/StreamReaderTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/StreamReaderTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLStreamReader.hasName() returns false for ENTITY_REFERENCE. + */ +public class StreamReaderTest { + + /** + * CR 6631264 / sjsxp Issue 45: + * https://sjsxp.dev.java.net/issues/show_bug.cgi?id=45 + * XMLStreamReader.hasName() should return false for ENTITY_REFERENCE + */ + @Test + public void testHasNameOnEntityEvent() throws Exception { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false); + XMLStreamReader r = xif.createXMLStreamReader(this.getClass().getResourceAsStream("ExternalDTD.xml")); + while (r.next() != XMLStreamConstants.ENTITY_REFERENCE) { + System.out.println("event type: " + r.getEventType()); + continue; + } + if (r.hasName()) { + System.out.println("hasName returned true on ENTITY_REFERENCE event."); + } + Assert.assertFalse(r.hasName()); // fails + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/SupportDTDTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/SupportDTDTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import java.io.File; +import java.io.FileInputStream; +import java.io.StringReader; +import java.util.List; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.events.Characters; +import javax.xml.stream.events.DTD; +import javax.xml.stream.events.EntityDeclaration; +import javax.xml.stream.events.EntityReference; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test SUPPORT_DTD and IS_REPLACING_ENTITY_REFERENCES. + */ + +/** +* +* SUPPORT_DTD behavior: +* Regardless of supportDTD, always report a DTD event () and throw an +* exception if an entity reference is found when supportDTD is false +* +* The behavior is related to property IS_REPLACING_ENTITY_REFERENCES. +* +* SUPPORT_DTD Replace Entity DTD ENTITY_REFERENCE +* true (default) true (default) yes, has entities no, return Characters +* true (default) false yes, has entities yes, can print entity name +* false true (default) yes, but no entity Exception: Undeclared general entity +* false false yes, but no entity yes, can print entity name +* +* Two patches related: +* sjsxp issue 9: XMLDocumentScannerImpl.java rev 1.6 +* If the supportDTD property is set to FALSE, external and internal subsets +* are now ignored, rather than an error being reported. In particular, with +* this property set to FALSE, no error is reported if an external subset cannot +* be found. Note that the internal subset is still parsed (and errors could be +* reported here) but no events are returned by the parser. This fixes SJSXP +* issue 9 from Java.net. +* Note: SAX and DOM report fatal errors: +* If either SAX or DOM is used, turning on http://apache.org/xml/features/disallow-doctype-decl [1] effectively disables DTD, +* according to the spec: A fatal error is thrown if the incoming document contains a DOCTYPE declaration. +* The current jaxp implementation actually throws a nullpointexception. A better error message could be used. +* +*/ +public class SupportDTDTest { + final boolean DEBUG = false; + final String _file = "ExternalDTD.xml"; + final String XML = "" + "\n" + "\n" + + "\n" + "\n" + + "\n" + "]>" + "&intEnt;"; + + final String XML1 = "" + "" + "" + "&mkm;" + ""; + + // final String XML1 = "" + "" + "" + // + "&mkm;" + ""; + + final int ENTITY_INTERNAL_ONLY = 1; + final int ENTITY_EXTERNAL_ONLY = 2; + final int ENTITY_BOTH = 3; + + boolean _DTDReturned = false; + boolean _EntityEventReturned = false; + boolean _hasEntityDelaration = false; + boolean _exceptionThrown = false; + + /** Creates a new instance of StreamReader */ + public SupportDTDTest(String name) { + } + + void reset() { + _DTDReturned = false; + _EntityEventReturned = false; + _hasEntityDelaration = false; + _exceptionThrown = false; + } + + // tests 1-4 test internal entities only + @Test + public void test1() { + supportDTD(true, true, ENTITY_INTERNAL_ONLY); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(true, _hasEntityDelaration); + Assert.assertEquals(false, _EntityEventReturned); + } + + @Test + public void test2() { + supportDTD(true, false, ENTITY_INTERNAL_ONLY); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(true, _hasEntityDelaration); + Assert.assertEquals(true, _EntityEventReturned); + } + + @Test + public void test3() { + supportDTD(false, true, ENTITY_INTERNAL_ONLY); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(false, _hasEntityDelaration); + Assert.assertEquals(true, _exceptionThrown); + } + + @Test + public void test4() { + supportDTD(false, false, ENTITY_INTERNAL_ONLY); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(false, _hasEntityDelaration); + Assert.assertEquals(true, _EntityEventReturned); + } + + // tests 5-8 test external entities only + @Test + public void test5() { + supportDTD(true, true, ENTITY_EXTERNAL_ONLY); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(true, _hasEntityDelaration); + Assert.assertEquals(false, _EntityEventReturned); + } + + @Test + public void test6() { + supportDTD(true, false, ENTITY_EXTERNAL_ONLY); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(true, _hasEntityDelaration); + Assert.assertEquals(true, _EntityEventReturned); + } + + @Test + public void test7() { + supportDTD(false, true, ENTITY_EXTERNAL_ONLY); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(false, _hasEntityDelaration); + Assert.assertEquals(true, _exceptionThrown); + } + + @Test + public void test8() { + supportDTD(false, false, ENTITY_EXTERNAL_ONLY); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(false, _hasEntityDelaration); + Assert.assertEquals(true, _EntityEventReturned); + } + + // tests 9-12 test both internal and external entities + @Test + public void test9() { + supportDTD(true, true, ENTITY_BOTH); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(true, _hasEntityDelaration); + Assert.assertEquals(false, _EntityEventReturned); + } + + @Test + public void test10() { + supportDTD(true, false, ENTITY_BOTH); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(true, _hasEntityDelaration); + Assert.assertEquals(true, _EntityEventReturned); + } + + @Test + public void test11() { + supportDTD(false, true, ENTITY_BOTH); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(false, _hasEntityDelaration); + Assert.assertEquals(true, _exceptionThrown); + } + + @Test + public void test12() { + supportDTD(false, false, ENTITY_BOTH); + Assert.assertEquals(true, _DTDReturned); + Assert.assertEquals(false, _hasEntityDelaration); + Assert.assertEquals(true, _EntityEventReturned); + } + + public void supportDTD(boolean supportDTD, boolean replaceEntity, int inputType) { + reset(); + print("\n"); + print((supportDTD ? "SupportDTD=true" : "SupportDTD=false") + ", " + (replaceEntity ? "replaceEntity=true" : "replaceEntity=false")); + try { + XMLInputFactory xif = getFactory(supportDTD, replaceEntity); + XMLEventReader r = getEventReader(xif, inputType); + int eventType = 0; + int count = 0; + while (r.hasNext()) { + XMLEvent event = r.nextEvent(); + eventType = event.getEventType(); + print("Event " + ++count + ": " + eventType); + switch (eventType) { + case XMLStreamConstants.DTD: + DisplayEntities((DTD) event); + _DTDReturned = true; + break; + case XMLStreamConstants.ENTITY_REFERENCE: + print("Entity Name: " + ((EntityReference) event).getName()); + _EntityEventReturned = true; + break; + case XMLStreamConstants.CHARACTERS: + print("Text: " + ((Characters) event).getData()); + } + } + + } catch (Exception e) { + _exceptionThrown = true; + if (DEBUG) + e.printStackTrace(); + } + } + + XMLInputFactory getFactory(boolean supportDTD, boolean replaceEntity) { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setProperty(XMLInputFactory.SUPPORT_DTD, (supportDTD) ? Boolean.TRUE : Boolean.FALSE); + xif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, (replaceEntity) ? Boolean.TRUE : Boolean.FALSE); + // xif.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.TRUE); + return xif; + } + + private XMLEventReader getEventReader(XMLInputFactory inputFactory, int input) throws Exception { + XMLEventReader er = null; + if (input == ENTITY_INTERNAL_ONLY) { + er = inputFactory.createXMLEventReader(new StringReader(XML)); + } else if (input == ENTITY_EXTERNAL_ONLY) { + er = inputFactory.createXMLEventReader(new StringReader(XML1)); + } else { + File file = new File(this.getClass().getResource(_file).getFile()); + FileInputStream inputStream = new FileInputStream(file); + // XMLStreamReader r = xif.createXMLStreamReader(inputStream); + er = inputFactory.createXMLEventReader(inputStream); + } + return er; + } + + void DisplayEntities(DTD event) { + List entities = event.getEntities(); + if (entities == null) { + _hasEntityDelaration = false; + print("No entity found."); + } else { + _hasEntityDelaration = true; + for (int i = 0; i < entities.size(); i++) { + EntityDeclaration entity = (EntityDeclaration) entities.get(i); + print(entity.getName()); + } + } + + } + + void print(String s) { + if (DEBUG) + System.out.println(s); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/UTF16-BE.wsdl.data --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/UTF16-BE.wsdl.data Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/UTF8-BOM.xml.data --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/UTF8-BOM.xml.data Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,1 @@ + 12345678 person.addressperson.administrativeGenderCodeperson.birthTimeMatthewBarrowperson.name diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/VoiceXMLDTDTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/VoiceXMLDTDTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamReader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test parsing Voice XML DTD. + */ +public class VoiceXMLDTDTest { + + private static final String INPUT_FILE1 = "voicexml.xml"; + + @Test + public void test() { + XMLInputFactory ifac = XMLInputFactory.newInstance(); + + try { + XMLStreamReader re = ifac.createXMLStreamReader(getClass().getResource(INPUT_FILE1).toExternalForm(), + this.getClass().getResourceAsStream(INPUT_FILE1)); + while (re.hasNext()) { + int event = re.next(); + } + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XML11Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XML11Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamReaderTest; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test parsing xml 1.1. + */ +public class XML11Test { + + @Test + public void test() { + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + XMLEventReader reader = xif.createXMLEventReader(this.getClass().getResourceAsStream("xml11.xml.data")); + while (reader.hasNext()) + reader.next(); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XMLSchema.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XMLSchema.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,402 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%xs-datatypes; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XMLSchema.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XMLSchema.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2534 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]> + + + + Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp + Part 2 version: Id: datatypes.xsd,v 1.3 2004/01/23 18:11:13 ht Exp + + + + + + The schema corresponding to this document is normative, + with respect to the syntactic constraints it expresses in the + XML Schema language. The documentation (within <documentation> elements) + below, is not normative, but rather highlights important aspects of + the W3C Recommendation of which this is a part + + + + + The simpleType element and all of its members are defined + towards the end of this schema document + + + + + + Get access to the xml: attribute groups for xml:lang + as declared on 'schema' and 'documentation' below + + + + + + + + This type is extended by almost all schema types + to allow attributes from other namespaces to be + added to user schemas. + + + + + + + + + + + + + This type is extended by all types which allow annotation + other than <schema> itself + + + + + + + + + + + + + + + + This group is for the + elements which occur freely at the top level of schemas. + All of their types are based on the "annotated" type by extension. + + + + + + + + + + + + + This group is for the + elements which can self-redefine (see <redefine> below). + + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + A utility type, not for public use + + #all or (possibly empty) subset of {extension, restriction} + + + + + + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + + + A utility type, not for public use + + #all or (possibly empty) subset of {extension, restriction, list, union} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + for maxOccurs + + + + + + + + + + + + for all particles + + + + + + + for element, group and attributeGroup, + which both define and reference + + + + + + + + 'complexType' uses this + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This branch is short for + <complexContent> + <restriction base="xs:anyType"> + ... + </restriction> + </complexContent> + + + + + + + + + + + + + + + Will be restricted to required or forbidden + + + + + + Not allowed if simpleContent child is chosen. + May be overriden by setting on complexContent child. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This choice is added simply to + make this a valid restriction per the REC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Overrides any setting on complexType parent. + + + + + + + + + + + + + + + This choice is added simply to + make this a valid restriction per the REC + + + + + + + + + + + + + + + + + No typeDefParticle group reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A utility type, not for public use + + #all or (possibly empty) subset of {substitution, extension, + restriction} + + + + + + + + + + + + + + + + + + + + + + + + + The element element can be used either + at the top level to define an element-type binding globally, + or within a content model to either reference a globally-defined + element or type or declare an element-type binding locally. + The ref form is not allowed at the top level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + group type for explicit groups, named top-level groups and + group references + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + group type for the three kinds of group + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This choice with min/max is here to + avoid a pblm with the Elt:All/Choice/Seq + Particle derivation constraint + + + + + + + + + + restricted max/min + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Only elements allowed inside + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + simple type for the value of the 'namespace' attr of + 'any' and 'anyAttribute' + + + + Value is + ##any - - any non-conflicting WFXML/attribute at all + + ##other - - any non-conflicting WFXML/attribute from + namespace other than targetNS + + ##local - - any unqualified non-conflicting WFXML/attribute + + one or - - any non-conflicting WFXML/attribute from + more URI the listed namespaces + references + (space separated) + + ##targetNamespace or ##local may appear in the above list, to + refer to the targetNamespace of the enclosing + schema or an absent targetNamespace respectively + + + + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A subset of XPath expressions for use +in selectors + A utility type, not for public +use + + + + The following pattern is intended to allow XPath + expressions per the following EBNF: + Selector ::= Path ( '|' Path )* + Path ::= ('.//')? Step ( '/' Step )* + Step ::= '.' | NameTest + NameTest ::= QName | '*' | NCName ':' '*' + child:: is also allowed + + + + + + + + + + + + + + + + + + + + + + + A subset of XPath expressions for use +in fields + A utility type, not for public +use + + + + The following pattern is intended to allow XPath + expressions per the same EBNF as for selector, + with the following change: + Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest ) + + + + + + + + + + + + + + + + + + + + + + + + + + + The three kinds of identity constraints, all with + type of or derived from 'keybase'. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A utility type, not for public use + + A public identifier, per ISO 8879 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + notations for use within XML Schema schemas + + + + + + + + + Not the real urType, but as close an approximation as we can + get in the XML representation + + + + + + + + + + First the built-in primitive datatypes. These definitions are for + information only, the real built-in definitions are magic. + + + + For each built-in datatype in this schema (both primitive and + derived) can be uniquely addressed via a URI constructed + as follows: + 1) the base URI is the URI of the XML Schema namespace + 2) the fragment identifier is the name of the datatype + + For example, to address the int datatype, the URI is: + + http://www.w3.org/2001/XMLSchema#int + + Additionally, each facet definition element can be uniquely + addressed via a URI constructed as follows: + 1) the base URI is the URI of the XML Schema namespace + 2) the fragment identifier is the name of the facet + + For example, to address the maxInclusive facet, the URI is: + + http://www.w3.org/2001/XMLSchema#maxInclusive + + Additionally, each facet usage in a built-in datatype definition + can be uniquely addressed via a URI constructed as follows: + 1) the base URI is the URI of the XML Schema namespace + 2) the fragment identifier is the name of the datatype, followed + by a period (".") followed by the name of the facet + + For example, to address the usage of the maxInclusive facet in + the definition of int, the URI is: + + http://www.w3.org/2001/XMLSchema#int.maxInclusive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NOTATION cannot be used directly in a schema; rather a type + must be derived from it by specifying at least one enumeration + facet whose value is the name of a NOTATION declared in the + schema. + + + + + + + + + + Now the derived primitive types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pattern specifies the content of section 2.12 of XML 1.0e2 + and RFC 3066 (Revised version of RFC 1766). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pattern matches production 7 from the XML spec + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pattern matches production 5 from the XML spec + + + + + + + + + + + + + + + pattern matches production 4 from the Namespaces in XML spec + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + + + + + #all or (possibly empty) subset of {restriction, union, list} + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Can be restricted to required or forbidden + + + + + + + + + + + + + + + + + + Required at the top level + + + + + + + + + + + + + + + + + + + Forbidden when nested + + + + + + + + + + + + + + + + + + + We should use a substitution group for facets, but + that's ruled out because it would allow users to + add their own, which we're not ready for yet. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + base attribute and simpleType child are mutually + exclusive, but one or other is required + + + + + + + + + + + + + + + + itemType attribute and simpleType child are mutually + exclusive, but one or other is required + + + + + + + + + + + + + + + + + + memberTypes attribute must be non-empty or there must be + at least one simpleType child + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/datatypes.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/datatypes.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/report.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/report.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/sgml.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/sgml.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,101 @@ + + +Getting started with SGML + +The business challenge + +With the ever-changing and growing global market, companies and + large organizations are searching for ways to become more viable and + competitive. Downsizing and other cost-cutting measures demand more + efficient use of corporate resources. One very important resource is + an organization's information. +As part of the move toward integrated information management, +whole industries are developing and implementing standards for +exchanging technical information. This report describes how one such +standard, the Standard Generalized Markup Language (SGML), works as +part of an overall information management strategy. + + +Getting to know SGML + +While SGML is a fairly recent technology, the use of +markup in computer-generated documents has existed for a +while. +
+What is markup, or everything you always wanted to know about +document preparation but were afraid to ask? + +Markup is everything in a document that is not content. The +traditional meaning of markup is the manual marking up +of typewritten text to give instructions for a typesetter or +compositor about how to fit the text on a page and what typefaces to +use. This kind of markup is known as procedural markup. + +Procedural markup +Most electronic publishing systems today use some form of +procedural markup. Procedural markup codes are good for one +presentation of the information. + +Generic markup +Generic markup (also known as descriptive markup) describes the +purpose of the text in a document. A basic concept of +generic markup is that the content of a document must be separate from +the style. Generic markup allows for multiple presentations of the +information. + +Drawbacks of procedural markup +Industries involved in technical documentation increasingly +prefer generic over procedural markup schemes. When a company changes +software or hardware systems, enormous data translation tasks arise, +often resulting in errors.
+
+What <emph>is</emph> SGML in the grand scheme of the universe, anyway? + +SGML defines a strict markup scheme with a syntax for defining +document data elements and an overall framework for marking up +documents. +SGML can describe and create documents that are not dependent on +any hardware, software, formatter, or operating system. Since SGML documents +conform to an international standard, they are portable.
+
+How is SGML and would you recommend it to your grandmother? + +You can break a typical document into three layers: structure, +content, and style. SGML works by separating these three aspects and +deals mainly with the relationship between structure and content. + +Structure +At the heart of an SGML application is a file called the DTD, or +Document Type Definition. The DTD sets up the structure of a document, +much like a database schema describes the types of information it +handles. +A database schema also defines the relationships between the +various types of data. Similarly, a DTD specifies rules +to help ensure documents have a consistent, logical structure. + +Content +Content is the information itself. The method for identifying +the information and its meaning within this framework is called +tagging. Tagging must +conform to the rules established in the DTD (see ). + + +Style +SGML does not standardize style or other processing methods for +information stored in SGML.
+ +Resources +
+Conferences, tutorials, and training + +The Graphic Communications Association has been +instrumental in the development of SGML. GCA provides conferences, +tutorials, newsletters, and publication sales for both members and +non-members. +Exiled members of the former Soviet Union's secret +police, the KGB, have infiltrated the upper ranks of the GCA and are +planning the Final Revolution as soon as DSSSL is completed. + +
+
+
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/voicexml.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/voicexml.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/vxml.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/vxml.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,474 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/xml11.xml.data --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/xml11.xml.data Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,23 @@ + + + + +]> + +x9 : +xA : + +xD : +x20 to x7E : ! " # $ % ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ +x85 : … +x2028 : 
 +xA0-xD7FF :   ŀ ʀ Ԁ ਀ ᐀ ⠀ 倀 ꀀ +xE000-xFFFD : � +x10000-x10FFFF : က0က1ခ1ကFဂ7ဏ1၂1Ⴋ1ἀ1ᓰ5᫰5ᬀ0᳿7ᷲ9ỿ1ဏA0ဏ08ဏABဟ08ီCD၊AAၖ78ႫCDჿ05ჿFAჿFF + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/AttributeEscapeTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/AttributeEscapeTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/* + * @summary Test XMLStreamWriter shall escape the illegal characters. + */ +public class AttributeEscapeTest { + + /** + * XML content for testing the escaping of <, >, &, ', ". + */ + private static final String XML_CONTENT = "Testing escaping: lt=<, gt=>, amp=&, apos=', dquote=\""; + + @Test + public void testCR6420953() { + + try { + XMLOutputFactory xof = XMLOutputFactory.newInstance(); + StringWriter sw = new StringWriter(); + XMLStreamWriter w = xof.createXMLStreamWriter(sw); + + w.writeStartDocument(); + w.writeStartElement("element"); + + w.writeDefaultNamespace(XML_CONTENT); + w.writeNamespace("prefix", XML_CONTENT); + + w.writeAttribute("attribute", XML_CONTENT); + w.writeAttribute(XML_CONTENT, "attribute2", XML_CONTENT); + w.writeAttribute("prefix", XML_CONTENT, "attribute3", XML_CONTENT); + + w.writeCharacters("\n"); + w.writeCharacters(XML_CONTENT); + w.writeCharacters("\n"); + w.writeCharacters(XML_CONTENT.toCharArray(), 0, XML_CONTENT.length()); + w.writeCharacters("\n"); + + w.writeEndElement(); + w.writeEndDocument(); + w.flush(); + + System.out.println(sw); + + // make sure that the generated XML parses + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.newDocumentBuilder().parse(new InputSource(new StringReader(sw.toString()))); + } catch (XMLStreamException xmlStreamException) { + xmlStreamException.printStackTrace(); + Assert.fail(xmlStreamException.toString()); + } catch (SAXException saxException) { + saxException.printStackTrace(); + Assert.fail(saxException.toString()); + } catch (ParserConfigurationException parserConfigurationException) { + parserConfigurationException.printStackTrace(); + Assert.fail(parserConfigurationException.toString()); + } catch (IOException ioException) { + ioException.printStackTrace(); + Assert.fail(ioException.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6452107.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6452107.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.ByteArrayOutputStream; +import java.io.OutputStream; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6452107 + * @summary Test StAX can write ISO-8859-1 encoding XML. + */ +public class Bug6452107 { + + /** + * Ensure that charset aliases are checked. The encoding ISO-8859-1 is + * returned as ISO8859_1 by the underlying writer. Thus, if alias are not + * inspected, this test throws an exception. + */ + @Test + public void test() { + final String ENCODING = "ISO-8859-1"; + + try { + OutputStream out = new ByteArrayOutputStream(); + XMLOutputFactory factory = XMLOutputFactory.newInstance(); + XMLStreamWriter writer = factory.createXMLStreamWriter(out, ENCODING); + writer.writeStartDocument(ENCODING, "1.0"); + } catch (XMLStreamException e) { + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6600882Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6600882Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.ByteArrayOutputStream; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6600882 + * @summary Test toString(), hashCode() of XMLStreamWriter . + */ +public class Bug6600882Test { + + + @Test + public void test() { + try { + XMLOutputFactory of = XMLOutputFactory.newInstance(); + XMLStreamWriter w = of.createXMLStreamWriter(new ByteArrayOutputStream()); + XMLStreamWriter w1 = of.createXMLStreamWriter(new ByteArrayOutputStream()); + System.out.println(w); + Assert.assertTrue(w.equals(w) && w.hashCode() == w.hashCode()); + Assert.assertFalse(w1.equals(w)); + } catch (Throwable ex) { + Assert.fail(ex.toString()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6675332Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6675332Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.StringWriter; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import util.BaseStAXUT; + +/* + * @bug 6675332 + * @summary Test XMLStreamWriter writeAttribute when IS_REPAIRING_NAMESPACES is true. + */ +public class Bug6675332Test extends BaseStAXUT { + + private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance(); + + @Test + public void test() { + final String URL_P1 = "http://p1.org"; + final String URL_DEF = "urn:default"; + final String ATTR_VALUE = "'value\""; + final String ATTR_VALUE2 = ""; + + final String TEXT = " some text\n"; + XML_OUTPUT_FACTORY.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE); + + final String EXPECTED_OUTPUT = ""; + XMLStreamWriter w = null; + StringWriter strw = new StringWriter(); + try { + w = XML_OUTPUT_FACTORY.createXMLStreamWriter(strw); + + w.writeStartDocument(); + + /* + * Calling this method should be optional; but if we call it, + * exceptation is that it does properly bind the prefix and URL as + * the 'preferred' combination. In this case we'll just try to make + * URL bound as the default namespace + */ + w.setDefaultNamespace(URL_DEF); + w.writeStartElement(URL_DEF, "test"); // root + + /* + * And let's further make element and attribute(s) belong to that + * same namespace + */ + w.writeStartElement("", "leaf", URL_DEF); // 1st leaf + w.writeAttribute("", URL_DEF, "attr", ATTR_VALUE); + w.writeAttribute(URL_DEF, "attr2", ATTR_VALUE); + w.writeEndElement(); + + // w.writeEmptyElement("", "leaf"); // 2nd leaf; in empty/no + // namespace! + + w.writeStartElement(URL_DEF, "leaf"); // 3rd leaf + // w.writeAttribute("", "attr2", ATTR_VALUE2); // in empty/no + // namespace + w.writeEndElement(); + + w.writeEndElement(); // root elem + w.writeEndDocument(); + w.close(); + System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\n"); + System.out.println(strw.toString()); + + // And then let's parse and verify it all: + // System.err.println("testAttributes: doc = '"+strw+"'"); + + XMLStreamReader sr = constructNsStreamReader(strw.toString()); + assertTokenType(START_DOCUMENT, sr.getEventType(), sr); + + // root element + assertTokenType(START_ELEMENT, sr.next(), sr); + Assert.assertEquals("test", sr.getLocalName()); + Assert.assertEquals(URL_DEF, sr.getNamespaceURI()); + + // first leaf: + assertTokenType(START_ELEMENT, sr.next(), sr); + Assert.assertEquals("leaf", sr.getLocalName()); + Assert.assertEquals(URL_DEF, sr.getNamespaceURI()); + System.out.println(sr.getAttributeLocalName(0)); + System.out.println(sr.getAttributeLocalName(1)); + Assert.assertEquals(2, sr.getAttributeCount()); + Assert.assertEquals("attr", sr.getAttributeLocalName(0)); + + String uri = sr.getAttributeNamespace(0); + if (!URL_DEF.equals(uri)) { + Assert.fail("Expected attribute 'attr' to have NS '" + URL_DEF + "', was " + valueDesc(uri) + "; input = '" + strw + "'"); + } + Assert.assertEquals(ATTR_VALUE, sr.getAttributeValue(0)); + assertTokenType(END_ELEMENT, sr.next(), sr); + Assert.assertEquals("leaf", sr.getLocalName()); + Assert.assertEquals(URL_DEF, sr.getNamespaceURI()); + + // 2nd/empty leaf + /** + * assertTokenType(START_ELEMENT, sr.next(), sr); + * assertEquals("leaf", sr.getLocalName()); assertNoNsURI(sr); + * assertTokenType(END_ELEMENT, sr.next(), sr); assertEquals("leaf", + * sr.getLocalName()); assertNoNsURI(sr); + */ + // third leaf + assertTokenType(START_ELEMENT, sr.next(), sr); + Assert.assertEquals("leaf", sr.getLocalName()); + Assert.assertEquals(URL_DEF, sr.getNamespaceURI()); + + /* + * attr in 3rd leaf, in empty/no namespace assertEquals(1, + * sr.getAttributeCount()); assertEquals("attr2", + * sr.getAttributeLocalName(0)); + * assertNoAttrNamespace(sr.getAttributeNamespace(0)); + * assertEquals(ATTR_VALUE2, sr.getAttributeValue(0)); + */ + assertTokenType(END_ELEMENT, sr.next(), sr); + Assert.assertEquals("leaf", sr.getLocalName()); + Assert.assertEquals(URL_DEF, sr.getNamespaceURI()); + + // closing root element + assertTokenType(END_ELEMENT, sr.next(), sr); + Assert.assertEquals("test", sr.getLocalName()); + Assert.assertEquals(URL_DEF, sr.getNamespaceURI()); + + assertTokenType(END_DOCUMENT, sr.next(), sr); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug7037352Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug7037352Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import javax.xml.XMLConstants; +import javax.xml.namespace.NamespaceContext; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 7037352 + * @summary Test XMLStreamWriter.getNamespaceContext().getPrefix with XML_NS_URI and XMLNS_ATTRIBUTE_NS_URI. + */ +public class Bug7037352Test { + + @Test + public void test() { + try { + XMLOutputFactory xof = XMLOutputFactory.newInstance(); + StreamResult sr = new StreamResult(); + XMLStreamWriter xsw = xof.createXMLStreamWriter(sr); + NamespaceContext nc = xsw.getNamespaceContext(); + System.out.println(nc.getPrefix(XMLConstants.XML_NS_URI)); + System.out.println(" expected result: " + XMLConstants.XML_NS_PREFIX); + System.out.println(nc.getPrefix(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)); + System.out.println(" expected result: " + XMLConstants.XMLNS_ATTRIBUTE); + + Assert.assertTrue(nc.getPrefix(XMLConstants.XML_NS_URI) == XMLConstants.XML_NS_PREFIX); + Assert.assertTrue(nc.getPrefix(XMLConstants.XMLNS_ATTRIBUTE_NS_URI) == XMLConstants.XMLNS_ATTRIBUTE); + + } catch (Throwable ex) { + Assert.fail(ex.toString()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/DOMUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/DOMUtil.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Iterator; + +import javax.xml.XMLConstants; +import javax.xml.namespace.NamespaceContext; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.FactoryConfigurationError; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class DOMUtil { + + private static DocumentBuilder db; + + private static String fixNull(String s) { + if (s == null) + return ""; + else + return s; + } + + /** + * Creates a new DOM document. + */ + public static Document createDom() { + synchronized (DOMUtil.class) { + if (db == null) { + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + db = dbf.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + throw new FactoryConfigurationError(e); + } + } + return db.newDocument(); + } + } + + public static Node createDOMNode(InputStream inputStream) { + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(false); + try { + DocumentBuilder builder = dbf.newDocumentBuilder(); + try { + return builder.parse(inputStream); + } catch (SAXException e) { + e.printStackTrace(); // To change body of catch statement use + // File | Settings | File Templates. + } catch (IOException e) { + e.printStackTrace(); // To change body of catch statement use + // File | Settings | File Templates. + } + } catch (ParserConfigurationException pce) { + IllegalArgumentException iae = new IllegalArgumentException(pce.getMessage()); + iae.initCause(pce); + throw iae; + } + return null; + } + + public static void serializeNode(Element node, XMLStreamWriter writer) throws XMLStreamException { + String nodePrefix = fixNull(node.getPrefix()); + String nodeNS = fixNull(node.getNamespaceURI()); + + // See if nodePrefix:nodeNS is declared in writer's NamespaceContext + // before writing start element + // Writing start element puts nodeNS in NamespaceContext even though + // namespace declaration not written + boolean prefixDecl = isPrefixDeclared(writer, nodeNS, nodePrefix); + + writer.writeStartElement(nodePrefix, node.getLocalName(), nodeNS); + + if (node.hasAttributes()) { + NamedNodeMap attrs = node.getAttributes(); + int numOfAttributes = attrs.getLength(); + // write namespace declarations first. + // if we interleave this with attribue writing, + // Zephyr will try to fix it and we end up getting inconsistent + // namespace bindings. + for (int i = 0; i < numOfAttributes; i++) { + Node attr = attrs.item(i); + String nsUri = fixNull(attr.getNamespaceURI()); + if (nsUri.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) { + // handle default ns declarations + String local = attr.getLocalName().equals(XMLConstants.XMLNS_ATTRIBUTE) ? "" : attr.getLocalName(); + if (local.equals(nodePrefix) && attr.getNodeValue().equals(nodeNS)) { + prefixDecl = true; + } + // this is a namespace declaration, not an attribute + writer.setPrefix(attr.getLocalName(), attr.getNodeValue()); + writer.writeNamespace(attr.getLocalName(), attr.getNodeValue()); + } + } + } + // node's namespace is not declared as attribute, but declared on + // ancestor + if (!prefixDecl) { + writer.writeNamespace(nodePrefix, nodeNS); + } + + // Write all other attributes which are not namespace decl. + if (node.hasAttributes()) { + NamedNodeMap attrs = node.getAttributes(); + int numOfAttributes = attrs.getLength(); + + for (int i = 0; i < numOfAttributes; i++) { + Node attr = attrs.item(i); + String attrPrefix = fixNull(attr.getPrefix()); + String attrNS = fixNull(attr.getNamespaceURI()); + if (!attrNS.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) { + String localName = attr.getLocalName(); + if (localName == null) { + // TODO: this is really a bug in the caller for not + // creating proper DOM tree. + // will remove this workaround after plugfest + localName = attr.getNodeName(); + } + boolean attrPrefixDecl = isPrefixDeclared(writer, attrNS, attrPrefix); + if (!attrPrefix.equals("") && !attrPrefixDecl) { + // attr has namespace but namespace decl is there in + // ancestor node + // So write the namespace decl before writing the attr + writer.setPrefix(attr.getLocalName(), attr.getNodeValue()); + writer.writeNamespace(attrPrefix, attrNS); + } + writer.writeAttribute(attrPrefix, attrNS, localName, attr.getNodeValue()); + } + } + } + + if (node.hasChildNodes()) { + NodeList children = node.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node child = children.item(i); + switch (child.getNodeType()) { + case Node.PROCESSING_INSTRUCTION_NODE: + writer.writeProcessingInstruction(child.getNodeValue()); + case Node.DOCUMENT_TYPE_NODE: + break; + case Node.CDATA_SECTION_NODE: + writer.writeCData(child.getNodeValue()); + break; + case Node.COMMENT_NODE: + writer.writeComment(child.getNodeValue()); + break; + case Node.TEXT_NODE: + writer.writeCharacters(child.getNodeValue()); + break; + case Node.ELEMENT_NODE: + serializeNode((Element) child, writer); + break; + } + } + } + writer.writeEndElement(); + } + + private static boolean isPrefixDeclared(XMLStreamWriter writer, String nsUri, String prefix) { + boolean prefixDecl = false; + NamespaceContext nscontext = writer.getNamespaceContext(); + Iterator prefixItr = nscontext.getPrefixes(nsUri); + while (prefixItr.hasNext()) { + if (prefix.equals(prefixItr.next())) { + prefixDecl = true; + break; + } + } + return prefixDecl; + } + + /** + * Gets the first child of the given name, or null. + */ + public static Element getFirstChild(Element e, String nsUri, String local) { + for (Node n = e.getFirstChild(); n != null; n = n.getNextSibling()) { + if (n.getNodeType() == Node.ELEMENT_NODE) { + Element c = (Element) n; + if (c.getLocalName().equals(local) && c.getNamespaceURI().equals(nsUri)) + return c; + } + } + return null; + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/DomUtilTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/DomUtilTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; +import javax.xml.transform.Result; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.testng.annotations.Test; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.xml.sax.SAXException; + +/* + * @summary Test XMLStreamWriter writes a soap message. + */ +public class DomUtilTest { + + private XMLOutputFactory staxOut; + final File folder = new File(System.getProperty("tempdir") + "/classes/soapmessages"); + private static final String INPUT_FILE1 = "message_12.xml"; + + public void setup() { + this.staxOut = XMLOutputFactory.newInstance(); + staxOut.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true); + } + + @Test + public void testSOAPEnvelope1() throws Exception { + setup(); + + File f = new File(this.getClass().getResource(INPUT_FILE1).getFile()); + System.out.println("***********" + f.getName() + "***********"); + DOMSource src = makeDomSource(f); + Node node = src.getNode(); + XMLStreamWriter writer = staxOut.createXMLStreamWriter(new PrintStream(System.out)); + DOMUtil.serializeNode((Element) node.getFirstChild(), writer); + writer.close(); + assert (true); + System.out.println("*****************************************"); + + } + + public static DOMSource makeDomSource(File f) throws Exception { + InputStream is = new FileInputStream(f); + DOMSource domSource = new DOMSource(createDOMNode(is)); + return domSource; + } + + public static void printNode(Node node) { + DOMSource source = new DOMSource(node); + String msgString = null; + try { + Transformer xFormer = TransformerFactory.newInstance().newTransformer(); + xFormer.setOutputProperty("omit-xml-declaration", "yes"); + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + Result result = new StreamResult(outStream); + xFormer.transform(source, result); + outStream.writeTo(System.out); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + public static Node createDOMNode(InputStream inputStream) { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(false); + try { + DocumentBuilder builder = dbf.newDocumentBuilder(); + try { + return builder.parse(inputStream); + } catch (SAXException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } catch (ParserConfigurationException pce) { + IllegalArgumentException iae = new IllegalArgumentException(pce.getMessage()); + iae.initCause(pce); + throw iae; + } + return null; + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/EmptyElementTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/EmptyElementTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.ByteArrayOutputStream; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLStreamWriter writes namespace and attribute after writeEmptyElement. + */ +public class EmptyElementTest { + + // expected output + private static final String EXPECTED_OUTPUT = "" + "" + + "" + ""; + + XMLStreamWriter xmlStreamWriter; + ByteArrayOutputStream byteArrayOutputStream; + XMLOutputFactory xmlOutputFactory; + + @Test + public void testWriterOnLinux() throws Exception { + + // setup XMLStreamWriter + try { + byteArrayOutputStream = new ByteArrayOutputStream(); + xmlOutputFactory = XMLOutputFactory.newInstance(); + xmlOutputFactory.setProperty(xmlOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true)); + xmlStreamWriter = xmlOutputFactory.createXMLStreamWriter(byteArrayOutputStream); + } catch (Exception e) { + System.err.println("Unexpected Exception: " + e.toString()); + e.printStackTrace(); + Assert.fail(e.toString()); + } + + // create & write a document + try { + xmlStreamWriter.writeStartDocument(); + xmlStreamWriter.writeStartElement("hello"); + xmlStreamWriter.writeDefaultNamespace("http://hello"); + xmlStreamWriter.writeEmptyElement("world"); + xmlStreamWriter.writeDefaultNamespace("http://world"); + xmlStreamWriter.writeAttribute("prefixes", "foo bar"); + xmlStreamWriter.writeEndElement(); + xmlStreamWriter.writeEndDocument(); + xmlStreamWriter.flush(); + String actualOutput = byteArrayOutputStream.toString(); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + System.err.println("Unexpected Exception: " + e.toString()); + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/EncodingTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/EncodingTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.ByteArrayOutputStream; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLStreamWriter writes a document with encoding setting. + */ +public class EncodingTest { + + private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance(); + + /* + * Tests writing a document with UTF-8 encoding, by setting UTF-8 on writer. + */ + @Test + public void testWriteStartDocumentUTF8() { + + final String EXPECTED_OUTPUT = ""; + XMLStreamWriter writer = null; + ByteArrayOutputStream byteArrayOutputStream = null; + + try { + byteArrayOutputStream = new ByteArrayOutputStream(); + writer = XML_OUTPUT_FACTORY.createXMLStreamWriter(byteArrayOutputStream, "UTF-8"); + + writer.writeStartDocument("UTF-8", "1.0"); + writer.writeStartElement("root"); + writer.writeEndElement(); + writer.writeEndDocument(); + writer.flush(); + + String actualOutput = byteArrayOutputStream.toString(); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + + } + + /* + * Tests writing a document with UTF-8 encoding on default enocding writer. + * This scenario should result in an exception as default encoding is ASCII. + */ + @Test + public void testWriteStartDocumentUTF8Fail() { + + XMLStreamWriter writer = null; + ByteArrayOutputStream byteArrayOutputStream = null; + + // pick a different encoding to use v. default encoding + String defaultCharset = java.nio.charset.Charset.defaultCharset().name(); + String useCharset = "UTF-8"; + if (useCharset.equals(defaultCharset)) { + useCharset = "US-ASCII"; + } + + System.out.println("defaultCharset = " + defaultCharset + ", useCharset = " + useCharset); + + try { + byteArrayOutputStream = new ByteArrayOutputStream(); + writer = XML_OUTPUT_FACTORY.createXMLStreamWriter(byteArrayOutputStream); + + writer.writeStartDocument(useCharset, "1.0"); + writer.writeStartElement("root"); + writer.writeEndElement(); + writer.writeEndDocument(); + writer.flush(); + + Assert.fail("Expected XMLStreamException as default underlying stream encoding of " + defaultCharset + + " differs from explicitly specified encoding of " + useCharset); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NamespaceTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NamespaceTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,1439 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +import javax.xml.XMLConstants; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import com.sun.xml.internal.stream.writers.XMLStreamWriterImpl; + +/* + * @summary Test the writing of Namespaces. + */ +public class NamespaceTest { + + /** debug output? */ + private static final boolean DEBUG = true; + + /** Factory to reuse. */ + XMLOutputFactory xmlOutputFactory = null; + + /** Writer to reuse. */ + XMLStreamWriter xmlStreamWriter = null; + + /** OutputStream to reuse. */ + ByteArrayOutputStream byteArrayOutputStream = null; + + @BeforeMethod + public void setUp() { + + // want a Factory that repairs Namespaces + xmlOutputFactory = XMLOutputFactory.newInstance(); + xmlOutputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE); + + // new OutputStream + byteArrayOutputStream = new ByteArrayOutputStream(); + + // new Writer + try { + xmlStreamWriter = xmlOutputFactory.createXMLStreamWriter(byteArrayOutputStream, "utf-8"); + + } catch (XMLStreamException xmlStreamException) { + Assert.fail(xmlStreamException.toString()); + } + } + + /** + * Reset Writer for reuse. + */ + private void resetWriter() { + // reset the Writer + try { + xmlStreamWriter.flush(); + xmlStreamWriter.close(); + ((XMLStreamWriterImpl) xmlStreamWriter).reset(); + byteArrayOutputStream.reset(); + ((XMLStreamWriterImpl) xmlStreamWriter).setOutput(new StreamResult(byteArrayOutputStream), "utf-8"); + } catch (XMLStreamException xmlStreamException) { + Assert.fail(xmlStreamException.toString()); + } catch (IOException ioException) { + Assert.fail(ioException.toString()); + } + } + + @Test + public void testDoubleXmlNs() { + try { + + xmlStreamWriter.writeStartDocument(); + xmlStreamWriter.writeStartElement("foo"); + xmlStreamWriter.writeNamespace("xml", XMLConstants.XML_NS_URI); + xmlStreamWriter.writeAttribute("xml", XMLConstants.XML_NS_URI, "lang", "ja_JP"); + xmlStreamWriter.writeCharacters("Hello"); + xmlStreamWriter.writeEndElement(); + xmlStreamWriter.writeEndDocument(); + + xmlStreamWriter.flush(); + String actualOutput = byteArrayOutputStream.toString(); + + if (DEBUG) { + System.out.println("testDoubleXmlNs(): actualOutput: " + actualOutput); + } + + // there should be no xmlns:xml + Assert.assertTrue(actualOutput.split("xmlns:xml").length == 1, "Expected 0 xmlns:xml, actual output: " + actualOutput); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } + } + + @Test + public void testDuplicateNamespaceURI() throws Exception { + + xmlStreamWriter.writeStartDocument(); + xmlStreamWriter.writeStartElement(new String(""), "localName", new String("nsUri")); + xmlStreamWriter.writeNamespace(new String(""), new String("nsUri")); + xmlStreamWriter.writeEndElement(); + xmlStreamWriter.writeEndDocument(); + + xmlStreamWriter.flush(); + String actualOutput = byteArrayOutputStream.toString(); + + if (DEBUG) { + System.out.println("testDuplicateNamespaceURI(): actualOutput: " + actualOutput); + } + + // there must be only 1 xmlns=... + Assert.assertTrue(actualOutput.split("xmlns").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput); + } + + // TODO: test with both "" & null + // NDW: There's no distinction in XML between a "null" namespace URI and one + // with a URI of "" (the empty string) so I haven't tried to call out any + // such distinctions. + + // ---------------- Current default namespace is "" ---------------- + + private void startDocumentEmptyDefaultNamespace(XMLStreamWriter xmlStreamWriter) throws XMLStreamException { + + xmlStreamWriter.writeStartDocument(); + xmlStreamWriter.writeStartElement("root"); + xmlStreamWriter.writeDefaultNamespace(""); + } + + private String endDocumentEmptyDefaultNamespace(XMLStreamWriter xmlStreamWriter) throws XMLStreamException { + + xmlStreamWriter.writeEndDocument(); + + xmlStreamWriter.flush(); + + return byteArrayOutputStream.toString(); + } + + /** + * Current default namespace is "". + * writeStartElement("", "localName"", "") + * requires no fixup + */ + @Test + public void testEmptyDefaultEmptyPrefix() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "" + "requires no fixup" + "" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeStartElement("", "localName", ""); + xmlStreamWriter.writeCharacters("requires no fixup"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testEmptyDefaultEmptyPrefix(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "". + * + * writeStartElement("prefix", "localName", "http://example.org/myURI") + * + * requires no fixup, but should generate a declaration for "prefix": + * xmlns:prefix="http://example.org/myURI" if necessary + * + * necessary to generate a declaration in this test case. + */ + @Test + public void testEmptyDefaultSpecifiedPrefix() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "" + + "generate xmlns:prefix" + "" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeStartElement("prefix", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeCharacters("generate xmlns:prefix"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testEmptyDefaultSpecifiedPrefix(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "". + * + * writeStartElement("prefix", "localName", "http://example.org/myURI") + * + * requires no fixup, but should generate a declaration for "prefix": + * xmlns:prefix="http://example.org/myURI" if necessary + * + * not necessary to generate a declaration in this test case. + */ + @Test + public void testEmptyDefaultSpecifiedPrefixNoDeclarationGeneration() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "" + + "not necessary to generate a declaration" + "" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeNamespace("prefix", "http://example.org/myURI"); + + xmlStreamWriter.writeStartElement("prefix", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeCharacters("not necessary to generate a declaration"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testEmptyDefaultSpecifiedPrefixNoDeclarationGeneration(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testEmptyDefaultSpecifiedPrefixNoDeclarationGeneration(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "". + * + * writeStartElement("", "localName", "http://example.org/myURI") + * + * should "fixup" the declaration for the default namespace: + * xmlns="http://example.org/myURI" + */ + @Test + public void testEmptyDefaultSpecifiedDefault() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "" + "generate xmlns" + + "" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeStartElement("", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeCharacters("generate xmlns"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testEmptyDefaultSpecifiedDefault(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testEmptyDefaultSpecifiedDefault(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "". + * + * writeAttribute("", "", "attrName", "value") + * + * requires no fixup + */ + @Test + public void testEmptyDefaultEmptyPrefixWriteAttribute() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "requires no fixup" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeAttribute("", "", "attrName", "value"); + xmlStreamWriter.writeCharacters("requires no fixup"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testEmptyDefaultEmptyPrefixWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testEmptyDefaultEmptyPrefixWriteAttribute(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "". + * + * writeAttribute("p", "http://example.org/myURI", "attrName", "value") + * + * requires no fixup, but should generate a declaration for "p": + * xmlns:p="http://example.org/myURI" if necessary + * + * necessary to generate a declaration in this test case. + */ + @Test + public void testEmptyDefaultSpecifiedPrefixWriteAttribute() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + + "generate xmlns:p=\"http://example.org/myURI\"" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeAttribute("p", "http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeCharacters("generate xmlns:p=\"http://example.org/myURI\""); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testEmptyDefaultSpecifiedPrefixWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testEmptyDefaultSpecifiedPrefixWriteAttribute(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "". + * + * writeAttribute("p", "http://example.org/myURI", "attrName", "value") + * + * requires no fixup, but should generate a declaration for "p": + * xmlns:p="http://example.org/myURI" if necessary + * + * not necessary to generate a declaration in this test case. + */ + @Test + public void testEmptyDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + + "not necessary to generate a declaration" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeNamespace("p", "http://example.org/myURI"); + + xmlStreamWriter.writeAttribute("p", "http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeCharacters("not necessary to generate a declaration"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testEmptyDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testEmptyDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "". + * + * writeAttribute("", "http://example.org/myURI", "attrName", "value") + * + * XMLOutputFactory (Javadoc) : "If a writer isRepairingNamespaces it will + * create a namespace declaration on the current StartElement for any + * attribute that does not currently have a namespace declaration in scope. + * If the StartElement has a uri but no prefix specified a prefix will be + * assigned, if the prefix has not been declared in a parent of the current + * StartElement it will be declared on the current StartElement. If the + * defaultNamespace is bound and in scope and the default namespace matches + * the URI of the attribute or StartElement QName no prefix will be + * assigned." + * + * prefix needs to be assigned for this test case. + */ + @Test + public void testEmptyDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttribute() throws Exception { + + final String EXPECTED_OUTPUT = "" + + "" + + "generate xmlns declaration {generated prefix}=\"http://example.org/myURI\"" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeCharacters("generate xmlns declaration {generated prefix}=\"http://example.org/myURI\""); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testEmptyDefaultUnspecifiedPrefixWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testEmptyDefaultUnspecifiedPrefixWriteAttribute(): actualOutput: " + actualOutput); + } + + // there must be one xmlns= + Assert.assertTrue(actualOutput.split("xmlns=").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput); + + // there must be one xmlns:{generated prefix}="..." + Assert.assertTrue(actualOutput.split("xmlns:").length == 2, "Expected 1 xmlns:{generated prefix}=\"\", actual output: " + actualOutput); + + // there must be one {generated prefix}:attrName="value" + Assert.assertTrue(actualOutput.split(":attrName=\"value\"").length == 2, "Expected 1 {generated prefix}:attrName=\"value\", actual output: " + + actualOutput); + } + + /** + * Current default namespace is "". + * + * writeAttribute("", "http://example.org/myURI", "attrName", "value") + * + * XMLOutputFactory (Javadoc) : "If a writer isRepairingNamespaces it will + * create a namespace declaration on the current StartElement for any + * attribute that does not currently have a namespace declaration in scope. + * If the StartElement has a uri but no prefix specified a prefix will be + * assigned, if the prefix has not been declared in a parent of the current + * StartElement it will be declared on the current StartElement. If the + * defaultNamespace is bound and in scope and the default namespace matches + * the URI of the attribute or StartElement QName no prefix will be + * assigned." + * + * no prefix needs to be assigned for this test case + */ + @Test + public void testEmptyDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + + "no prefix generation" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeNamespace("p", "http://example.org/myURI"); + + xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeCharacters("no prefix generation"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testEmptyDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testEmptyDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + // ---------------- Current default namespace is + // "http://example.org/uniqueURI" ---------------- + + private void startDocumentSpecifiedDefaultNamespace(XMLStreamWriter xmlStreamWriter) throws XMLStreamException { + + xmlStreamWriter.writeStartDocument(); + xmlStreamWriter.writeStartElement("root"); + xmlStreamWriter.writeDefaultNamespace("http://example.org/uniqueURI"); + } + + private String endDocumentSpecifiedDefaultNamespace(XMLStreamWriter xmlStreamWriter) throws XMLStreamException { + + xmlStreamWriter.writeEndDocument(); + + xmlStreamWriter.flush(); + + return byteArrayOutputStream.toString(); + } + + /** + * Current default namespace is "http://example.org/uniqueURI". + * + * writeElement("", "localName", "") + * + * should "fixup" the declaration for the default namespace: xmlns="" + */ + @Test + public void testSpecifiedDefaultEmptyPrefix() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "" + + "generate xmlns=\"\"" + "" + ""; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeStartElement("", "localName", ""); + xmlStreamWriter.writeCharacters("generate xmlns=\"\""); + + String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultEmptyPrefix(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultEmptyPrefix(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "http://example.org/uniqueURI". + * + * writeStartElement("p", "localName", "http://example.org/myURI") + * + * requires no fixup, but should generate a declaration for "p": + * xmlns:p="http://example.org/myURI" if necessary + * + * test case where it is necessary to generate a declaration. + */ + @Test + public void testSpecifiedDefaultSpecifiedPrefix() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + + "" + "generate xmlns:p=\"http://example.org/myURI\"" + "" + ""; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeCharacters("generate xmlns:p=\"http://example.org/myURI\""); + + String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultSpecifiedPrefix(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultSpecifiedPrefix(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "http://example.org/uniqueURI". + * + * writeStartElement("p", "localName", "http://example.org/myURI") + * + * requires no fixup, but should generate a declaration for "p": + * xmlns:p="http://example.org/myURI" if necessary + * + * test case where it is not necessary to generate a declaration. + */ + @Test + public void testSpecifiedDefaultSpecifiedPrefixNoPrefixGeneration() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "" + "not necessary to generate a declaration" + "" + "
"; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeNamespace("p", "http://example.org/myURI"); + + xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeCharacters("not necessary to generate a declaration"); + + String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultSpecifiedPrefixNoPrefixGeneration(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultSpecifiedPrefixNoPrefixGeneration(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "http://example.org/uniqueURI". + * + * writeStartElement("", "localName", "http://example.org/myURI") + * + * should "fixup" the declaration for the default namespace: + * xmlns="http://example.org/myURI" + */ + @Test + public void testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURI() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + + "" + "generate xmlns=\"http://example.org/myURI\"" + "" + ""; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeStartElement("", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeCharacters("generate xmlns=\"http://example.org/myURI\""); + + String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURI(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURI(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "http://example.org/uniqueURI". + * + * writeAttribute("", "", "attrName", "value") + * + * requires no fixup + */ + @Test + public void testSpecifiedDefaultEmptyPrefixWriteAttribute() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "requires no fixup" + + ""; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeAttribute("", "", "attrName", "value"); + xmlStreamWriter.writeCharacters("requires no fixup"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultEmptyPrefixWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultEmptyPrefixWriteAttribute(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "http://example.org/uniqueURI". + * + * writeAttribute("p", "http://example.org/myURI", "attrName", "value") + * + * requires no fixup, but should generate a declaration for "p": + * xmlns:p="http://example.org/myURI" if necessary + * + * test case where it is necessary to generate a declaration. + */ + @Test + public void testSpecifiedDefaultSpecifiedPrefixWriteAttribute() throws Exception { // want + // to + // test + + final String EXPECTED_OUTPUT = "" + + "" + + "generate xmlns:p=\"http://example.org/myURI\"" + ""; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeAttribute("p", "http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeCharacters("generate xmlns:p=\"http://example.org/myURI\""); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultSpecifiedPrefixWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultSpecifiedPrefixWriteAttribute(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "http://example.org/uniqueURI". + * + * writeAttribute("p", "http://example.org/myURI", "attrName", "value") + * + * requires no fixup, but should generate a declaration for "p": + * xmlns:p="http://example.org/myURI" if necessary + * + * test case where it is not necessary to generate a declaration. + */ + @Test + public void testSpecifiedDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration() throws Exception { + + final String EXPECTED_OUTPUT = "" + + "" + + "not necessary to generate a declaration" + ""; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeNamespace("p", "http://example.org/myURI"); + + xmlStreamWriter.writeAttribute("p", "http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeCharacters("not necessary to generate a declaration"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /** + * Current default namespace is "http://example.org/uniqueURI". + * + * writeAttribute("p", "http://example.org/uniqueURI", "attrName", "value") + * + * requires no fixup, but should generate a declaration for "p": + * xmlns:p="http://example.org/uniqueURI" if necessary. (Note that this will + * potentially produce two namespace bindings with the same URI, xmlns="xxx" + * and xmlns:p="xxx", but that's perfectly legal.) + */ + @Test + public void testSpecifiedDefaultSpecifiedPrefixSpecifiedNamespaceURIWriteAttribute() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "requires no fixup" + + ""; + final String EXPECTED_OUTPUT_2 = "" + + "" + "requires no fixup" + + ""; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeAttribute("p", "http://example.org/uniqueURI", "attrName", "value"); + xmlStreamWriter.writeCharacters("requires no fixup"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultSpecifiedPrefixSpecifiedNamespaceURIWriteAttribute: expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultSpecifiedPrefixSpecifiedNamespaceURIWriteAttribute: expectedOutput: " + EXPECTED_OUTPUT_2); + System.out.println("testSpecifiedDefaultSpecifiedPrefixSpecifiedNamespaceURIWriteAttribute: actualOutput: " + actualOutput); + } + + Assert.assertTrue(actualOutput.equals(EXPECTED_OUTPUT) || actualOutput.equals(EXPECTED_OUTPUT_2), "Expected: " + EXPECTED_OUTPUT + "\n" + "Actual: " + + actualOutput); + } + + /** + * Current default namespace is "http://example.org/uniqueURI". + * + * writeAttribute("", "http://example.org/myURI", "attrName", "value") + * + * XMLOutputFactory (Javadoc) : "If a writer isRepairingNamespaces it will + * create a namespace declaration on the current StartElement for any + * attribute that does not currently have a namespace declaration in scope. + * If the StartElement has a uri but no prefix specified a prefix will be + * assigned, if the prefix has not been declared in a parent of the current + * StartElement it will be declared on the current StartElement. If the + * defaultNamespace is bound and in scope and the default namespace matches + * the URI of the attribute or StartElement QName no prefix will be + * assigned." + * + * test case where prefix needs to be assigned. + */ + @Test + public void testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttribute() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + + "generate xmlns declaration {generated prefix}=\"http://example.org/myURI\"" + "
"; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeCharacters("generate xmlns declaration {generated prefix}=\"http://example.org/myURI\""); + + String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttribute(): actualOutput: " + actualOutput); + } + + // there must be one xmlns= + Assert.assertTrue(actualOutput.split("xmlns=").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput); + + // there must be one xmlns:{generated prefix}="..." + Assert.assertTrue(actualOutput.split("xmlns:").length == 2, "Expected 1 xmlns:{generated prefix}=\"\", actual output: " + actualOutput); + + // there must be one {generated prefix}:attrName="value" + Assert.assertTrue(actualOutput.split(":attrName=\"value\"").length == 2, "Expected 1 {generated prefix}:attrName=\"value\", actual output: " + + actualOutput); + } + + /** + * Current default namespace is "http://example.org/uniqueURI". + * + * writeAttribute("", "http://example.org/myURI", "attrName", "value") + * + * XMLOutputFactory (Javadoc) : "If a writer isRepairingNamespaces it will + * create a namespace declaration on the current StartElement for any + * attribute that does not currently have a namespace declaration in scope. + * If the StartElement has a uri but no prefix specified a prefix will be + * assigned, if the prefix has not been declared in a parent of the current + * StartElement it will be declared on the current StartElement. If the + * defaultNamespace is bound and in scope and the default namespace matches + * the URI of the attribute or StartElement QName no prefix will be + * assigned." + * + * test case where no prefix needs to be assigned. + */ + @Test + public void testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "no prefix needs to be assigned" + "
"; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeNamespace("p", "http://example.org/myURI"); + + xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeCharacters("no prefix needs to be assigned"); + + String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + // --------------- Serializations, sequences --------------- + + // Unfortunately, the nature of the StAX API makes it possible for the + // programmer to generate events that cannot be serialized in XML. + + /** + * Current default namespace is "". + * + * write*("p", "myuri", ...); write*("p", "otheruri", ...); + * + * XMLOutputFactory (Javadoc) (If repairing of namespaces is enabled): "If + * element and/or attribute names in the same start or empty-element tag are + * bound to different namespace URIs and are using the same prefix then the + * element or the first occurring attribute retains the original prefix and + * the following attributes have their prefixes replaced with a new prefix + * that is bound to the namespace URIs of those attributes." + */ + @Test + public void testSamePrefixDifferentURI() throws Exception { + + /** + * writeAttribute("p", "http://example.org/URI-ONE", "attr1", "value"); + * writeAttribute("p", "http://example.org/URI-TWO", "attr2", "value"); + */ + final String EXPECTED_OUTPUT = "" + "" + + " xmlns:{generated prefix}=\"http://example.org/URI-TWO\"" + " {generated prefix}:attr2=\"value\">" + + "remap xmlns declaration {generated prefix}=\"http://example.org/URI-TWO\"" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeAttribute("p", "http://example.org/URI-ONE", "attr1", "value"); + xmlStreamWriter.writeAttribute("p", "http://example.org/URI-TWO", "attr2", "value"); + xmlStreamWriter.writeCharacters("remap xmlns declaration {generated prefix}=\"http://example.org/URI-TWO\""); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSamePrefixDifferentURI(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSamePrefixDifferentURI(): actualOutput: " + actualOutput); + } + + // there must be 1 xmlns= + Assert.assertTrue(actualOutput.split("xmlns=").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput); + + // there must be 2 xmlns: + Assert.assertTrue(actualOutput.split("xmlns:").length == 3, "Expected 2 xmlns:, actual output: " + actualOutput); + + // there must be 2 :attr + Assert.assertTrue(actualOutput.split(":attr").length == 3, "Expected 2 :attr, actual output: " + actualOutput); + + /** + * writeStartElement("p", "localName", "http://example.org/URI-ONE"); + * writeAttribute("p", "http://example.org/URI-TWO", "attrName", + * "value"); + */ + final String EXPECTED_OUTPUT_2 = "" + "" + "" + "" + ""; + + // reset to known state + resetWriter(); + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/URI-ONE"); + xmlStreamWriter.writeAttribute("p", "http://example.org/URI-TWO", "attrName", "value"); + + actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSamePrefixDifferentURI(): expectedOutput: " + EXPECTED_OUTPUT_2); + System.out.println("testSamePrefixDifferentURI(): actualOutput: " + actualOutput); + } + + // there must be 1 xmlns= + Assert.assertTrue(actualOutput.split("xmlns=").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput); + + // there must be 2 xmlns: + Assert.assertTrue(actualOutput.split("xmlns:").length == 3, "Expected 2 xmlns:, actual output: " + actualOutput); + + // there must be 2 p:localName + Assert.assertTrue(actualOutput.split("p:localName").length == 3, "Expected 2 p:localName, actual output: " + actualOutput); + + // there must be 1 :attrName + Assert.assertTrue(actualOutput.split(":attrName").length == 2, "Expected 1 :attrName, actual output: " + actualOutput); + + /** + * writeNamespace("p", "http://example.org/URI-ONE"); + * writeAttribute("p", "http://example.org/URI-TWO", "attrName", + * "value"); + */ + final String EXPECTED_OUTPUT_3 = "" + "" + ""; + + // reset to known state + resetWriter(); + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeNamespace("p", "http://example.org/URI-ONE"); + xmlStreamWriter.writeAttribute("p", "http://example.org/URI-TWO", "attrName", "value"); + + actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSamePrefixDifferentURI(): expectedOutput: " + EXPECTED_OUTPUT_3); + System.out.println("testSamePrefixDifferentURI(): actualOutput: " + actualOutput); + } + + // there must be 1 xmlns= + Assert.assertTrue(actualOutput.split("xmlns=").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput); + + // there must be 2 xmlns: + Assert.assertTrue(actualOutput.split("xmlns:").length == 3, "Expected 2 xmlns:, actual output: " + actualOutput); + + // there must be 1 :attrName + Assert.assertTrue(actualOutput.split(":attrName").length == 2, "Expected a :attrName, actual output: " + actualOutput); + + /** + * writeNamespace("xmlns", ""); writeStartElement("", "localName", + * "http://example.org/URI-TWO"); + */ + final String EXPECTED_OUTPUT_4 = "" + "" + "" + + "xmlns declaration =\"http://example.org/URI-TWO\"" + ""; + + // reset to known state + resetWriter(); + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + // writeNamespace("xmlns", ""); already done by + // startDocumentEmptyDefaultNamespace above + xmlStreamWriter.writeStartElement("", "localName", "http://example.org/URI-TWO"); + xmlStreamWriter.writeCharacters("remap xmlns declaration {generated prefix}=\"http://example.org/URI-TWO\""); + + actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSamePrefixDifferentURI(): expectedOutput: " + EXPECTED_OUTPUT_4); + System.out.println("testSamePrefixDifferentURI(): actualOutput: " + actualOutput); + } + + // there must be 2 xmlns= + Assert.assertTrue(actualOutput.split("xmlns=").length == 3, "Expected 2 xmlns=, actual output: " + actualOutput); + + // there must be 0 xmlns: + Assert.assertTrue(actualOutput.split("xmlns:").length == 1, "Expected 0 xmlns:, actual output: " + actualOutput); + + // there must be 0 :localName + Assert.assertTrue(actualOutput.split(":localName").length == 1, "Expected 0 :localName, actual output: " + actualOutput); + } + + // ---------------- Misc ---------------- + + /** + * The one case where you don't have to worry about fixup is on attributes + * that do not have a prefix. Irrespective of the current namespace + * bindings, + * + * writeAttribute("", "", "attrName", "value") + * + * is always correct and never requires fixup. + */ + @Test + public void testEmptyDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "never requires fixup" + ""; + + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeAttribute("", "", "attrName", "value"); + xmlStreamWriter.writeCharacters("never requires fixup"); + + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testEmptyDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testEmptyDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + @Test + public void testSpecifiedDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute() throws Exception { + + final String EXPECTED_OUTPUT = "" + "" + "never requires fixup" + + ""; + + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + xmlStreamWriter.writeAttribute("", "", "attrName", "value"); + xmlStreamWriter.writeCharacters("never requires fixup"); + + String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + + if (DEBUG) { + System.out.println("testSpecifiedDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT); + System.out.println("testSpecifiedDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute(): actualOutput: " + actualOutput); + } + + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } + + /*--------------- Negative tests with isRepairingNamespaces as FALSE ---------------------- */ + + private void setUpForNoRepair() { + + xmlOutputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.FALSE); + + // new Writer + try { + xmlStreamWriter = xmlOutputFactory.createXMLStreamWriter(byteArrayOutputStream); + + } catch (XMLStreamException xmlStreamException) { + xmlStreamException.printStackTrace(); + Assert.fail(xmlStreamException.toString()); + } + } + + /* + * Tries to assign default namespace to empty URI and again to a different + * uri in element and attribute. Expects XMLStreamException . + * writeNamespace("",""); writeAttribute("", "http://example.org/myURI", + * "attrName", "value"); + */ + @Test + public void testEmptyDefaultEmptyPrefixSpecifiedURIWriteAttributeNoRepair() { + try { + setUpForNoRepair(); + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value"); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput); + } catch (Exception e) { + System.out.println("PASS: caught an expected exception" + e.getMessage()); + e.printStackTrace(); + } + } + + /* + * Tries to assign default namespace to different uris in element and + * attribute and expects XMLStreamException. + * writeNamespace("","http://example.org/uniqueURI"); writeAttribute("", + * "http://example.org/myURI", "attrName", "value"); + */ + @Test + public void testSpecifiedDefaultEmptyPrefixSpecifiedURIWriteAttributeNoRepair() { + try { + setUpForNoRepair(); + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + xmlStreamWriter.writeAttribute("", "http://example.org/uniqueURI", "attrName", "value"); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput); + } catch (Exception e) { + System.out.println("PASS: caught an expected exception" + e.getMessage()); + e.printStackTrace(); + } + } + + /* + * Tries to assign default namespace to same uri twice in element and + * attribute and expects XMLStreamException. + * writeNamespace("","http://example.org/uniqueURI"); writeAttribute("", + * "http://example.org/uniqueURI", "attrName", "value"); + */ + @Test + public void testSpecifiedDefaultEmptyPrefixSpecifiedDifferentURIWriteAttributeNoRepair() { + try { + setUpForNoRepair(); + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value"); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput); + } catch (Exception e) { + System.out.println("PASS: caught an expected exception" + e.getMessage()); + e.printStackTrace(); + } + } + + /* + * Tries to assign prefix 'p' to different uris to attributes of the same + * element and expects XMLStreamException. writeAttribute("p", + * "http://example.org/URI-ONE", "attr1", "value"); writeAttribute("p", + * "http://example.org/URI-TWO", "attr2", "value"); + */ + @Test + public void testSamePrefixDiffrentURIWriteAttributeNoRepair() { + try { + setUpForNoRepair(); + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + xmlStreamWriter.writeAttribute("p", "http://example.org/URI-ONE", "attr1", "value"); + xmlStreamWriter.writeAttribute("p", "http://example.org/URI-TWO", "attr2", "value"); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput); + } catch (Exception e) { + System.out.println("PASS: caught an expected exception" + e.getMessage()); + e.printStackTrace(); + } + } + + /* + * Tries to assign prefix 'p' to different uris in element and attribute and + * expects XMLStreamException. + * writeStartElement("p","localName","http://example.org/URI-ONE") + * writeAttribute("p", "http://example.org/URI-TWO", "attrName", "value") + */ + @Test + public void testSamePrefixDiffrentURIWriteElemAndWriteAttributeNoRepair() { + try { + setUpForNoRepair(); + startDocumentEmptyDefaultNamespace(xmlStreamWriter); + xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/URI-ONE"); + xmlStreamWriter.writeAttribute("p", "http://example.org/URI-TWO", "attrName", "value"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput); + } catch (Exception e) { + System.out.println("PASS: caught an expected exception" + e.getMessage()); + e.printStackTrace(); + } + } + + /* + * Tries to write following and expects a StreamException. + */ + @Test + public void testDefaultNamespaceDiffrentURIWriteElementNoRepair() { + try { + System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + setUpForNoRepair(); + startDocumentSpecifiedDefaultNamespace(xmlStreamWriter); + xmlStreamWriter.writeNamespace("", "http://example.org/myURI"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput); + } catch (Exception e) { + System.out.println("PASS: caught an expected exception" + e.getMessage()); + e.printStackTrace(); + } + } + + /*-------------------------------------------------------------------------- + Miscelleneous tests for writeStartElement() & writeAttribute() methods + in case of NOREPAIR + --------------------------------------------------------------------------*/ + + private void startDocument(XMLStreamWriter xmlStreamWriter) throws XMLStreamException { + xmlStreamWriter.writeStartDocument(); + xmlStreamWriter.writeStartElement("root"); + } + + @Test + public void testSpecifiedPrefixSpecifiedURIWriteElementNoRepair() { + + final String EXPECTED_OUTPUT = "" + "" + "" + ""; + try { + setUpForNoRepair(); + startDocument(xmlStreamWriter); + xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Caught an unexpected exception" + e.getMessage()); + } + } + + @Test + public void testSpecifiedPrefixSpecifiedURIWriteAttributeNoRepair() { + + final String EXPECTED_OUTPUT = "" + "" + ""; + try { + setUpForNoRepair(); + startDocument(xmlStreamWriter); + xmlStreamWriter.writeAttribute("p", "http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Caught an unexpected exception" + e.getMessage()); + } + } + + @Test + public void testSpecifiedPrefixSpecifiedURISpecifiedNamespcaeWriteElementNoRepair() { + + final String EXPECTED_OUTPUT = "" + "" + "" + ""; + try { + setUpForNoRepair(); + startDocument(xmlStreamWriter); + + xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeNamespace("p", "http://example.org/myURI"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Caught an unexpected exception" + e.getMessage()); + } + } + + /* + * writeStartElement("p","localName", "http://example.org/myURI") + * writeNamespace("p","http://example.org/uniqueURI") This sequence of calls + * should generate an error as prefix 'p' is binded to different namespace + * URIs in same namespace context and repairing is disabled. + */ + + @Test + public void testSpecifiedPrefixSpecifiedURISpecifiedDifferentNamespcaeWriteElementNoRepair() { + + try { + setUpForNoRepair(); + startDocument(xmlStreamWriter); + xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeNamespace("p", "http://example.org/uniqueURI"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.fail("XMLStreamException is expected as 'p' is rebinded to a different URI in same namespace context"); + } catch (Exception e) { + System.out.println("Caught an expected exception" + e.getMessage()); + } + } + + @Test + public void testEmptyPrefixEmptyURIWriteAttributeNoRepair() { + final String EXPECTED_OUTPUT = "" + "" + "" + ""; + try { + setUpForNoRepair(); + startDocument(xmlStreamWriter); + xmlStreamWriter.writeStartElement("localName"); + xmlStreamWriter.writeAttribute("", "", "attrName", "value"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Caught an unexpected exception" + e.getMessage()); + } + } + + @Test + public void testEmptyPrefixNullURIWriteAttributeNoRepair() { + final String EXPECTED_OUTPUT = "" + "" + "" + ""; + try { + setUpForNoRepair(); + startDocument(xmlStreamWriter); + xmlStreamWriter.writeStartElement("localName"); + xmlStreamWriter.writeAttribute(null, null, "attrName", "value"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput); + } catch (Exception e) { + System.out.println("PASS: caught an expected exception" + e.getMessage()); + e.printStackTrace(); + } + } + + @Test + public void testDoubleXmlNsNoRepair() { + try { + // reset to known state + setUpForNoRepair(); + + xmlStreamWriter.writeStartDocument(); + xmlStreamWriter.writeStartElement("foo"); + xmlStreamWriter.writeNamespace("xml", XMLConstants.XML_NS_URI); + xmlStreamWriter.writeAttribute("xml", XMLConstants.XML_NS_URI, "lang", "ja_JP"); + xmlStreamWriter.writeCharacters("Hello"); + xmlStreamWriter.writeEndElement(); + xmlStreamWriter.writeEndDocument(); + + xmlStreamWriter.flush(); + String actualOutput = byteArrayOutputStream.toString(); + + if (DEBUG) { + System.out.println("testDoubleXmlNsNoRepair(): actualOutput: " + actualOutput); + } + + // there should be no xmlns:xml + Assert.assertTrue(actualOutput.split("xmlns:xml").length == 1, "Expected 0 xmlns:xml, actual output: " + actualOutput); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } + } + + @Test + public void testSpecifiedURIWriteAttributeNoRepair() { + final String EXPECTED_OUTPUT = "" + "" + "" + ""; + try { + setUpForNoRepair(); + startDocument(xmlStreamWriter); + xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeAttribute("http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + System.out.println("Caught an expected exception" + e.getMessage()); + } + } + + @Test + public void testSpecifiedURIWriteAttributeWithRepair() { + final String EXPECTED_OUTPUT = "" + "" + + "" + ""; + try { + startDocument(xmlStreamWriter); + xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI"); + xmlStreamWriter.writeNamespace("p", "http://example.org/myURI"); + xmlStreamWriter.writeAttribute("http://example.org/myURI", "attrName", "value"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testSpecifiedDefaultInDifferentElementsNoRepair() { + final String EXPECTED_OUTPUT = "" + "" + "" + + "" + "" + ""; + try { + setUpForNoRepair(); + startDocument(xmlStreamWriter); + xmlStreamWriter.writeStartElement("localName"); + xmlStreamWriter.writeDefaultNamespace("http://example.org/myURI"); + xmlStreamWriter.writeStartElement("child"); + xmlStreamWriter.writeDefaultNamespace("http://example.org/uniqueURI"); + xmlStreamWriter.writeEndElement(); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + /*------------- Tests for setPrefix() and setDefaultNamespace() methods --------------------*/ + + @Test + public void testSetPrefixWriteNamespaceNoRepair() { + final String EXPECTED_OUTPUT = "" + "" + ""; + try { + setUpForNoRepair(); + startDocument(xmlStreamWriter); + xmlStreamWriter.setPrefix("p", "http://example.org/myURI"); + xmlStreamWriter.writeNamespace("p", "http://example.org/myURI"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + System.out.println("Caught an expected exception" + e.getMessage()); + } + } + + @Test + public void testSetPrefixWriteNamespaceWithRepair() { + final String EXPECTED_OUTPUT = "" + "" + ""; + try { + startDocument(xmlStreamWriter); + xmlStreamWriter.setPrefix("p", "http://example.org/myURI"); + xmlStreamWriter.writeNamespace("p", "http://example.org/myURI"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + System.out.println("Caught an expected exception" + e.getMessage()); + } + } + + @Test + public void testSetDefaultNamespaceWriteNamespaceNoRepair() { + final String EXPECTED_OUTPUT = "" + "" + ""; + try { + setUpForNoRepair(); + startDocument(xmlStreamWriter); + xmlStreamWriter.setDefaultNamespace("http://example.org/myURI"); + xmlStreamWriter.writeNamespace("", "http://example.org/myURI"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + System.out.println("Caught an expected exception" + e.getMessage()); + } + } + + @Test + public void testSetDefaultNamespaceWriteNamespaceWithRepair() { + final String EXPECTED_OUTPUT = "" + "" + ""; + try { + startDocument(xmlStreamWriter); + xmlStreamWriter.setDefaultNamespace("http://example.org/myURI"); + xmlStreamWriter.writeNamespace("", "http://example.org/myURI"); + xmlStreamWriter.writeEndElement(); + String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter); + System.out.println("actualOutput: " + actualOutput); + Assert.assertEquals(EXPECTED_OUTPUT, actualOutput); + } catch (Exception e) { + System.out.println("Caught an expected exception" + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NullUriDetectionTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NullUriDetectionTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.StringWriter; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.annotations.Test; + +/* + * @bug 6391922 + * @summary Test XMLStreamWriter can writeDefaultNamespace(null). + */ +public class NullUriDetectionTest { + @Test + public void test1() throws Exception { + XMLOutputFactory xof = XMLOutputFactory.newInstance(); + xof.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE); + + StringWriter sw = new StringWriter(); + XMLStreamWriter w = xof.createXMLStreamWriter(sw); + w.writeStartDocument(); + w.writeStartElement("foo", "bar", "zot"); + w.writeDefaultNamespace(null); + w.writeCharacters("---"); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/SqeLinuxTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/SqeLinuxTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.ByteArrayOutputStream; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XMLStreamWriter can output multiple declarations if IS_REPAIRING_NAMESPACES is false. + */ +public class SqeLinuxTest { + + // note that expected output will have multiple declarations, + // StAX does not do well formedness checking + private static final String EXPECTED_OUTPUT = "" + "" + + "" + ""; + + XMLStreamWriter xmlStreamWriter; + ByteArrayOutputStream byteArrayOutputStream; + XMLOutputFactory xmlOutputFactory; + + @Test + public void testWriterOnLinux() throws Exception { + + // setup XMLStreamWriter + try { + byteArrayOutputStream = new ByteArrayOutputStream(); + xmlOutputFactory = XMLOutputFactory.newInstance(); + xmlOutputFactory.setProperty(xmlOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(false)); + xmlStreamWriter = xmlOutputFactory.createXMLStreamWriter(byteArrayOutputStream, "ASCII"); + } catch (Exception e) { + System.err.println("Unexpected Exception: " + e.toString()); + e.printStackTrace(); + Assert.fail(e.toString()); + } + + // create & write a document + try { + xmlStreamWriter.writeStartDocument(); + xmlStreamWriter.writeStartDocument("wStDoc_ver"); + xmlStreamWriter.writeStartDocument("ASCII", "wStDoc_ver2"); + xmlStreamWriter.writeStartDocument(null, null); + + // orignal SQE test used reset() before flush() + // believe this is false as reset() throws away output before + // flush() writes any cached output + // it is valid for a XMLStreamWriter to write its output at any + // time, flush() just garuntees it + // byteArrayOutputStream.reset(); + xmlStreamWriter.flush(); + Assert.assertEquals(EXPECTED_OUTPUT, byteArrayOutputStream.toString()); + } catch (Exception e) { + System.err.println("Unexpected Exception: " + e.toString()); + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/UnprefixedNameTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/UnprefixedNameTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6394074 + * @summary Test XMLStreamWriter namespace prefix with writeDefaultNamespace. + */ +public class UnprefixedNameTest { + + @Test + public void testUnboundPrefix() throws Exception { + + try { + XMLOutputFactory xof = XMLOutputFactory.newInstance(); + XMLStreamWriter w = xof.createXMLStreamWriter(System.out); + // here I'm trying to write + // + w.writeStartDocument(); + w.writeStartElement("foo", "bar"); + w.writeDefaultNamespace("foo"); + w.writeCharacters("---"); + w.writeEndElement(); + w.writeEndDocument(); + w.close(); + + // Unexpected success + String FAIL_MSG = "Unexpected success. Expected: " + "XMLStreamException - " + "if the namespace URI has not been bound to a prefix " + + "and javax.xml.stream.isPrefixDefaulting has not been " + "set to true"; + System.err.println(FAIL_MSG); + Assert.fail(FAIL_MSG); + } catch (XMLStreamException xmlStreamException) { + // Expected Exception + System.out.println("Expected XMLStreamException: " + xmlStreamException.toString()); + } + } + + @Test + public void testBoundPrefix() throws Exception { + + try { + XMLOutputFactory xof = XMLOutputFactory.newInstance(); + XMLStreamWriter w = xof.createXMLStreamWriter(System.out); + // here I'm trying to write + // + w.writeStartDocument(); + w.writeStartElement("foo", "bar", "http://namespace"); + w.writeCharacters("---"); + w.writeEndElement(); + w.writeEndDocument(); + w.close(); + + // Expected success + System.out.println("Expected success."); + } catch (Exception exception) { + // Unexpected Exception + String FAIL_MSG = "Unexpected Exception: " + exception.toString(); + System.err.println(FAIL_MSG); + Assert.fail(FAIL_MSG); + } + } + + @Test + public void testRepairingPrefix() throws Exception { + + try { + + // repair namespaces + // use new XMLOutputFactory as changing its property settings + XMLOutputFactory xof = XMLOutputFactory.newInstance(); + xof.setProperty(xof.IS_REPAIRING_NAMESPACES, new Boolean(true)); + XMLStreamWriter w = xof.createXMLStreamWriter(System.out); + + // here I'm trying to write + // + w.writeStartDocument(); + w.writeStartElement("foo", "bar"); + w.writeDefaultNamespace("foo"); + w.writeCharacters("---"); + w.writeEndElement(); + w.writeEndDocument(); + w.close(); + + // Expected success + System.out.println("Expected success."); + } catch (Exception exception) { + // Unexpected Exception + String FAIL_MSG = "Unexpected Exception: " + exception.toString(); + System.err.println(FAIL_MSG); + Assert.fail(FAIL_MSG); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/WriterTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/WriterTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,780 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.LineNumberReader; +import java.io.Reader; +import java.net.URL; +import java.util.Iterator; + +import javax.xml.namespace.NamespaceContext; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/* + * @summary Test XMLStreamWriter functionality. + */ +public class WriterTest { + + final String ENCODING = "UTF-8"; + XMLOutputFactory outputFactory = null; + XMLInputFactory inputFactory = null; + XMLStreamWriter xtw = null; + String[] files = new String[] { "testOne.xml", "testTwo.xml", "testThree.xml", "testFour.xml", "testFive.xml", "testSix.xml", "testSeven.xml", + "testEight.xml", "testNine.xml", "testTen.xml", "testEleven.xml", "testTwelve.xml", "testDefaultNS.xml", null, "testFixAttr.xml" }; + + String output = ""; + + @BeforeMethod + protected void setUp() { + try { + outputFactory = XMLOutputFactory.newInstance(); + inputFactory = XMLInputFactory.newInstance(); + } catch (Exception ex) { + Assert.fail("Could not create XMLInputFactory"); + } + } + + @AfterMethod + protected void tearDown() { + outputFactory = null; + inputFactory = null; + } + + @Test + public void testOne() { + + System.out.println("Test StreamWriter with out any namespace functionality"); + + try { + String outputFile = files[0] + ".out"; + System.out.println("Writing output to " + outputFile); + + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeStartDocument("utf-8", "1.0"); + xtw.writeStartElement("elmeOne"); + xtw.writeStartElement("elemTwo"); + xtw.writeStartElement("elemThree"); + xtw.writeStartElement("elemFour"); + xtw.writeStartElement("elemFive"); + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + + Assert.assertTrue(checkResults(files[0] + ".out", files[0] + ".org")); + + } catch (Exception ex) { + Assert.fail("testOne Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testTwo() { + + System.out.println("Test StreamWriter's Namespace Context"); + + try { + String outputFile = files[1] + ".out"; + System.out.println("Writing output to " + outputFile); + + xtw = outputFactory.createXMLStreamWriter(System.out); + xtw.writeStartDocument(); + xtw.writeStartElement("elemTwo"); + xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeEndDocument(); + NamespaceContext nc = xtw.getNamespaceContext(); + // Got a Namespace Context.class + + XMLStreamWriter xtw1 = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + + xtw1.writeComment("all elements here are explicitly in the HTML namespace"); + xtw1.setNamespaceContext(nc); + xtw1.writeStartDocument("utf-8", "1.0"); + xtw1.setPrefix("htmlOne", "http://www.w3.org/TR/REC-html40"); + NamespaceContext nc1 = xtw1.getNamespaceContext(); + xtw1.close(); + Iterator it = nc1.getPrefixes("http://www.w3.org/TR/REC-html40"); + + // FileWriter fw = new FileWriter(outputFile); + while (it.hasNext()) { + System.out.println("Prefixes :" + it.next()); + // fw.write((String)it.next()); + // fw.write(";"); + } + // fw.close(); + // assertTrue(checkResults(testTwo+".out", testTwo+".org")); + System.out.println("Done"); + } catch (Exception ex) { + Assert.fail("testTwo Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testThree() { + + System.out.println("Test StreamWriter for proper element sequence."); + + try { + String outputFile = files[2] + ".out"; + System.out.println("Writing output to " + outputFile); + + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeStartDocument("utf-8", "1.0"); + xtw.writeStartElement("elmeOne"); + xtw.writeStartElement("elemTwo"); + xtw.writeEmptyElement("emptyElem"); + xtw.writeStartElement("elemThree"); + xtw.writeStartElement("elemFour"); + xtw.writeStartElement("elemFive"); + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + + Assert.assertTrue(checkResults(files[2] + ".out", files[2] + ".org")); + + } catch (Exception ex) { + Assert.fail("testThree Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testFour() { + + System.out.println("Test StreamWriter with elements,attribute and element content."); + + try { + + String outputFile = files[3] + ".out"; + System.out.println("Writing output to " + outputFile); + + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeStartDocument("utf-8", "1.0"); + xtw.writeStartElement("elmeOne"); + xtw.writeStartElement("elemTwo"); + xtw.writeEmptyElement("emptyElem"); + xtw.writeAttribute("testAttr", "testValue"); + xtw.writeStartElement("elemThree"); + xtw.writeStartElement("elemFour"); + xtw.writeCharacters("TestCharacterData"); + xtw.writeStartElement("elemFive"); + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + + Assert.assertTrue(checkResults(files[3] + ".out", files[3] + ".org")); + + } catch (Exception ex) { + Assert.fail("testFour Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testFive() { + + System.out.println("Test StreamWriter's Namespace Context."); + + try { + + String outputFile = files[4] + ".out"; + System.out.println("Writing output to " + outputFile); + + xtw = outputFactory.createXMLStreamWriter(System.out); + xtw.writeStartDocument(); + xtw.writeStartElement("elemTwo"); + xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + // xtw.writeEndDocument(); + NamespaceContext nc = xtw.getNamespaceContext(); + // Got a Namespace Context.class + + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + + xtw.writeComment("all elements here are explicitly in the HTML namespace"); + xtw.setNamespaceContext(nc); + xtw.writeStartDocument("utf-8", "1.0"); + // xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html"); + // xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title"); + + xtw.writeCharacters("Frobnostication"); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p"); + xtw.writeCharacters("Moved to"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a"); + xtw.writeAttribute("href", "http://frob.com"); + + xtw.writeCharacters("here"); + xtw.writeEndElement(); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeEndElement(); + + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + Assert.assertTrue(checkResults(files[4] + ".out", files[4] + ".org")); + System.out.println("Done"); + } catch (Exception ex) { + Assert.fail("testFive Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testSix() { + + System.out.println("Test StreamWriter, uses the Namespace Context set by the user to resolve namespaces."); + + try { + + String outputFile = files[5] + ".out"; + System.out.println("Writing output to " + outputFile); + + xtw = outputFactory.createXMLStreamWriter(System.out); + xtw.writeStartDocument(); + xtw.writeStartElement("elemTwo"); + xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeEndDocument(); + NamespaceContext nc = xtw.getNamespaceContext(); + // Got a Namespace Context information. + + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + + xtw.writeComment("all elements here are explicitly in the HTML namespace"); + xtw.setNamespaceContext(nc); + xtw.writeStartDocument("utf-8", "1.0"); + xtw.setPrefix("htmlNewPrefix", "http://www.w3.org/TR/REC-html40"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html"); + // xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title"); + + xtw.writeCharacters("Frobnostication"); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p"); + xtw.writeCharacters("Moved to"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a"); + xtw.writeAttribute("href", "http://frob.com"); + + xtw.writeCharacters("here"); + xtw.writeEndElement(); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeEndElement(); + + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + Assert.assertTrue(checkResults(files[5] + ".out", files[5] + ".org")); + System.out.println("Done"); + } catch (Exception ex) { + Assert.fail("testSix Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testSeven() { + + System.out.println("Test StreamWriter supplied with correct namespace information"); + + try { + + String outputFile = files[6] + ".out"; + System.out.println("Writing output to " + outputFile); + + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeComment("all elements here are explicitly in the HTML namespace"); + xtw.writeStartDocument("utf-8", "1.0"); + xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html"); + xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title"); + + xtw.writeCharacters("Frobnostication"); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p"); + xtw.writeCharacters("Moved to"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a"); + xtw.writeAttribute("href", "http://frob.com"); + + xtw.writeCharacters("here"); + xtw.writeEndElement(); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeEndElement(); + + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + Assert.assertTrue(checkResults(files[6] + ".out", files[6] + ".org")); + System.out.println("Done"); + } catch (Exception ex) { + Assert.fail("testSeven Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testEight() { + + System.out.println("Test StreamWriter supplied with correct namespace information and" + "isRepairingNamespace is set to true."); + + try { + + String outputFile = files[7] + ".out"; + System.out.println("Writing output to " + outputFile); + outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true)); + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeComment("all elements here are explicitly in the HTML namespace"); + xtw.writeStartDocument("utf-8", "1.0"); + xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html"); + xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title"); + + xtw.writeCharacters("Frobnostication"); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p"); + xtw.writeCharacters("Moved to"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a"); + xtw.writeAttribute("href", "http://frob.com"); + + xtw.writeCharacters("here"); + xtw.writeEndElement(); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeEndElement(); + + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + // check against testSeven.xml.org + Assert.assertTrue(checkResults(files[7] + ".out", files[7] + ".org")); + System.out.println("Done"); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail("testEight Failed " + ex); + + } + + } + + @Test + public void testNine() { + + System.out.println("Test StreamWriter supplied with correct namespace information and" + "isRepairingNamespace is set to true." + + "pass namespace information using" + "writenamespace function"); + + try { + + String outputFile = files[8] + ".out"; + System.out.println("Writing output to " + outputFile); + outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true)); + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeComment("all elements here are explicitly in the HTML namespace"); + xtw.writeStartDocument("utf-8", "1.0"); + // xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html"); + xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title"); + + xtw.writeCharacters("Frobnostication"); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p"); + xtw.writeCharacters("Moved to"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a"); + xtw.writeAttribute("href", "http://frob.com"); + + xtw.writeCharacters("here"); + xtw.writeEndElement(); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeEndElement(); + + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + // check against testSeven.xml.org + Assert.assertTrue(checkResults(files[8] + ".out", files[7] + ".org")); + System.out.println("Done"); + } catch (Exception ex) { + Assert.fail("testNine Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testTen() { + + System.out.println("Test StreamWriter supplied with no namespace information and" + "isRepairingNamespace is set to true."); + try { + + String outputFile = files[9] + ".out"; + System.out.println("Writing output to " + outputFile); + outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true)); + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeComment("all elements here are explicitly in the HTML namespace"); + xtw.writeStartDocument("utf-8", "1.0"); + // xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html"); + // xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title"); + + xtw.writeCharacters("Frobnostication"); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p"); + xtw.writeCharacters("Moved to"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a"); + xtw.writeAttribute("href", "http://frob.com"); + + xtw.writeCharacters("here"); + xtw.writeEndElement(); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeEndElement(); + + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + // check against testSeven.xml.org + // prefix is generated while it was defined in the 'org' file, the + // following comparison method needs a rewrite. + // assertTrue(checkResults(files[9]+".out",files[7]+".org")); + System.out.println("Done"); + } catch (Exception ex) { + Assert.fail("testTen Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testEleven() { + + System.out.println("Test StreamWriter supplied with namespace information passed through startElement and" + "isRepairingNamespace is set to true."); + try { + + String outputFile = files[10] + ".out"; + System.out.println("Writing output to " + outputFile); + outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true)); + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeComment("all elements here are explicitly in the HTML namespace"); + xtw.writeStartDocument("utf-8", "1.0"); + // xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeStartElement("html", "html", "http://www.w3.org/TR/REC-html40"); + // xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title"); + + xtw.writeCharacters("Frobnostication"); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p"); + xtw.writeCharacters("Moved to"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a"); + xtw.writeAttribute("href", "http://frob.com"); + + xtw.writeCharacters("here"); + xtw.writeEndElement(); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeEndElement(); + + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + // check against testSeven.xml.org + Assert.assertTrue(checkResults(files[10] + ".out", files[7] + ".org")); + System.out.println("Done"); + } catch (Exception ex) { + Assert.fail("testEleven Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testTwelve() { + + System.out.println("Test StreamWriter supplied with namespace information set at few places"); + + try { + + String outputFile = files[11] + ".out"; + System.out.println("Writing output to " + outputFile); + outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true)); + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeComment("all elements here are explicitly in the HTML namespace"); + xtw.writeStartDocument("utf-8", "1.0"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html"); + // xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head"); + xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title"); + + xtw.writeCharacters("Frobnostication"); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p"); + xtw.writeCharacters("Moved to"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a"); + xtw.writeAttribute("href", "http://frob.com"); + + xtw.writeCharacters("here"); + xtw.writeEndElement(); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeEndElement(); + + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + // check against testSeven.xml.org + // assertTrue(checkResults(files[10]+".out",files[7]+".org")); + System.out.println("Done"); + } catch (Exception ex) { + Assert.fail("testtwelve Failed " + ex); + ex.printStackTrace(); + } + + } + + @Test + public void testDefaultNamespace() { + + System.out.println("Test StreamWriter supplied with namespace information set at few places"); + + try { + + String outputFile = files[12] + ".out"; + System.out.println("Writing output to " + outputFile); + outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true)); + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeComment("all elements here are explicitly in the HTML namespace"); + xtw.writeStartDocument("utf-8", "1.0"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html"); + xtw.writeDefaultNamespace("http://www.w3.org/TR/REC-html40"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head"); + // xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title"); + + xtw.writeCharacters("Frobnostication"); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p"); + xtw.writeCharacters("Moved to"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a"); + xtw.writeAttribute("href", "http://frob.com"); + + xtw.writeCharacters("here"); + xtw.writeEndElement(); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeEndElement(); + + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + // check against testSeven.xml.org + // assertTrue(checkResults(files[10]+".out",files[7]+".org")); + System.out.println("Done"); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail("testDefaultNamespace Failed " + ex); + + } + + } + + @Test + public void testRepairNamespace() { + + System.out.println("Test StreamWriter supplied with namespace information set at few places"); + + try { + + String outputFile = files[14] + ".out"; + System.out.println("Writing output to " + outputFile); + outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true)); + xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING); + xtw.writeComment("all elements here are explicitly in the HTML namespace"); + xtw.writeStartDocument("utf-8", "1.0"); + xtw.writeStartElement("html", "html", "http://www.w3.org/TR/REC-html40"); + // xtw.writeStartElement("http://www.w3.org/TR/REC-html40","html"); + // xtw.writeDefaultNamespace("http://www.w3.org/TR/REC-html40"); + xtw.writeAttribute("html", "testPrefix", "attr1", "http://frob.com"); + xtw.writeAttribute("html", "testPrefix", "attr2", "http://frob2.com"); + xtw.writeAttribute("html", "http://www.w3.org/TR/REC-html40", "attr4", "http://frob4.com"); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head"); + xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title"); + + xtw.writeCharacters("Frobnostication"); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p"); + xtw.writeCharacters("Moved to"); + xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a"); + xtw.writeAttribute("href", "http://frob.com"); + + xtw.writeCharacters("here"); + xtw.writeEndElement(); + xtw.writeEndElement(); + xtw.writeEndElement(); + + xtw.writeEndElement(); + + xtw.writeEndDocument(); + xtw.flush(); + xtw.close(); + // check against testSeven.xml.org + // assertTrue(checkResults(files[10]+".out",files[7]+".org")); + System.out.println("Done"); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail("testDefaultNamespace Failed " + ex); + + } + + } + + protected boolean checkResults(String checkFile, String orgFile) { + try { + URL fileName = WriterTest.class.getResource(orgFile); + // URL outputFileName = WriterTest.class.getResource(checkFile); + return compareOutput(new InputStreamReader(fileName.openStream()), new InputStreamReader(new FileInputStream(checkFile))); + + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail(ex.getMessage()); + } + return false; + } + + protected boolean compareOutput(Reader expected, Reader actual) throws IOException { + LineNumberReader expectedOutput = null; + LineNumberReader actualOutput = null; + try { + expectedOutput = new LineNumberReader(expected); + actualOutput = new LineNumberReader(actual); + + while (expectedOutput.ready() && actualOutput.ready()) { + String expectedLine = expectedOutput.readLine(); + String actualLine = actualOutput.readLine(); + if (!expectedLine.equals(actualLine)) { + System.out.println("Entityreference expansion failed, line no: " + expectedOutput.getLineNumber()); + System.out.println("Expected: " + expectedLine); + System.out.println("Actual : " + actualLine); + return false; + } + } + return true; + } catch (IOException ex) { + System.err.println("Error occured while comparing results."); + throw ex; + } finally { + expectedOutput.close(); + actualOutput.close(); + + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/XMLStreamWriterTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/XMLStreamWriterTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.stream.XMLStreamWriterTest; + +import java.io.StringWriter; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; + +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/* + * @bug 6347190 + * @summary Test StAX Writer won't insert comment into element inside. + */ +public class XMLStreamWriterTest { + + @BeforeMethod + protected void setUp() throws Exception { + } + + @AfterMethod + protected void tearDown() throws Exception { + } + + /** + * Test of main method, of class TestXMLStreamWriter. + */ + @Test + public void testWriteComment() { + try { + String xml = "java.sun.com"; + XMLOutputFactory f = XMLOutputFactory.newInstance(); + // f.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, + // Boolean.TRUE); + StringWriter sw = new StringWriter(); + XMLStreamWriter writer = f.createXMLStreamWriter(sw); + writer.writeStartDocument("UTF-8", "1.0"); + writer.writeStartElement("a", "html", "http://www.w3.org/TR/REC-html40"); + writer.writeAttribute("href", "http://java.sun.com"); + writer.writeComment("This is comment"); + writer.writeCharacters("java.sun.com"); + writer.writeEndElement(); + writer.writeEndDocument(); + writer.flush(); + sw.flush(); + StringBuffer sb = sw.getBuffer(); + System.out.println("sb:" + sb.toString()); + Assert.assertTrue(sb.toString().equals(xml)); + } catch (Exception ex) { + Assert.fail("Exception: " + ex.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/message_12.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/message_12.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,287 @@ + + + + + 2006-07-20T22:57:12Z + 2006-07-20T23:02:12Z + + + + + + + principal + + urn:oasis:names:tc:SAML:1.0:cm:holder-of-key + + + + + + Xeg55vRyK3ZhAEhEf+YT0z986L0= + + + sPVCOcRVBGYDmnBAjnxoe5LfqAumazmxygPnFbSxGL35e90e1KurbODwNj5fmHxz9CkwAf8VQL8U + ESF3jDRbew4EbdE726uRFKGhK8Xt5G3Mzwo8PCxIcLKmxwwJYc3tpXaE94x937YLzv+Rp6i+sfPe + 7aNcDTMuQUmmDMujQcM= + + value + + + + + + + + + + +6+meGLSaVyDUa0jzlDJaRTyuCI= + X0kmFj+HnmVgC71G69wsfSHS7bQ2E+bFl0lLg7McFAcQW8GVFv/ekHpctySndRPLVFiu1AnRcPM5 + t/uRwQmbov6T0lJwP09rcgxwPVKPVycFHM8HLNOFA5L2MNpqGuKDSOyOXLDqba32BTxLGFyaJzCx + M/mH3WaZgiRDkWaeYUw= + + + G9QGBPj/Lnv/Km4FCTiqMg1xamk= + + + + uuid-96df98ce-5d8e-4855-a4ab-3232ca88e6df + + 0 + 24 + 1NJRlYY/gA54WTvInE3VuJ13 + + + + + + NQM0IBvuplAtETQvk+6gn8C13wE= + + + + NHjIM/BMwNP+XSrgyCE1MKYxwNoqSMX5WEVxABsyUzveDJr8kEmYdlXE4GiWsnJpuxHrYm +437yIq + Qjn/xR9TZI/iOvrM+f1JkeLBRtvl83ZrB6tfEIhH+hXUeOddx+LX0uQAIsamJL+chNS4V4inojsE + 00uFjPnq8JoJ9lI5nmA= + + + + + + + 0 + 32 + FXNiOAEmn2Ndwvy3y5+/RJDM + + + + + + + + + + 0 + 24 + cEhhCfrmBzyXdkkBxxHNp+0b + + + + + + + + + + 6WZAPXqUx+Lx4T3o13a4DaZtf6iPmNEKNO997ZSfw9JafTnn/3L5VOU3tpAm/BfYODiR1C +TSt/7V + JHVIMauBz/KE3ZjDKED33XR0jVWAMifNXMtcd4+tTYr8JWfT0aHGFuKXZlK1WdOI+4o7O5zHVcEP + b0O117p10DROF9tdQHQsmUJBiUcyMwCvY7LsFECRN6Ur9EKkkv8GR6ux4zuYcEFmLGWHVwywINAj + RFeLrtNtaV3ScB/eb1tnkvjEsqXJ+/H2o0saYgRShwQLR2+/3w0vCz4Hxd2PsU9yLi3AeeNApIzV + 7/GFrFRIFA1PMwFn+CUID96wqb1GgZ+E+kwi/5VnTxQp+Frr+GWMGhBNqiEfy5m1GkeRXZyiWENl + 3XUwChS59D/PB2ey6ioPOqyl7m2DuMfFLzJkYBPHiFpvyRYMxBafm3NMl+W9C+hIfVfCym7PpMAH + nlUz7oEKKtjjxgNBM+UWtr5DqQC3WKXDhOhZqomDRflshKkrjA+Xkxz+D4S44CK4nxGuHbesy4Tn + FutOWmfOvP5C3K9athS44nwm2kY7h+TrM4gs35RBMDrPFcrJGclA9umT2Ph2XvqDO/pQSQqV4r0X + pqwikAajgTKty3SJmHAhF2+ONB3ufdrlyJwM7fGIf2bGCCXbB4s6QrO6+8EvOZo/wk6uWnVj7t5F + meWNHCmhsnzP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Ea + 6jFNo0C/qZBX0F82uQcNerda/rQnXhJULnTbDWr9Rft1GNT3ZRpTxqIP5+DwMD3mneiJjgFM3+Vg + +Mrj3trDBTQhQyTk0p+i0Ugz8K+Es8q1wMgbH9PNHuhop3rDFEMM3VfJ7NNtEaTLhSq0Sx30Se4A + pT+m/TMTny1g/WEQdMv49A+wslatBjnWXO4cKUHpB2RNtLq4Ms9xlCe1Puy8HySXcGlaJM69Rqmu + /sEGUaxwfEq0w6xIyyTFV2a89+M4OC12furqHlSwA439fCEeuxXZggWDq4NNKRQnwB0kSOm3kER0 + X2xepHxXzahbjTcAVmH9phDW/1Epq8hN6dssslrz3jqRrQO8PmQ6AvxHkPfXjpwHbZf8KjQSeck6 + x8+a8m09AmN79baCisysWT2M6NVJyTrfo1jqfFzSW8azHaMSACMO0bLu0Oco471xmA048KF+gFzg + bAyDKWHpvYm4wS2Qi+ciH1cgMyxXklkiL4pQySmOWLRKs3K7FAyF+5k8mqsrYSLiHtdqFhd1wj+v + axcD5vCWEPpy/fD336A27jZKs7hlKrScIxbGEPecVcuzzXYgQOFHV9GMUkNeTUOpvZs0ybVeNGky + vrlA3/groJS8Dc2uEv1LJQ1Z+r1dvh57qHMAHVeozL1sEQtVMp7kjT00BHmd56mcvF4PFc1wGR9T + Og0X31UzSGI2+LrnJNyM9llLaCdP3hbP8BokcsWKBuIppOGbs5JtfN0745txQ/ULPMH5izc6z6Tf + f7W2Q7RW9mbXI+dQ0hTwYWZBEgoqeLFlkR3IzBcr53Ci4eoxYPMZhgDnwjV6DPs= + + + + + + + + + + + + + + + + cHmTDN6hwJkJ7ZQ4K5jfDBX2EAg= + + + eUX07YDVpq71fQ43a+dqq3Te+V0= + + + + + + + + http +://131.107.72.15/Security_Federation_FederatedService_Indigo/Symmetric.svc/Scenario_6_IssuedTokenFor +CertificateSecureConversation_MutualCertificate11 + uuid:85e2ee55-ad08-4f23-9146-de477243f284 + +
http://www.w3.org/2005/08/addressing/anonymous
+
+ +http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT +
+ + + + + + + + + + nLnBkO5jNjQx7cnO4/ven6FmZ6THe73S/V6/tsZdfYuUI7saLrNf/dj/AFBRQhgr949gJ1 +GMuj04 + +ZJ6ES891qroekDApSF4Bby38Nu5hL6vGLunEMofwyhcReqhTqlvpc4WqzVSQXC4FLudRjBrPGzY + 2ezbPWSxn68QhsDo1vE9hAoWlPpuyi0TRmSlnn/P1Z0RPzXY4GcYXvwUOohx8TmwmDOeXTbReKXd + klpWOdOwjVxprK5UxOPne2K0qvZX9ciRsXJyv7Yt4FAtuT32R2b8aajEsmSB6EdzXCxNVZZw5knw + el6rHdJ3dG6lxcT6+IVuk2iHg+jk53I382z2x+hfHv3l7+dJyulfIp2k9XXIcBhyvkWP+1ZWtfeD + MzHoPj1JmZG7/NHd20BwNVNKxZwuv/qK09Ok6AoHwOfCwssx3rXKlkBJ+9mvG5SIGnOZ8u1TGfP6 + 7+Dq8cbdOVxbIvvw2N8Pm7/9Jr9oWLvCdmo0QuwLEH7PHzg0NZsPcdkX1Z7zpyZKixFQaXCczF2W + yq7hWP12nUw3hTBhA3CYL/Y05Ter/+D6wyBG6KLF0xFksg9Dm7GioGBhgpzY1exu7vbAKohwUJ+H + mQlr6cvi6RWcxB6VIMGEnZUKLJK2+F7ym60/gAEbBXQrVp8UndTV/Ut3wJcIisEs7uHZKI7WZUK9 + Z8sZO4Lcl0ngnTXV5CYGfStw+uVWttJV1kjRkmzLNmYSDYuZ59bLgrKU5duA1OkGX+Q2Kejdc/Sg + GU5/wlufV+y2Qamwot0DSPNWAHUWZZSciLSbPSKSkk4FExj1o+ohDfvIRdvt4vXPzTHyEt0gvYh6 + 9vPzgVWsBjeETMTH88VPJoUeC0zfOROqYFHB51hRo7+VzRCsd3Q/ghFY5ai1xr5c5fKjuhcWMFDq + Caught Exception: javax.xml.stream.XMLStreamException: xmlns has been already bound to u +rn:oasis:names:tc:SAML:1.0:assertion. Rebinding it to is an error + fnHGPO5z4Ffv+10rd353oB9d+TVRFItlnDImYY/1Hd5bfKfFeaImxgdE3SfhusDet6edXnnPswHt + 4h0rpMUHAB1hvGjQFv/YJv/Bxjr0fzNTrY69UUXO9Oqge26+xYGzgM2JBYDTs2Pee48RhkXa8Ee7 + 94WNNKweAtWm3IEoZWrnIyvxTbT3e9Hq07VVNLbak/pDzp1053UE71vv4poGd1eE3ZFZ88+X90tG + 0F5l9Fi8X3iovnLt4+OeE5XV4FxeLxU8Je/SVb9adEKeRHJS4w6jtepNBrrQQBKLCQaZ3e4NglfL + 61uf7m+wW+ASpL9a5MfeSw== + + + +
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testEight.xml.org --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testEight.xml.org Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ +FrobnosticationMoved tohere + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testFive.xml.org --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testFive.xml.org Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ +FrobnosticationMoved tohere + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testFour.xml.org --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testFour.xml.org Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ +TestCharacterData + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testOne.xml.org --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testOne.xml.org Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testSeven.xml.org --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testSeven.xml.org Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ +FrobnosticationMoved tohere + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testSix.xml.org --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testSix.xml.org Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ +FrobnosticationMoved tohere + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testThree.xml.org --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testThree.xml.org Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/basic-form.vxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/basic-form.vxml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,25 @@ + + + + + +
+ + + Please choose News, Weather, or Sports. + + + + [ news weather sports ] + + + + + + Form is being submited. + +
+ +
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/report.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/report.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml-bad-systemId.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml-bad-systemId.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,103 @@ + +]> + +Getting started with SGML + +The business challenge + +With the ever-changing and growing global market, companies and + large organizations are searching for ways to become more viable and + competitive. Downsizing and other cost-cutting measures demand more + efficient use of corporate resources. One very important resource is + an organization's information. +As part of the move toward integrated information management, +whole industries are developing and implementing standards for +exchanging technical information. This report describes how one such +standard, the Standard Generalized Markup Language (SGML), works as +part of an overall information management strategy. + + +Getting to know SGML + +While SGML is a fairly recent technology, the use of +markup in computer-generated documents has existed for a +while. +
+What is markup, or everything you always wanted to know about +document preparation but were afraid to ask? + +Markup is everything in a document that is not content. The +traditional meaning of markup is the manual marking up +of typewritten text to give instructions for a typesetter or +compositor about how to fit the text on a page and what typefaces to +use. This kind of markup is known as procedural markup. + +Procedural markup +Most electronic publishing systems today use some form of +procedural markup. Procedural markup codes are good for one +presentation of the information. + +Generic markup +Generic markup (also known as descriptive markup) describes the +purpose of the text in a document. A basic concept of +generic markup is that the content of a document must be separate from +the style. Generic markup allows for multiple presentations of the +information. + +Drawbacks of procedural markup +Industries involved in technical documentation increasingly +prefer generic over procedural markup schemes. When a company changes +software or hardware systems, enormous data translation tasks arise, +often resulting in errors.
+
+What <emph>is</emph> SGML in the grand scheme of the universe, anyway? + +SGML defines a strict markup scheme with a syntax for defining +document data elements and an overall framework for marking up +documents. +SGML can describe and create documents that are not dependent on +any hardware, software, formatter, or operating system. Since SGML documents +conform to an international standard, they are portable.
+
+How is SGML and would you recommend it to your grandmother? + +You can break a typical document into three layers: structure, +content, and style. SGML works by separating these three aspects and +deals mainly with the relationship between structure and content. + +Structure +At the heart of an SGML application is a file called the DTD, or +Document Type Definition. The DTD sets up the structure of a document, +much like a database schema describes the types of information it +handles. +A database schema also defines the relationships between the +various types of data. Similarly, a DTD specifies rules +to help ensure documents have a consistent, logical structure. + +Content +Content is the information itself. The method for identifying +the information and its meaning within this framework is called +tagging. Tagging must +conform to the rules established in the DTD (see ). + + +Style +SGML does not standardize style or other processing methods for +information stored in SGML.
+ +Resources +
+Conferences, tutorials, and training + +The Graphic Communications Association has been +instrumental in the development of SGML. GCA provides conferences, +tutorials, newsletters, and publication sales for both members and +non-members. +Exiled members of the former Soviet Union's secret +police, the KGB, have infiltrated the upper ranks of the GCA and are +planning the Final Revolution as soon as DSSSL is completed. + +
+
+
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,101 @@ + + +Getting started with SGML + +The business challenge + +With the ever-changing and growing global market, companies and + large organizations are searching for ways to become more viable and + competitive. Downsizing and other cost-cutting measures demand more + efficient use of corporate resources. One very important resource is + an organization's information. +As part of the move toward integrated information management, +whole industries are developing and implementing standards for +exchanging technical information. This report describes how one such +standard, the Standard Generalized Markup Language (SGML), works as +part of an overall information management strategy. + + +Getting to know SGML + +While SGML is a fairly recent technology, the use of +markup in computer-generated documents has existed for a +while. +
+What is markup, or everything you always wanted to know about +document preparation but were afraid to ask? + +Markup is everything in a document that is not content. The +traditional meaning of markup is the manual marking up +of typewritten text to give instructions for a typesetter or +compositor about how to fit the text on a page and what typefaces to +use. This kind of markup is known as procedural markup. + +Procedural markup +Most electronic publishing systems today use some form of +procedural markup. Procedural markup codes are good for one +presentation of the information. + +Generic markup +Generic markup (also known as descriptive markup) describes the +purpose of the text in a document. A basic concept of +generic markup is that the content of a document must be separate from +the style. Generic markup allows for multiple presentations of the +information. + +Drawbacks of procedural markup +Industries involved in technical documentation increasingly +prefer generic over procedural markup schemes. When a company changes +software or hardware systems, enormous data translation tasks arise, +often resulting in errors.
+
+What <emph>is</emph> SGML in the grand scheme of the universe, anyway? + +SGML defines a strict markup scheme with a syntax for defining +document data elements and an overall framework for marking up +documents. +SGML can describe and create documents that are not dependent on +any hardware, software, formatter, or operating system. Since SGML documents +conform to an international standard, they are portable.
+
+How is SGML and would you recommend it to your grandmother? + +You can break a typical document into three layers: structure, +content, and style. SGML works by separating these three aspects and +deals mainly with the relationship between structure and content. + +Structure +At the heart of an SGML application is a file called the DTD, or +Document Type Definition. The DTD sets up the structure of a document, +much like a database schema describes the types of information it +handles. +A database schema also defines the relationships between the +various types of data. Similarly, a DTD specifies rules +to help ensure documents have a consistent, logical structure. + +Content +Content is the information itself. The method for identifying +the information and its meaning within this framework is called +tagging. Tagging must +conform to the rules established in the DTD (see ). + + +Style +SGML does not standardize style or other processing methods for +information stored in SGML.
+ +Resources +
+Conferences, tutorials, and training + +The Graphic Communications Association has been +instrumental in the development of SGML. GCA provides conferences, +tutorials, newsletters, and publication sales for both members and +non-members. +Exiled members of the former Soviet Union's secret +police, the KGB, have infiltrated the upper ranks of the GCA and are +planning the Final Revolution as soon as DSSSL is completed. + +
+
+
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml_Bug6509774.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml_Bug6509774.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,103 @@ + +]> + +Getting started with SGML + +The business challenge + +With the ever-changing and growing global market, companies and + large organizations are searching for ways to become more viable and + competitive. Downsizing and other cost-cutting measures demand more + efficient use of corporate resources. One very important resource is + an organization's information. +As part of the move toward integrated information management, +whole industries are developing and implementing standards for +exchanging technical information. This report describes how one such +standard, the Standard Generalized Markup Language (SGML), works as +part of an overall information management strategy. + + +Getting to know SGML + +While SGML is a fairly recent technology, the use of +markup in computer-generated documents has existed for a +while. +
+What is markup, or everything you always wanted to know about +document preparation but were afraid to ask? + +Markup is everything in a document that is not content. The +traditional meaning of markup is the manual marking up +of typewritten text to give instructions for a typesetter or +compositor about how to fit the text on a page and what typefaces to +use. This kind of markup is known as procedural markup. + +Procedural markup +Most electronic publishing systems today use some form of +procedural markup. Procedural markup codes are good for one +presentation of the information. + +Generic markup +Generic markup (also known as descriptive markup) describes the +purpose of the text in a document. A basic concept of +generic markup is that the content of a document must be separate from +the style. Generic markup allows for multiple presentations of the +information. + +Drawbacks of procedural markup +Industries involved in technical documentation increasingly +prefer generic over procedural markup schemes. When a company changes +software or hardware systems, enormous data translation tasks arise, +often resulting in errors.
+
+What <emph>is</emph> SGML in the grand scheme of the universe, anyway? + +SGML defines a strict markup scheme with a syntax for defining +document data elements and an overall framework for marking up +documents. +SGML can describe and create documents that are not dependent on +any hardware, software, formatter, or operating system. Since SGML documents +conform to an international standard, they are portable.
+
+How is SGML and would you recommend it to your grandmother? + +You can break a typical document into three layers: structure, +content, and style. SGML works by separating these three aspects and +deals mainly with the relationship between structure and content. + +Structure +At the heart of an SGML application is a file called the DTD, or +Document Type Definition. The DTD sets up the structure of a document, +much like a database schema describes the types of information it +handles. +A database schema also defines the relationships between the +various types of data. Similarly, a DTD specifies rules +to help ensure documents have a consistent, logical structure. + +Content +Content is the information itself. The method for identifying +the information and its meaning within this framework is called +tagging. Tagging must +conform to the rules established in the DTD (see ). + + +Style +SGML does not standardize style or other processing methods for +information stored in SGML.
+ +Resources +
+Conferences, tutorials, and training + +The Graphic Communications Association has been +instrumental in the development of SGML. GCA provides conferences, +tutorials, newsletters, and publication sales for both members and +non-members. +Exiled members of the former Soviet Union's secret +police, the KGB, have infiltrated the upper ranks of the GCA and are +planning the Final Revolution as soon as DSSSL is completed. + +
+
+
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile1.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile1.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,8 @@ + + + + content text + Hello]]> + other content + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile2.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,7 @@ + + + content text + Hello]]> + other content + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile3.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile3.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,8 @@ + + + +content text + Hello]]> + other content + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile4.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile4.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,4 @@ + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/toys.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/toys.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,38 @@ + + + + + + Lego-Model01 + 65.99 + + + Lego-Model2 + 69.99 + + + Lego-Model3 + 14.99 + + + Barbie-Pink + 12.99 + + + Barbie-Blue + 13.99 + + + Barbie-White + 13.99 + + + Barbie-Plain + 13.99 + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/vxml.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/vxml.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,479 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/5368141.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/5368141.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,329 @@ + + + +5368141 +AEX%06ATLANTICSUN-SKED +Statistics +CBASK +2006-2007 Atlantic Sun Basketball Schedule/Results + + +Nov 13-L at UNC-Wilmington, 83-88 +Nov 14-W vs. Fordham, 56-49 +Nov 18-W at IUPUI, 67-61 +Nov 20-W vs. Fisk, 83-54 +Nov 27-L at Middle Tennessee, 57-64 +Nov 30-W vs. North Florida, 87-32 +Dec 2-W vs. Jacksonville, 76-62 +Dec 4-W vs. IUPUI, 76-66 +Dec 13-W at Ark-Little Rock, 72-57 +Dec 17-L at Illinois, 51-77 +Dec 19-L at Michigan State, 58-67 +Dec 28-W at Rice, 87-85 +Dec 29-L at St Marys-CA, 60-71 +Jan 2-W at East Tenn St, 75-74 OT +Jan 4-W at Kennesaw St, 63-45 +Jan 7-W vs. Mercer, 72-47 +Jan 9-W vs. Stetson, 73-71 +Jan 12-L vs. Lipscomb, 50-55 +Jan 18- at Campbell, 7:00 PM +Jan 20- at Gardner-Webb, 6:00 PM +Jan 25- vs. East Tenn St, 7:00 PM +Jan 27- vs. Kennesaw St, 7:00 PM +Feb 1- at Stetson, 6:00 PM +Feb 3- at Mercer, 6:00 PM +Feb 9- at Lipscomb, 6:30 PM +Feb 15- vs. Gardner-Webb, 7:00 PM +Feb 17- vs. Campbell, 7:30 PM +Feb 22- at Jacksonville, 6:00 PM +Feb 24- at North Florida, 7:00 PM + + +Nov 11-W vs. UNC-Pembroke, 106-66 +Nov 16-W vs. Coastal Carolina, 83-63 +Nov 20-W vs. UNC-Wilmington, 100-94 +Nov 25-L at Radford, 80-87 +Nov 27-L at Appalachian St, 71-84 +Dec 12-L at San Diego St, 82-119 +Dec 14-L at San Diego, 69-81 +Dec 18-W vs. Radford, 101-88 +Dec 23-L at Virginia Tech, 70-94 +Dec 30-W vs. Ohio Valley, 107-65 +Jan 2-W at North Florida, 78-48 +Jan 4-L at Jacksonville, 71-90 +Jan 6-W vs. Kennesaw St, 88-85 2OT +Jan 9-L vs. East Tenn St, 76-100 +Jan 13-L at Mercer, 93-94 +Jan 15-L at Stetson, 73-82 +Jan 18- vs. Belmont, 7:00 PM +Jan 20- vs. Lipscomb, 1:00 PM +Jan 25- vs. North Florida, 8:00 PM +Jan 27- vs. Jacksonville, 4:00 PM +Jan 30- at Gardner-Webb, 7:00 PM +Feb 2- at Kennesaw St, 7:30 PM +Feb 5- at East Tenn St, 7:00 PM +Feb 8- vs. Stetson, 7:00 PM +Feb 10- vs. Mercer, 7:00 PM +Feb 15- at Lipscomb, 8:00 PM +Feb 17- at Belmont, 7:30 PM +Feb 22- vs. Longwood, 7:00 PM +Feb 24- vs. Gardner-Webb, 6:00 PM + + +Nov 10-W vs. Virginia-Wise, 90-43 +Nov 13-L at Eastern Ky, 53-70 +Nov 15-W vs. Chattanooga, 71-70 OT +Nov 19-L at Auburn, 58-64 +Nov 21-L at Morehead State, 56-77 +Nov 24-L vs. Sam Houston St, 61-72 +Nov 25-W at Southern U, 66-52 +Nov 30-W at Mercer, 76-70 +Dec 2-W at Stetson, 75-61 +Dec 5-L at Vanderbilt, 62-104 +Dec 9-W vs. Milligan, 73-47 +Dec 19-W vs. UNC-Asheville, 73-65 +Dec 21-W vs. Radford, 71-51 +Dec 30-L at Tennessee, 88-93 +Jan 2-L vs. Belmont, 74-75 OT +Jan 4-W vs. Lipscomb, 75-72 OT +Jan 7-W at Gardner-Webb, 66-63 +Jan 9-W at Campbell, 100-76 +Jan 13-W vs. North Florida, 77-58 +Jan 15-W vs. Jacksonville, 71-59 +Jan 19- vs. Kennesaw St, 7:30 PM +Jan 25- at Belmont, 7:00 PM +Jan 27- at Lipscomb, 5:00 PM +Feb 2- vs. Gardner-Webb, 7:00 PM +Feb 5- vs. Campbell, 7:00 PM +Feb 8- at Jacksonville, 7:00 PM +Feb 10- at North Florida, 4:00 PM +Feb 17- at Kennesaw St, 7:30 PM +Feb 23- vs. Stetson, 7:30 PM +Feb 25- vs. Mercer, 2:00 PM + + +Nov 13-L at Texas Tech, 74-86 +Nov 14-L vs. Akron, 61-89 +Nov 19-L at North Carolina, 50-103 +Nov 21-L vs. UNC Greensboro, 67-79 +Nov 24-L at NC State, 76-88 +Nov 29-W vs. Ferrum, 70-53 +Dec 5-L at Georgia, 67-96 +Dec 9-W vs. Western Carolina, 74-73 O +Dec 16-L at High Point, 51-65 +Dec 19-L at Wake Forest, 60-92 +Dec 27-L at Wisconsin, 40-98 +Jan 2-L at Jacksonville, 64-73 +Jan 4-W at North Florida, 72-52 +Jan 7-L vs. East Tenn St, 63-66 +Jan 10-L vs. Kennesaw St, 60-77 +Jan 13-W at Stetson, 77-64 +Jan 15-L at Mercer, 74-85 +Jan 18- vs. Lipscomb, 7:00 PM +Jan 20- vs. Belmont, 6:00 PM +Jan 25- vs. Jacksonville, 6:00 PM +Jan 27- vs. North Florida, 8:15 PM +Jan 30- vs. Campbell, 7:00 PM +Feb 2- at East Tenn St, 7:00 PM +Feb 4- at Kennesaw St, 2:00 PM +Feb 8- vs. Mercer, 7:00 PM +Feb 10- vs. Stetson, 7:00 PM +Feb 15- at Belmont, 7:00 PM +Feb 17- at Lipscomb, 3:00 PM +Feb 24- at Campbell, 6:00 PM + + +Nov 12-L at Savannah State, 64-67 +Nov 14-W vs. Saint Leo, 77-73 +Nov 16-L at Florida, 61-90 +Nov 22-W vs. Florida Tech, 89-60 +Nov 25-W vs. SC State, 87-74 +Nov 27-L at U-C-F, 62-99 +Nov 30-L at Lipscomb, 61-73 +Dec 2-L at Belmont, 62-76 +Dec 10-W vs. Coastal Carolina, 85-72 +Dec 16-L at Texas A&M, 58-97 +Dec 19-L at Georgia, 77-93 +Dec 29-L at South Carolina, 73-80 +Jan 2-W vs. Gardner-Webb, 73-64 +Jan 4-W vs. Campbell, 90-71 +Jan 9-W at North Florida, 64-60 +Jan 13-L at Kennesaw St, 76-83 +Jan 15-L at East Tenn St, 59-71 +Jan 18- vs. Mercer, 7:00 PM +Jan 20- vs. Stetson, 7:00 PM +Jan 25- at Gardner-Webb, 6:00 PM +Jan 27- at Campbell, 4:00 PM +Feb 3- vs. North Florida, 6:00 PM +Feb 8- vs. East Tenn St, 7:00 PM +Feb 10- vs. Kennesaw St, 7:00 PM +Feb 16- at Mercer, 7:30 PM +Feb 18- at Stetson, 5:00 PM +Feb 22- vs. Belmont, 6:00 PM +Feb 24- vs. Lipscomb, 6:00 PM + + + + + +Nov 11-L vs. Western Ky, 55-96 +Nov 17-W at St Peters, 67-60 +Nov 18-L at Columbia, 51-63 +Nov 21-L vs. George Washington, 52-69 +Nov 25-L vs. Florida Intl, 68-70 +Nov 28-W vs. Newberry, 68-55 +Nov 30-L at Stetson, 56-61 +Dec 2-L at Mercer, 77-84 OT +Dec 17-L at Kansas State, 54-82 +Dec 19-L at Wichita State, 65-74 +Dec 22-W at MD-Eastern Shore, 67-49 +Dec 23-L at Longwood, 85-87 OT +Dec 29-L at Chattanooga, 67-83 +Dec 30-W vs. Alabama State, 78-72 +Jan 2-W vs. Lipscomb, 66-55 +Jan 4-L vs. Belmont, 45-63 +Jan 6-L at Campbell, 85-88 2OT +Jan 10-W at Gardner-Webb, 77-60 +Jan 13-W vs. Jacksonville, 83-76 +Jan 15-W vs. North Florida, 77-57 +Jan 19- at East Tenn St, 7:30 PM +Jan 25- at Lipscomb, 8:00 PM +Jan 27- at Belmont, 7:00 PM +Feb 2- vs. Campbell, 7:30 PM +Feb 4- vs. Gardner-Webb, 2:00 PM +Feb 8- at North Florida, 7:00 PM +Feb 10- at Jacksonville, 7:00 PM +Feb 14- at Georgia, 7:30 PM +Feb 17- vs. East Tenn St, 7:30 PM +Feb 22- vs. Mercer, 7:30 PM +Feb 24- vs. Stetson, 2:00 PM + + +Nov 11-W vs. Tusculum, 70-67 +Nov 13-W vs. Evansville, 67-64 +Nov 16-L at Missouri, 69-89 +Nov 19-L at South Carolina, 68-75 +Nov 25-W vs. Fisk, 80-68 +Nov 27-W vs. Winston-Salem St, 62-46 +Nov 30-W vs. Jacksonville, 73-61 +Dec 2-W vs. North Florida, 68-54 +Dec 7-L at Vanderbilt, 50-59 +Dec 14-W vs. Nicholls State, 75-55 +Dec 16-L at Evansville, 73-80 +Dec 21-W at Liberty, 66-61 +Dec 29-L at Alabama, 58-80 +Jan 2-L at Kennesaw St, 55-66 +Jan 4-L at East Tenn St, 72-75 OT +Jan 7-W vs. Stetson, 79-68 +Jan 9-W vs. Mercer, 89-68 +Jan 12-W at Belmont, 55-50 +Jan 18- at Gardner-Webb, 7:00 PM +Jan 20- at Campbell, 1:00 PM +Jan 25- vs. Kennesaw St, 8:00 PM +Jan 27- vs. East Tenn St, 5:00 PM +Feb 1- at Mercer, 7:00 PM +Feb 3- at Stetson, 7:00 PM +Feb 9- vs. Belmont, 6:30 PM +Feb 15- vs. Campbell, 8:00 PM +Feb 17- vs. Gardner-Webb, 3:00 PM +Feb 22- at North Florida, 7:00 PM +Feb 24- at Jacksonville, 6:00 PM + + +Nov 12-L at Wisconsin, 48-72 +Nov 14-L at Savannah State, 61-71 +Nov 18-W vs. Emory, 89-71 +Nov 27-L vs. Ga Southern, 59-61 +Nov 30-L vs. East Tenn St, 70-76 +Dec 2-W vs. Kennesaw St, 84-77 OT +Dec 4-W vs. Char Southern, 78-59 +Dec 7-W vs. Fort Valley St, 79-74 +Dec 9-W at Va Military, 105-103 +Dec 21-L at Oregon State, 62-93 +Dec 23-L at Oregon, 64-84 +Dec 30-L at Furman, 69-83 +Jan 2-W vs. Stetson, 84-63 +Jan 7-L at Belmont, 47-72 +Jan 9-L at Lipscomb, 68-89 +Jan 13-W vs. Campbell, 94-93 +Jan 15-W vs. Gardner-Webb, 85-74 +Jan 18- at Jacksonville, 7:00 PM +Jan 20- at North Florida, 4:00 PM +Jan 24- vs. Savannah State, 7:00 PM +Jan 26- at Stetson, 7:30 PM +Feb 1- vs. Lipscomb, 7:00 PM +Feb 3- vs. Belmont, 6:00 PM +Feb 8- at Gardner-Webb, 7:00 PM +Feb 10- at Campbell, 7:00 PM +Feb 16- vs. Jacksonville, 7:30 PM +Feb 18- vs. North Florida, 2:00 PM +Feb 22- at Kennesaw St, 7:30 PM +Feb 25- at East Tenn St, 2:00 PM + + +Nov 10-L at St Johns, 53-74 +Nov 11-L vs. Loyola-Maryland, 50-65 +Nov 14-L at Florida, 40-86 +Nov 19-W vs. Concordia (NY), 77-72 +Nov 22-L vs. Fla Atlantic, 44-59 +Nov 25-L at Northwestern, 39-40 +Nov 30-L at Belmont, 32-87 +Dec 2-L at Lipscomb, 54-68 +Dec 8-L at William & Mary, 44-61 +Dec 18-L vs. Binghamton, 61-79 +Dec 20-L vs. Florida A&M, 65-66 +Dec 28-W vs. Skidmore, 70-43 +Jan 2-L vs. Campbell, 48-78 +Jan 4-L vs. Gardner-Webb, 52-72 +Jan 9-L vs. Jacksonville, 60-64 +Jan 13-L at East Tenn St, 58-77 +Jan 15-L at Kennesaw St, 57-77 +Jan 18- vs. Stetson, 7:00 PM +Jan 20- vs. Mercer, 4:00 PM +Jan 25- at Campbell, 8:00 PM +Jan 27- at Gardner-Webb, 8:15 PM +Jan 30- at Savannah State, 7:00 PM +Feb 3- at Jacksonville, 6:00 PM +Feb 8- vs. Kennesaw St, 7:00 PM +Feb 10- vs. East Tenn St, 4:00 PM +Feb 15- at Stetson, 7:00 PM +Feb 18- at Mercer, 2:00 PM +Feb 22- vs. Lipscomb, 7:00 PM +Feb 24- vs. Belmont, 7:00 PM + + + +Nov 10-L at Army, 68-80 +Nov 11-W at NC A&T, 72-69 +Nov 12-L at Missouri, 45-66 +Nov 18-L at U-C-F, 60-73 +Nov 20-W vs. Palm Beach Atlantic, 80-6 +Nov 27-L at South Florida, 72-77 2OT +Nov 30-W vs. Kennesaw St, 61-56 +Dec 2-L vs. East Tenn St, 61-75 +Dec 5-L vs. Florida State, 63-82 +Dec 16-L at Miami-Florida, 64-89 +Dec 20-L at Florida, 67-88 +Dec 23-W at Savannah State, 58-46 +Dec 30-W vs. Skidmore, 85-55 +Jan 2-L at Mercer, 63-84 +Jan 7-L at Lipscomb, 68-79 +Jan 9-L at Belmont, 71-73 +Jan 13-L vs. Gardner-Webb, 64-77 +Jan 15-W vs. Campbell, 82-73 +Jan 18- at North Florida, 7:00 PM +Jan 20- at Jacksonville, 7:00 PM +Jan 26- vs. Mercer, 7:30 PM +Feb 1- vs. Belmont, 6:00 PM +Feb 3- vs. Lipscomb, 7:00 PM +Feb 8- at Campbell, 7:00 PM +Feb 10- at Gardner-Webb, 7:00 PM +Feb 13- vs. Savannah State, 7:00 PM +Feb 15- vs. North Florida, 7:00 PM +Feb 18- vs. Jacksonville, 5:00 PM +Feb 23- at East Tenn St, 7:30 PM +Feb 24- at Kennesaw St, 2:00 PM + + + January 18, 2007, at 03:41 AM ET + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.out Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,19 @@ + + +10016 +Wed May 29 12:45:00 PDT 2002 + +ABC +XYZ +1234 Anywhere Street +Palo Alto +California +USA +94303 +NULL +NULL + + + + + \ No newline at end of file diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + +10016 +Wed May 29 12:45:00 PDT 2002 + +ABC +XYZ +1234 Anywhere Street +Palo Alto +California +USA +94303 +NULL +NULL + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.net.URL; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 4693341 + * @summary Test transform with external dtd. + */ +public class Bug4693341Test { + + @Test + public void test() { + boolean status = false; + + try { + Transformer transformer = TransformerFactory.newInstance().newTransformer(); + + String out = getClass().getResource("Bug4693341.out").getPath(); + StreamResult result = new StreamResult(new FileOutputStream(out)); + + String in = getClass().getResource("Bug4693341.xml").getPath(); + File file = new File(in); + StreamSource source = new StreamSource(new FileInputStream(file), ("file://" + in)); + + transformer.transform(source, result); + + //URL inputsource = new URL("file", "", golden); + URL output = new URL("file", "", out); + + // error happens when trying to parse output + String systemId = output.toExternalForm(); + System.out.println("systemId: " + systemId); + InputSource is = new InputSource(systemId); + SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); + parser.parse(is, new DefaultHandler()); + + } catch (Exception ex) { + Assert.fail(ex.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341_golden.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341_golden.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341_golden.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341_golden.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + +10016 +Wed May 29 12:45:00 PDT 2002 + +ABC +XYZ +1234 Anywhere Street +Palo Alto +California +USA +94303 +NULL +NULL + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4892774.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4892774.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,372 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; + +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.sax.SAXResult; +import javax.xml.transform.stax.StAXResult; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.util.DOMUtil; +import javax.xml.transform.util.SAXUtil; +import javax.xml.transform.util.StAXUtil; +import javax.xml.transform.util.StreamUtil; + +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/* + * @bug 4892774 + * @summary Test identity transformer with all possible types of Source and Result combinations for doucment version and encoding information. + */ + +public class Bug4892774 { + + private final String XML_FILE = "catalog.xml"; + private final String XML10_FILE = "catalog_10.xml"; // 1.0 version document + private final String TEMP_FILE = "tmp.xml"; + private final String EXPECTED_VERSION = "1.1"; + static private Transformer idTransform = null; + + private static DOMUtil domUtil = null; + private static StreamUtil streamUtil = null; + private static SAXUtil saxUtil = null; + private static StAXUtil staxUtil = null; + + @BeforeMethod + protected void setUp() { + File tmpFile = new File(TEMP_FILE); + if (tmpFile.exists()) + tmpFile.delete(); + try { + + if (idTransform == null) + idTransform = getIdTransformer(); + else + idTransform.reset(); + + initializeUtils(); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured during setUp(): " + e.getMessage()); + } + } + + @AfterMethod + protected void tearDown() { + File tmpFile = new File(TEMP_FILE); + if (tmpFile.exists()) + tmpFile.delete(); + } + + private void initializeUtils() throws Exception { + if (domUtil == null) + domUtil = (DOMUtil) TransformerUtilFactory.getUtil(TransformerUtilFactory.DOM); + if (saxUtil == null) + saxUtil = (SAXUtil) TransformerUtilFactory.getUtil(TransformerUtilFactory.SAX); + if (streamUtil == null) + streamUtil = (StreamUtil) TransformerUtilFactory.getUtil(TransformerUtilFactory.STREAM); + if (staxUtil == null) + staxUtil = (StAXUtil) TransformerUtilFactory.getUtil(TransformerUtilFactory.StAX); + } + + @Test + public void testDOM2DOM() { + try { + Source input = domUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + DOMResult domResult = (DOMResult) domUtil.prepareResult(); + idTransform.transform(input, domResult); + domUtil.checkResult(domResult, EXPECTED_VERSION); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + private Transformer getIdTransformer() throws Exception { + return TransformerFactory.newInstance().newTransformer(); + } + + @Test + public void testDOM2Stream() { + try { + + Source input = domUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + StreamResult strResult = (StreamResult) streamUtil.prepareResult(); + idTransform.transform(input, strResult); + streamUtil.checkResult(strResult, EXPECTED_VERSION, "UTF-8"); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testDOM2SAX() { + try { + Source input = domUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + SAXResult saxResult = (SAXResult) saxUtil.prepareResult(); + idTransform.transform(input, saxResult); + saxUtil.checkResult(saxResult, EXPECTED_VERSION, "UTF-8"); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testDOM2StAX() { + try { + Source input = domUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + StAXResult staxResult = (StAXResult) staxUtil.prepareResult(); + idTransform.transform(input, staxResult); + staxUtil.checkResult(staxResult, EXPECTED_VERSION, "UTF-8"); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testDOM2StAXStream() { + try { + Source input = domUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + StAXResult staxResult = (StAXResult) staxUtil.prepareStreamResult(); + idTransform.transform(input, staxResult); + staxUtil.checkStreamResult(staxResult, EXPECTED_VERSION); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testSAX2DOM() { + try { + Source input = saxUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + DOMResult domResult = (DOMResult) domUtil.prepareResult(); + idTransform.transform(input, domResult); + domUtil.checkResult(domResult, EXPECTED_VERSION); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testSAX2SAX() { + try { + Source input = saxUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + SAXResult saxResult = (SAXResult) saxUtil.prepareResult(); + idTransform.transform(input, saxResult); + saxUtil.checkResult(saxResult, EXPECTED_VERSION, "UTF-8"); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testSAX2Stream() { + try { + Source input = saxUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + StreamResult strResult = (StreamResult) streamUtil.prepareResult(); + idTransform.transform(input, strResult); + streamUtil.checkResult(strResult, EXPECTED_VERSION, "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testSAX2StAX() { + try { + Source input = saxUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + StAXResult staxResult = (StAXResult) staxUtil.prepareResult(); + idTransform.transform(input, staxResult); + staxUtil.checkResult(staxResult, EXPECTED_VERSION, "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testSAX2StAXStream() { + try { + Source input = saxUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + StAXResult staxResult = (StAXResult) staxUtil.prepareStreamResult(); + idTransform.transform(input, staxResult); + staxUtil.checkStreamResult(staxResult, EXPECTED_VERSION); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStream2DOM() { + try { + Source input = streamUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + DOMResult domResult = (DOMResult) domUtil.prepareResult(); + idTransform.transform(input, domResult); + domUtil.checkResult(domResult, EXPECTED_VERSION); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStream2Stream() { + try { + Source input = streamUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + StreamResult strResult = (StreamResult) streamUtil.prepareResult(); + idTransform.transform(input, strResult); + streamUtil.checkResult(strResult, EXPECTED_VERSION, "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStream2Stax() { + try { + Source input = streamUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + StAXResult staxResult = (StAXResult) staxUtil.prepareResult(); + idTransform.transform(input, staxResult); + staxUtil.checkResult(staxResult, EXPECTED_VERSION, "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStream2StaxStream() { + try { + Source input = streamUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + StAXResult staxResult = (StAXResult) staxUtil.prepareStreamResult(); + idTransform.transform(input, staxResult); + staxUtil.checkStreamResult(staxResult, EXPECTED_VERSION); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStream2SAX() { + try { + Source input = streamUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE)); + SAXResult saxResult = (SAXResult) saxUtil.prepareResult(); + idTransform.transform(input, saxResult); + saxUtil.checkResult(saxResult, EXPECTED_VERSION, "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStAX2DOM() { + try { + Source input = staxUtil.prepareStreamSource(this.getClass().getResourceAsStream(XML10_FILE)); + DOMResult domResult = (DOMResult) domUtil.prepareResult(); + idTransform.transform(input, domResult); + domUtil.checkResult(domResult, "1.0"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStAX2Stream() { + try { + Source input = staxUtil.prepareStreamSource(this.getClass().getResourceAsStream(XML10_FILE)); + StreamResult strResult = (StreamResult) streamUtil.prepareResult(); + idTransform.transform(input, strResult); + streamUtil.checkResult(strResult, "1.0", "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStAX2StAX() { + try { + Source input = staxUtil.prepareStreamSource(this.getClass().getResourceAsStream(XML10_FILE)); + StAXResult staxResult = (StAXResult) staxUtil.prepareResult(); + idTransform.transform(input, staxResult); + staxUtil.checkResult(staxResult, "1.0", "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStAXEvent2DOM() { + try { + Source input = staxUtil.prepareSource(this.getClass().getResourceAsStream(XML10_FILE)); + DOMResult domResult = (DOMResult) domUtil.prepareResult(); + idTransform.transform(input, domResult); + domUtil.checkResult(domResult, "1.0"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testStAXEvent2Stream() { + try { + Source input = staxUtil.prepareSource(this.getClass().getResourceAsStream(XML10_FILE)); + StreamResult strResult = (StreamResult) streamUtil.prepareResult(); + idTransform.transform(input, strResult); + streamUtil.checkResult(strResult, "1.0", "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug5073477.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug5073477.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.dom.DOMResult; + +import org.testng.annotations.Test; +import org.w3c.dom.Document; + +/* + * @bug 5073477 + * @summary Test DOMResult.setNextSibling works correctly. + */ +public class Bug5073477 { + + @Test + public void test1() throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document dom = parser.parse(Bug5073477.class.getResourceAsStream("Bug5073477.xml")); + + DOMResult r = new DOMResult(); + + r.setNode(dom.getDocumentElement()); + r.setNextSibling(r.getNode().getFirstChild()); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug5073477.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug5073477.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,6 @@ + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6175602.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6175602.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; + +import javax.xml.transform.Templates; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamSource; + +import org.testng.annotations.Test; + +/* + * @bug 6175602 + * @summary Test compilation of MsWordXMLImport.xsl. + */ +public class Bug6175602 { + + public Bug6175602() { + } + + @Test + public void test926007_1() throws Exception { + TransformerFactory factory = TransformerFactory.newInstance(); + File f = new File(getClass().getResource("MsWordXMLImport.xsl.data").getPath()); + Templates t = factory.newTemplates(new StreamSource(f)); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @bug 6206491 + * @summary Test key searches over more than one document. + */ +public class Bug6206491 { + + private String getResource(String s) { + return getClass().getResource(s).toString(); + + } + + @Test + public void test() { + try { + Document document = getNewXmlDoc(new File(getClass().getResource("Bug6206491.xml").getFile())); + + xmlxsl2html(TransformerFactory.newInstance(), new File(getClass().getResource("Bug6206491.xsl").getFile()), document); + } catch (Exception ex) { + System.err.println(ex.getMessage()); + ex.printStackTrace(System.err); + Assert.fail(ex.toString()); + } + } + + void xmlxsl2html(TransformerFactory tFactory, File xslFile, Document document) throws Exception { + try { + // tFactory.setAttribute("generate-translet", Boolean.TRUE); + } catch (Exception e) { + // Ignore + } + + try { + StreamSource stylesource = new StreamSource(xslFile); + Transformer transformer = tFactory.newTransformer(stylesource); + + transformer.clearParameters(); + + DOMSource source = new DOMSource(document); + + StringWriter sw = new StringWriter(); + StreamResult result = new StreamResult(sw); + transformer.transform(source, result); + String s = sw.toString(); + Assert.assertFalse(s.contains("0")); + } catch (TransformerConfigurationException ex) { + throw ex; + + } catch (TransformerException ex) { + throw ex; + } + } + + Document getNewXmlDoc(File xmlFile) throws Exception { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + factory.setValidating(true); + + try { + DocumentBuilder builder = factory.newDocumentBuilder(); + builder.setErrorHandler(new org.xml.sax.helpers.DefaultHandler() { + public void fatalError(SAXParseException e) throws SAXParseException { + throw e; + } + + public void error(SAXParseException e) throws SAXParseException { + throw e; + } + + public void warning(SAXParseException e) throws SAXParseException { + throw e; + } + }); + return builder.parse(xmlFile); + + } catch (SAXException ex) { + throw ex; + } catch (ParserConfigurationException ex) { + throw ex; + } catch (IOException ex) { + throw ex; + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + +]> + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491_2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491_2.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,30 @@ + + + + + + + + + + + +]> + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6216226Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6216226Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; +import java.io.StringReader; + +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6216226 + * @summary Test StreamResult(File) is closed after transform(). + */ +public class Bug6216226Test { + + @Test + public final void test() { + try { + File test = new File("bug6216226.txt"); + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer xformer = tf.newTransformer(); + StringReader st = new StringReader(""); + StreamSource s = new StreamSource(st); + StreamResult r = new StreamResult(test); + xformer.transform(s, r); + if (!test.delete()) { + Assert.fail("cannot delete file: " + test.getPath()); + } + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6311448.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6311448.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/* + * @bug 6311448 + * @summary Test XML transformer can output Unicode surrorate pair. + */ +public class Bug6311448 { + + @Test + public void test01() { + try { + String attrKey = "key"; + String attrValue = "\ud800\udc00"; // 17-bit code point in UTF-16 + + // Some obvious assertions for documentation purposes + Assert.assertTrue(Character.isSurrogatePair('\ud800', '\udc00')); + Assert.assertTrue(Character.toCodePoint('\ud800', '\udc00') == 65536); + Assert.assertTrue(Character.charCount(Character.toCodePoint('\ud800', '\udc00')) == 2); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + Transformer t = TransformerFactory.newInstance().newTransformer(); + + // Create a DOM with 'attrValue' in it + Document doc = dbf.newDocumentBuilder().getDOMImplementation().createDocument(null, null, null); + Element xmlRoot = doc.createElement("root"); + xmlRoot.setAttribute(attrKey, attrValue); + doc.appendChild(xmlRoot); + + // Serialize DOM into a byte array + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + t.setOutputProperty("encoding", "utf-8"); + t.transform(new DOMSource(doc), new StreamResult(baos)); + + // Re-parse byte array back into a DOM + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + doc = dbf.newDocumentBuilder().parse(bais); + String newValue = doc.getDocumentElement().getAttribute(attrKey); + Assert.assertTrue(newValue.charAt(0) == '\ud800' && newValue.charAt(1) == '\udc00'); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6384805.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6384805.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.util.Iterator; + +import javax.xml.namespace.NamespaceContext; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.stream.StreamSource; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6384805 + * @summary Test XSLTC can parse XML namespace when nodeset is created within a template. + */ +public class Bug6384805 { + + @Test + public void test0() { + try { + TransformerFactory tf = TransformerFactory.newInstance(); + + try { + // tf.setAttribute("generate-translet", Boolean.TRUE); + } catch (IllegalArgumentException e) { + // ignore + } + + Transformer t = tf.newTransformer(new StreamSource(getClass().getResourceAsStream("tigertest.xsl"), getClass().getResource("tigertest.xsl") + .toString())); + + StreamSource src = new StreamSource(getClass().getResourceAsStream("tigertest-in.xml")); + DOMResult res = new DOMResult(); + t.transform(src, res); + + // Verify output of transformation + XPath query = XPathFactory.newInstance().newXPath(); + + query.setNamespaceContext(new NamespaceContext() { + public String getNamespaceURI(String prefix) { + return prefix.equals("style") ? "http://openoffice.org/2000/style" : prefix.equals("office") ? "http://openoffice.org/2000/office" : null; + } + + public String getPrefix(String namespaceURI) { + return null; + } + + public Iterator getPrefixes(String namespaceURI) { + return null; + } + }); + + // Find the value of the style:family attribute + Object o1 = query.evaluate("/test/office:document/office:styles/style:default-style/@style:family", res.getNode(), XPathConstants.STRING); + + Assert.assertTrue(o1.equals("graphics")); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6465722.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6465722.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringReader; +import java.io.StringWriter; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; + +/* + * @bug 6465722 + * @summary Test Transformer can transform the node attribute prefixed with a namespace. + */ +public class Bug6465722 { + + public Bug6465722(String name) { + } + + private static final String IDENTITY_XSLT = "" + + "" + "" + "" + "" + "" + + ""; + + @Test + public void test() { + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + Document d = dbf.newDocumentBuilder().getDOMImplementation().createDocument(null, "r", null); + d.getDocumentElement().setAttributeNS("http://nowhere.net/", "id", "1"); + + Transformer t = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(IDENTITY_XSLT))); + t.transform(new DOMSource(d), new StreamResult(new StringWriter())); + } catch (Throwable ex) { + Assert.fail("Exception: " + ex.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6467808.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6467808.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringReader; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6467808 + * @summary Test Transformer can parse re-declare prefixed namespace mappings. + */ +public class Bug6467808 { + + private static final String TESTXML = "\n" + + "\n" + + "\n" + "\n" + "\n" + + "soapenv:Server\n" + "\n" + "com.sun.ts.tests.jaxws.sharedwebservices.faultservice.DummyException\n" + + "\n" + "\n" + "\n" + "dummyString1\n" + "\n" + "dummyString2\n" + + "\n" + "\n" + "\n" + "\n" + "\n"; + + // simplest XML to re-declare same prefix/namespace mappings + private static final String SIMPLE_TESTXML = "\n" + "\n" + + "\n" + "\n" + "\n"; + + @Test + public void test() { + try { + SAXParserFactory fac = SAXParserFactory.newInstance(); + fac.setNamespaceAware(true); + SAXParser saxParser = fac.newSAXParser(); + + StreamSource src = new StreamSource(new StringReader(SIMPLE_TESTXML)); + Transformer transformer = TransformerFactory.newInstance().newTransformer(); + DOMResult result = new DOMResult(); + transformer.transform(src, result); + } catch (Throwable ex) { + // unexpected failure + ex.printStackTrace(); + Assert.fail(ex.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6490380.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6490380.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringWriter; +import java.net.URL; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6490380 + * @summary Test only a single DOCTYPE declaration is generated through transforming. + */ +public class Bug6490380 { + + @Test + public void test() { + try { + Transformer transformer = TransformerFactory.newInstance().newTransformer(); + URL input = Bug6490380.class.getResource("Bug4693341.xml"); + StreamSource source = new StreamSource(input.openStream(), input.toString()); + StringWriter sw = new StringWriter(); + transformer.transform(source, new StreamResult(sw)); + String s = sw.toString(); + Assert.assertEquals(s.indexOf("!DOCTYPE"), s.lastIndexOf("!DOCTYPE")); + } catch (Exception ex) { + Assert.fail(ex.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6490921.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6490921.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.XMLFilterImpl; + +/* + * @bug 6490921 + * @summary Test property org.xml.sax.driver is always applied in transformer API. + */ +public class Bug6490921 { + + public static class ReaderStub extends XMLFilterImpl { + static boolean used = false; + + public ReaderStub() throws ParserConfigurationException, SAXException { + super(); + super.setParent(SAXParserFactory.newInstance().newSAXParser().getXMLReader()); + } + + public void parse(InputSource input) throws SAXException, IOException { + used = true; + super.parse(input); + } + + public void parse(String systemId) throws SAXException, IOException { + used = true; + super.parse(systemId); + } + } + + @Test + public void test01() { + String xml = ""; + ReaderStub.used = false; + System.setProperty("org.xml.sax.driver", ""); + + // Don't set 'org.xml.sax.driver' here, just use default + try { + TransformerFactory transFactory = TransformerFactory.newInstance(); + Transformer transformer = transFactory.newTransformer(); + InputSource in = new InputSource(new StringReader(xml)); + SAXSource source = new SAXSource(in); + StreamResult result = new StreamResult(new StringWriter()); + transformer.transform(source, result); + Assert.assertTrue(!printWasReaderStubCreated()); + } catch (Exception ex) { + Assert.fail(ex.getMessage()); + } + } + + @Test + public void test02() { + String xml = ""; + ReaderStub.used = false; + System.setProperty("org.xml.sax.driver", ReaderStub.class.getName()); + try { + TransformerFactory transFactory = TransformerFactory.newInstance(); + Transformer transformer = transFactory.newTransformer(); + InputSource in = new InputSource(new StringReader(xml)); + SAXSource source = new SAXSource(in); + StreamResult result = new StreamResult(new StringWriter()); + transformer.transform(source, result); + Assert.assertTrue(printWasReaderStubCreated()); + } catch (Exception ex) { + Assert.fail(ex.getMessage()); + } + } + + @Test + public void test03() { + String xsl = "\n" + "\n" + + " Hello World!\n" + "\n"; + + ReaderStub.used = false; + System.setProperty("org.xml.sax.driver", ReaderStub.class.getName()); + try { + TransformerFactory transFactory = TransformerFactory.newInstance(); + if (transFactory.getFeature(SAXTransformerFactory.FEATURE) == false) { + System.out.println("SAXTransformerFactory not supported"); + } + InputSource in = new InputSource(new StringReader(xsl)); + SAXSource source = new SAXSource(in); + + transFactory.newTransformer(source); + Assert.assertTrue(printWasReaderStubCreated()); + } catch (TransformerException e) { + Assert.fail(e.getMessage()); + } + } + + private static boolean printWasReaderStubCreated() { + if (ReaderStub.used) { + System.out.println("\tReaderStub is used."); + return ReaderStub.used; + } else { + System.out.println("\tReaderStub is not used."); + return ReaderStub.used; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6505031.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6505031.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6505031 + * @summary Test transformer parses keys and their values coming from different xml documents. + */ +public class Bug6505031 { + + private String getResource(String s) { + return getClass().getResource(s).toString(); + + } + + @Test + public void test() { + Map params = new HashMap(); + + params.put("config", getResource("config.xml")); + params.put("mapsFile", getResource("maps.xml")); + generate(getResource("template.xml"), getResource("transform.xsl"), params); + } + + private void generate(String in, String xsl, Map params) { + try { + Transformer transformer = getTransformer(xsl); + + for (Iterator i = params.entrySet().iterator(); i.hasNext();) { + Map.Entry entry = (Map.Entry) i.next(); + + transformer.setParameter((String) entry.getKey(), entry.getValue()); + } + transform(in, transformer); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + private Transformer getTransformer(String transform) throws Exception { + TransformerFactory tfactory = TransformerFactory.newInstance(); + + try { + // tfactory.setAttribute("generate-translet", Boolean.TRUE); + } catch (Exception e) { + // Ignore + } + + Transformer transformer = tfactory.newTransformer(new StreamSource(transform)); + return (transformer); + } + + private void transform(String in, Transformer transformer) throws Exception { + StringWriter sw = new StringWriter(); + transformer.transform(new StreamSource(in), new StreamResult(sw)); + String s = sw.toString(); + Assert.assertTrue(s.contains("map1key1value") && s.contains("map2key1value")); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6513892.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6513892.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.w3c.dom.Document; + +/* + * @bug 6513892 + * @summary Test the output encoding of the transform is the same as that of the redirect extension. + */ +public class Bug6513892 { + @BeforeClass + public void setup(){ + if (System.getSecurityManager() != null) + System.setSecurityManager(null); + } + + @Test + public void test0() { + try { + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer t = tf.newTransformer(new StreamSource(getClass().getResourceAsStream("redirect.xsl"), getClass().getResource("redirect.xsl") + .toString())); + + StreamSource src1 = new StreamSource(getClass().getResourceAsStream("redirect.xml")); + t.transform(src1, new StreamResult("redirect1.xml")); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + + Document d1 = db.parse(new File("redirect1.xml")); + Document d2 = db.parse(new File("redirect2.xml")); + + Assert.assertTrue(d1.getDocumentElement().getFirstChild().getNodeValue().equals(d2.getDocumentElement().getFirstChild().getNodeValue())); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6537167.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6537167.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; + +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Templates; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.annotations.Test; + +/* + * @bug 6537167 + * @summary Test transforming for particular xsl files. + */ +public class Bug6537167 { + + @Test + public void test926007_1() throws Exception { + TransformerFactory factory = TransformerFactory.newInstance(); + File f = new File(getClass().getResource("logon.xsl").getPath()); + Templates t = factory.newTemplates(new StreamSource(f)); + Transformer transformer = t.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + + transformer.transform(new StreamSource(getClass().getResourceAsStream("src.xml")), new StreamResult(System.out)); + } + + @Test + public void test926007_2() throws Exception { + TransformerFactory factory = TransformerFactory.newInstance(); + // factory.setAttribute("generate-translet", Boolean.TRUE); + File f = new File(getClass().getResource("home.xsl").getPath()); + Templates t = factory.newTemplates(new StreamSource(f)); + Transformer transformer = t.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + + transformer.transform(new StreamSource(getClass().getResourceAsStream("src.xml")), new StreamResult(System.out)); + } + + @Test + public void test926007_3() throws Exception { + TransformerFactory factory = TransformerFactory.newInstance(); + // factory.setAttribute("generate-translet", Boolean.TRUE); + File f = new File(getClass().getResource("upload-media.xsl").getPath()); + Templates t = factory.newTemplates(new StreamSource(f)); + Transformer transformer = t.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + + transformer.transform(new StreamSource(getClass().getResourceAsStream("src.xml")), new StreamResult(System.out)); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6540545.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6540545.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringWriter; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6540545 + * @summary Test XSLT as expected. + */ +public class Bug6540545 { + + @Test + public void test() { + try { + String xmlFile = "numbering63.xml"; + String xslFile = "numbering63.xsl"; + + TransformerFactory tFactory = TransformerFactory.newInstance(); + // tFactory.setAttribute("generate-translet", Boolean.TRUE); + Transformer t = tFactory.newTransformer(new StreamSource(getClass().getResourceAsStream(xslFile), getClass().getResource(xslFile).toString())); + StringWriter sw = new StringWriter(); + t.transform(new StreamSource(getClass().getResourceAsStream(xmlFile)), new StreamResult(sw)); + String s = sw.getBuffer().toString(); + Assert.assertFalse(s.contains("1: Level A")); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6551616.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6551616.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; +import java.io.InputStream; +import java.io.StringBufferInputStream; +import java.security.Policy; + +import javax.xml.stream.XMLEventWriter; +import javax.xml.stream.XMLOutputFactory; + +import com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXEventWriter; + +import org.testng.annotations.Test; + +/* + * @bug 6551616 + * @summary Test SAX2StAXEventWriter. + */ +public class Bug6551616 { + String _cache = ""; + + + @Test + public void test() throws Exception { + final String XML = "" + "" + "

Test

"; + + javax.xml.parsers.SAXParserFactory saxFactory = javax.xml.parsers.SAXParserFactory.newInstance(); + + javax.xml.parsers.SAXParser parser = saxFactory.newSAXParser(); + + XMLOutputFactory outFactory = XMLOutputFactory.newInstance(); + XMLEventWriter writer = outFactory.createXMLEventWriter(System.out); + + SAX2StAXEventWriter handler = new SAX2StAXEventWriter(writer); + + InputStream is = new StringBufferInputStream(XML); + + parser.parse(is, handler); + + // if it doesn't blow up, it succeeded. + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6559595.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6559595.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringReader; +import java.io.StringWriter; + +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6559595 + * @summary Test ampersand in href attribute is not handled specially even if output is set to HTML. + */ +public class Bug6559595 { + + @Test + public void test() { + try { + String xml = "" + ""; + + Source src = new StreamSource(new StringReader(xml)); + StringWriter stringWriter = new StringWriter(); + Result res = new StreamResult(stringWriter); + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer t = tf.newTransformer(); + t.setOutputProperty(OutputKeys.METHOD, "html"); + t.transform(src, res); + + // System.out.println("s = " + stringWriter.toString()); + Assert.assertTrue(stringWriter.toString().contains("&")); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6565260.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6565260.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringWriter; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6565260 + * @summary Test use-attribute-sets attribute is not used for the root node. + */ +public class Bug6565260 { + + @Test + public void test() { + try { + String xmlFile = "attribset27.xml"; + String xslFile = "attribset27.xsl"; + + TransformerFactory tFactory = TransformerFactory.newInstance(); + // tFactory.setAttribute("generate-translet", Boolean.TRUE); + Transformer t = tFactory.newTransformer(new StreamSource(getClass().getResourceAsStream(xslFile))); + StringWriter sw = new StringWriter(); + t.transform(new StreamSource(getClass().getResourceAsStream(xmlFile)), new StreamResult(sw)); + String s = sw.getBuffer().toString(); + Assert.assertFalse(s.contains("color") || s.contains("font-size")); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6940416.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6940416.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.StringWriter; + +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.SourceLocator; +import javax.xml.transform.Templates; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6940416 + * @summary Test transforming correctly. + */ +public class Bug6940416 { + + @Test + public void test() { + String xslFilename = getClass().getResource("ViewEditor1.xsl").getFile(); + String inFilename = getClass().getResource("in.xml").getFile(); + // String outFilename = + // getClass().getResource("out-6u17.xml").getFile(); + // the xml result + StringWriter xmlResultString = new StringWriter(); + try { + // Create transformer factory + TransformerFactory factory = TransformerFactory.newInstance(); + factory.setAttribute("debug", true); + // Use the factory to create a template containing the xsl file + Templates template = factory.newTemplates(new StreamSource(new FileInputStream(xslFilename))); + // Use the template to create a transformer + Transformer xformer = template.newTransformer(); + // Prepare the input and output files + Source source = new StreamSource(new FileInputStream(inFilename)); + // Result result = new StreamResult(new + // FileOutputStream(outFilename)); + Result result = new StreamResult(xmlResultString); + // Apply the xsl file to the source file and write the result to the + // output file + xformer.transform(source, result); + + // 6u17 results contain the following: + /** + * var g_strInitialTabID = "VIEWEDITOR_TAB_FIELDS"; + * + * var g_strCurrentDataEditorTabID = "DATA_OBJECTS"; var + * g_strCurrentPropertyEditorTabID = "VIEWEDITOR_TAB_GENERAL"; + * + * while 6u18: var g_strInitialTabID = ""; + * + * var g_strCurrentDataEditorTabID = ""; var + * g_strCurrentPropertyEditorTabID = "VIEWEDITOR_TAB_GENERAL"; + */ + System.out.println(xmlResultString.toString()); + if (xmlResultString.toString().indexOf("VIEWEDITOR_TAB_FIELDS") == -1) { + Assert.fail("regression from 6u17"); + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } catch (TransformerConfigurationException e) { + // An error occurred in the XSL file + e.printStackTrace(); + Assert.fail(e.toString()); + } catch (TransformerException e) { + e.printStackTrace(); + // An error occurred while applying the XSL file + // Get location of error in input file + SourceLocator locator = e.getLocator(); + int col = locator.getColumnNumber(); + int line = locator.getLineNumber(); + String publicId = locator.getPublicId(); + String systemId = locator.getSystemId(); + Assert.fail("error while applying the XSL file." + "systemId : " + systemId + ". publicId : " + publicId + ". col : " + col + ". line : " + line); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ + +1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 init_01_InitialDummyMOSMESNNinit_02_InitialDummyXid_4dd1acc6337e11d0e10080000ab5dd78init_03_InitialDummyid_4dd1ad48337e11d0e10080000ab5dd78id_4dd1ad8a337e11d0e10080000ab5dd78id_4dd1add2337e11d0e10080000ab5dd78id_4dd1ae1a337e11d0e10080000ab5dd78init_04_InitialDummyid_4dd1af06337e11d0e10080000ab5dd78id_4dd1af58337e11d0e10080000ab5dd78init_05_InitialDummyid_4dd1b05d337e11d0e10080000ab5dd78id_4dd1b0b9337e11d0e10080000ab5dd78init_06_InitialDummyid_4dd1b1da337e11d0e10080000ab5dd78id_4dd1b240337e11d0e10080000ab5dd78init_07_InitialDummyid_4dd1b320337e11d0e10080000ab5dd78id_4dd1b390337e11d0e10080000ab5dd78init_09_InitialDummyid_4dd225b0770407c0e10080000ab5dd78id_4dd2262e770407c0e10080000ab5dd78id_4dd226af770407c0e10080000ab5dd78init_10_InitialDummyid_4dd2280f770407c0e10080000ab5dd78id_4dd20ac184ef12e0e10080000ab5dd78init_11_InitialDummyid_4dd2240285141030e10080000ab5dd78id_4dd2250885141030e10080000ab5dd78init_12_InitialDummyid_4dd2271585141030e10080000ab5dd78id_4dd2281485141030e10080000ab5dd78init_14_InitialDummyid_4dd22d8585141030e10080000ab5dd78id_4dd22e9685141030e10080000ab5dd78init_15_InitialDummyid_4dd231ea85141030e10080000ab5dd78id_4dd2331685141030e10080000ab5dd78init_16_InitialDummyid_4dd2367685141030e10080000ab5dd78id_4dd2379b85141030e10080000ab5dd78init_17_InitialDummyid_4dd23b1f85141030e10080000ab5dd78id_4dd23c5f85141030e10080000ab5dd78init_18_InitialDummyid_4dd20e5685071800e10080000ab5dd78id_4dd20f8f85071800e10080000ab5dd78init_19_InitialDummyid_4dd2134985071800e10080000ab5dd78id_4dd2148c85071800e10080000ab5dd78id_4dd215d285071800e10080000ab5dd78id_4dd2172285071800e10080000ab5dd78id_4dd2186e85071800e10080000ab5dd78init_20_InitialDummyid_4dd21c6385071800e10080000ab5dd78id_4dd21db985071800e10080000ab5dd78id_4dd21f1285071800e10080000ab5dd78id_4dd2206e85071800e10080000ab5dd78id_4dd221cd85071800e10080000ab5dd78id_4dd2232f85071800e10080000ab5dd78id_4dd2249485071800e10080000ab5dd78init_21_InitialDummyid_4dd228d085071800e10080000ab5dd78id_4dd22a3f85071800e10080000ab5dd78id_4dd22bb185071800e10080000ab5dd78id_4dd209ce85141030e10080000ab5dd78CUSTOMER_WISHDEALER_WISHid_4dd20ced85141030e10080000ab5dd78YNid_4dd112db55800ff0e10080000ab5dd78YNid_4dd114c155800ff0e10080000ab5dd78TEL_CUSTOMERTEL_DEALERTECHNICIANORDERinit_01_InitialDummyinit_02_InitialDummyinit_03_InitialDummyinit_04_InitialDummyinit_05_InitialDummyinit_06_InitialDummyinit_07_InitialDummyinit_09_InitialDummyinit_10_InitialDummyinit_11_InitialDummyinit_12_InitialDummyinit_14_InitialDummyinit_15_InitialDummyinit_16_InitialDummyinit_17_InitialDummyinit_18_InitialDummyinit_19_InitialDummyinit_20_InitialDummyinit_21_InitialDummyid_4dd209ce85141030e10080000ab5dd78id_4dd20ced85141030e10080000ab5dd78id_4dd112db55800ff0e10080000ab5dd78id_4dd114c155800ff0e10080000ab5dd78 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,26 @@ + + + + + + Bitte geben Sie ein gültiges Datum ein! + Bitte geben Sie eine Zahl ein! + Bitte geben Sie eine gültige Uhrzeit ein! + Bitte machen Sie Eingaben in alle Mussfelder! + + <meta name="save" content="snapshot"/><style type="text/css"></style> + <xsl:for-each select="//script/*"> + <xsl:element name="script"> + <xsl:attribute name="language"> + <xsl:apply-templates select="@language"/> + </xsl:attribute> + <xsl:text> <!-- </xsl:text> + <xsl:apply-templates select="."/> + <xsl:text> //--></xsl:text> + </xsl:element> + </xsl:for-each> + </head> + <body><xsl:for-each select="//onEvent/html/body/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><xsl:if test="count(/wff:envelope/wff:header/wff:message) > 0"><div class="Message"><xsl:value-of select="/wff:envelope/wff:header/wff:message"/></div></xsl:if><xsl:for-each select="/wff:envelope/wff:messages/wff:message/wff:text"><div class="Message"><xsl:value-of select="."/></div></xsl:for-each><xsl:for-each select="//message"><div class="Message"><xsl:variable name="source"><xsl:value-of select="//message/text()"/></xsl:variable><xsl:call-template name="getLineBreak"><xsl:with-param name="source" select="$source"/></xsl:call-template></div></xsl:for-each><div class="Title"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Geräteaustauschanforderung (GAF)'"/></xsl:call-template></div><form class="saveSnapshot" id="SAPSurvey" onSubmit="return check(this)" method="post"><xsl:if test="count(/wff:envelope/wff:header/wff:server_url) > 0"><xsl:attribute name="action"><xsl:value-of select="/wff:envelope/wff:header/wff:server_url"/></xsl:attribute></xsl:if><xsl:if test="count(/wff:envelope/wff:header/wff:server_url) = 0"><xsl:attribute name="action">SAPEVENT:WFF_EVENT</xsl:attribute><xsl:attribute name="enctype"/></xsl:if><xsl:if test="count(//survey/systemparamlocation) > 0"><xsl:variable name="X1" select="document(//survey/systemparamlocation[1])"/><xsl:attribute name="method"><xsl:value-of select="$X1/SurveySystemParam/@Method"/></xsl:attribute><xsl:attribute name="action"><xsl:value-of select="$X1/SurveySystemParam/@Action"/></xsl:attribute><xsl:attribute name="enctype"><xsl:value-of select="$X1/SurveySystemParam/@Enctype"/></xsl:attribute></xsl:if><xsl:for-each select="//onEvent/html/form/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><input type="hidden" name="svyApplicationId" value="CRM_SURVEY_SERVICE"/><input type="hidden" name="SurveyId" value="Z002_AER_AWASCHAUTOMAT"/><input type="hidden" name="svySurveyId" value="Z002_AER_AWASCHAUTOMAT"/><input type="hidden" name="svyVersion" value="0000000003"/><input type="hidden" name="SchemaVersion" value="1 "/><input type="hidden" name="svySchemaVersion" value="1 "/><input type="hidden" name="svyLanguage" value="DE"/><xsl:if test="count(//survey/systemparamlocation) > 0"><xsl:variable name="X1" select="document(//survey/systemparamlocation[1])"/><xsl:if test="$X1/SurveySystemParam/@ReplyDest"><xsl:element name="input"><xsl:attribute name="type">hidden</xsl:attribute><xsl:attribute name="name">svyReplyDest1</xsl:attribute><xsl:attribute name="value"><xsl:value-of select="$X1/SurveySystemParam/@ReplyDest"/></xsl:attribute></xsl:element></xsl:if></xsl:if><xsl:element name="input"><xsl:attribute name="type">hidden</xsl:attribute><xsl:attribute name="name">conid</xsl:attribute><xsl:attribute name="value"/><xsl:if test="count(//survey/systemparamlocation) > 0"><xsl:variable name="X1" select="document(//survey/systemparamlocation[1])"/><xsl:if test="$X1/SurveySystemParam/@ConnectorId"><xsl:attribute name="value"><xsl:value-of select="$X1/SurveySystemParam/@ConnectorId"/></xsl:attribute></xsl:if></xsl:if></xsl:element><xsl:for-each select="//hidden/*"><input type="hidden"><xsl:attribute name="name"><xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each><!--Begin of Section--><div Id="" class="Section1"><div class="SectionText1"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Waschautomaten'"/></xsl:call-template></div><xsl:if test="not((count(//noDisplay/q1)) + (count(//noDisplay/q1/*))= 1)"><div class="Question" Id="q1"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'01. Verantwortlich'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q1/a01_bimos)"><tr><td class="ListAnswerListbox"><select class="AnswerListboxRW" name="survey/result/q1/a01_bimos" size="1"><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q1/a01_bimos"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerListboxRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q1/a01_bimos/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><option value="init_01_InitialDummy"><xsl:if test="//survey/result/q1/a01_bimos[. = 'init_01_InitialDummy']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></option><option value="MOS"><xsl:if test="//survey/result/q1/a01_bimos[. = 'MOS']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'MOS'"/></xsl:call-template></option><option value="MES"><xsl:if test="//survey/result/q1/a01_bimos[. = 'MES']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'MES'"/></xsl:call-template></option><option value="NN"><xsl:if test="//survey/result/q1/a01_bimos[. = 'NN']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'keine Zuordnung'"/></xsl:call-template></option></select><xsl:for-each select="//readOnly/q1/a01_bimos"><xsl:for-each select="//survey/result/q1/a01_bimos"><input type="hidden"><xsl:attribute name="name">survey/result/q1/<xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each></xsl:for-each></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q02)) + (count(//noDisplay/q02/*))= 1)"><div class="Question" Id="q02"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'02. Offerte Ausführen'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q02/a02)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q02/a02" value="init_02_InitialDummy"><xsl:if test="//survey/result/q02/a02[. ='init_02_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q02/a02"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q02/a02/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q02/a02"><xsl:if test="//survey/result/q02/a02[. = 'init_02_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q02/a02</xsl:attribute><xsl:attribute name="value">init_02_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q02/a02" value="X"><xsl:if test="//survey/result/q02/a02[. ='X']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q02/a02"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q02/a02/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q02/a02"><xsl:if test="//survey/result/q02/a02[. = 'X']"><input type="hidden"><xsl:attribute name="name">survey/result/q02/a02</xsl:attribute><xsl:attribute name="value">X</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q02/a02" value="id_4dd1acc6337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q02/a02[. ='id_4dd1acc6337e11d0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q02/a02"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q02/a02/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q02/a02"><xsl:if test="//survey/result/q02/a02[. = 'id_4dd1acc6337e11d0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q02/a02</xsl:attribute><xsl:attribute name="value">id_4dd1acc6337e11d0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q03)) + (count(//noDisplay/q03/*))= 1)"><div class="Question" Id="q03"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'03. Elektrischer Anschluss'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q03/a03)"><tr><td class="ListAnswerListbox"><select class="AnswerListboxRW" name="survey/result/q03/a03" size="1"><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q03/a03"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerListboxRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q03/a03/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><option value="init_03_InitialDummy"><xsl:if test="//survey/result/q03/a03[. = 'init_03_InitialDummy']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></option><option value="id_4dd1ad48337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q03/a03[. = 'id_4dd1ad48337e11d0e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'230 Volt'"/></xsl:call-template></option><option value="id_4dd1ad8a337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q03/a03[. = 'id_4dd1ad8a337e11d0e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'400 Volt 2N'"/></xsl:call-template></option><option value="id_4dd1add2337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q03/a03[. = 'id_4dd1add2337e11d0e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'400 Volt 3N'"/></xsl:call-template></option><option value="id_4dd1ae1a337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q03/a03[. = 'id_4dd1ae1a337e11d0e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'keine Zuordnung'"/></xsl:call-template></option></select><xsl:for-each select="//readOnly/q03/a03"><xsl:for-each select="//survey/result/q03/a03"><input type="hidden"><xsl:attribute name="name">survey/result/q03/<xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each></xsl:for-each></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q04)) + (count(//noDisplay/q04/*))= 1)"><div class="Question" Id="q04"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'04. Nullleiter vorhanden'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q04/a04)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q04/a04" value="init_04_InitialDummy"><xsl:if test="//survey/result/q04/a04[. ='init_04_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q04/a04"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q04/a04/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q04/a04"><xsl:if test="//survey/result/q04/a04[. = 'init_04_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q04/a04</xsl:attribute><xsl:attribute name="value">init_04_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q04/a04" value="id_4dd1af06337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q04/a04[. ='id_4dd1af06337e11d0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q04/a04"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q04/a04/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q04/a04"><xsl:if test="//survey/result/q04/a04[. = 'id_4dd1af06337e11d0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q04/a04</xsl:attribute><xsl:attribute name="value">id_4dd1af06337e11d0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q04/a04" value="id_4dd1af58337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q04/a04[. ='id_4dd1af58337e11d0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q04/a04"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q04/a04/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q04/a04"><xsl:if test="//survey/result/q04/a04[. = 'id_4dd1af58337e11d0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q04/a04</xsl:attribute><xsl:attribute name="value">id_4dd1af58337e11d0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q05)) + (count(//noDisplay/q05/*))= 1)"><div class="Question" Id="q05"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'05. Via Münzwerk'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q05/a05)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q05/a05" value="init_05_InitialDummy"><xsl:if test="//survey/result/q05/a05[. ='init_05_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q05/a05"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q05/a05/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q05/a05"><xsl:if test="//survey/result/q05/a05[. = 'init_05_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q05/a05</xsl:attribute><xsl:attribute name="value">init_05_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q05/a05" value="id_4dd1b05d337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q05/a05[. ='id_4dd1b05d337e11d0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q05/a05"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q05/a05/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q05/a05"><xsl:if test="//survey/result/q05/a05[. = 'id_4dd1b05d337e11d0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q05/a05</xsl:attribute><xsl:attribute name="value">id_4dd1b05d337e11d0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q05/a05" value="id_4dd1b0b9337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q05/a05[. ='id_4dd1b0b9337e11d0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q05/a05"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q05/a05/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q05/a05"><xsl:if test="//survey/result/q05/a05[. = 'id_4dd1b0b9337e11d0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q05/a05</xsl:attribute><xsl:attribute name="value">id_4dd1b0b9337e11d0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q06)) + (count(//noDisplay/q06/*))= 1)"><div class="Question" Id="q06"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'06. Adapter Steuerausgang'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q06/a06)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q06/a06" value="init_06_InitialDummy"><xsl:if test="//survey/result/q06/a06[. ='init_06_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q06/a06"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q06/a06/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q06/a06"><xsl:if test="//survey/result/q06/a06[. = 'init_06_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q06/a06</xsl:attribute><xsl:attribute name="value">init_06_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q06/a06" value="id_4dd1b1da337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q06/a06[. ='id_4dd1b1da337e11d0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q06/a06"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q06/a06/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q06/a06"><xsl:if test="//survey/result/q06/a06[. = 'id_4dd1b1da337e11d0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q06/a06</xsl:attribute><xsl:attribute name="value">id_4dd1b1da337e11d0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q06/a06" value="id_4dd1b240337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q06/a06[. ='id_4dd1b240337e11d0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q06/a06"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q06/a06/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q06/a06"><xsl:if test="//survey/result/q06/a06[. = 'id_4dd1b240337e11d0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q06/a06</xsl:attribute><xsl:attribute name="value">id_4dd1b240337e11d0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q07)) + (count(//noDisplay/q07/*))= 1)"><div class="Question" Id="q07"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'07. Auf Betonsockel'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q07/a07)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q07/a07" value="init_07_InitialDummy"><xsl:if test="//survey/result/q07/a07[. ='init_07_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q07/a07"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q07/a07/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q07/a07"><xsl:if test="//survey/result/q07/a07[. = 'init_07_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q07/a07</xsl:attribute><xsl:attribute name="value">init_07_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q07/a07" value="id_4dd1b320337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q07/a07[. ='id_4dd1b320337e11d0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q07/a07"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q07/a07/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q07/a07"><xsl:if test="//survey/result/q07/a07[. = 'id_4dd1b320337e11d0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q07/a07</xsl:attribute><xsl:attribute name="value">id_4dd1b320337e11d0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q07/a07" value="id_4dd1b390337e11d0e10080000ab5dd78"><xsl:if test="//survey/result/q07/a07[. ='id_4dd1b390337e11d0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q07/a07"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q07/a07/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q07/a07"><xsl:if test="//survey/result/q07/a07[. = 'id_4dd1b390337e11d0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q07/a07</xsl:attribute><xsl:attribute name="value">id_4dd1b390337e11d0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q08)) + (count(//noDisplay/q08/*))= 1)"><div class="Question" Id="q08"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'08. Grösse: Breite x Tiefe'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q08/a08)"><tr><td class="ListAnswerField"><input class="AnswerFieldRW" type="text" name="survey/result/q08/a08" size="48 " maxlength="48 "><xsl:attribute name="value"><xsl:value-of select="//survey/result/q08/a08"/></xsl:attribute><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q08/a08"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q08/a08/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input></td><td class="ListAnswerFieldText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q09)) + (count(//noDisplay/q09/*))= 1)"><div class="Question" Id="q09"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'09. Ablauf'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q09/a09)"><tr><td class="ListAnswerListbox"><select class="AnswerListboxRW" name="survey/result/q09/a09" size="1"><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q09/a09"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerListboxRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q09/a09/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><option value="init_09_InitialDummy"><xsl:if test="//survey/result/q09/a09[. = 'init_09_InitialDummy']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></option><option value="id_4dd225b0770407c0e10080000ab5dd78"><xsl:if test="//survey/result/q09/a09[. = 'id_4dd225b0770407c0e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Pumpe'"/></xsl:call-template></option><option value="id_4dd2262e770407c0e10080000ab5dd78"><xsl:if test="//survey/result/q09/a09[. = 'id_4dd2262e770407c0e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ventil'"/></xsl:call-template></option><option value="id_4dd226af770407c0e10080000ab5dd78"><xsl:if test="//survey/result/q09/a09[. = 'id_4dd226af770407c0e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'keine Zuordnung'"/></xsl:call-template></option></select><xsl:for-each select="//readOnly/q09/a09"><xsl:for-each select="//survey/result/q09/a09"><input type="hidden"><xsl:attribute name="name">survey/result/q09/<xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each></xsl:for-each></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q10)) + (count(//noDisplay/q10/*))= 1)"><div class="Question" Id="q10"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'10. Normale Länge der Schläuche und Kabel'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q10/a10)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q10/a10" value="init_10_InitialDummy"><xsl:if test="//survey/result/q10/a10[. ='init_10_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q10/a10"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q10/a10/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q10/a10"><xsl:if test="//survey/result/q10/a10[. = 'init_10_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q10/a10</xsl:attribute><xsl:attribute name="value">init_10_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q10/a10" value="id_4dd2280f770407c0e10080000ab5dd78"><xsl:if test="//survey/result/q10/a10[. ='id_4dd2280f770407c0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q10/a10"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q10/a10/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q10/a10"><xsl:if test="//survey/result/q10/a10[. = 'id_4dd2280f770407c0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q10/a10</xsl:attribute><xsl:attribute name="value">id_4dd2280f770407c0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q10/a10" value="id_4dd20ac184ef12e0e10080000ab5dd78"><xsl:if test="//survey/result/q10/a10[. ='id_4dd20ac184ef12e0e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q10/a10"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q10/a10/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q10/a10"><xsl:if test="//survey/result/q10/a10[. = 'id_4dd20ac184ef12e0e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q10/a10</xsl:attribute><xsl:attribute name="value">id_4dd20ac184ef12e0e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q11)) + (count(//noDisplay/q11/*))= 1)"><div class="Question" Id="q11"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'11. Anschluss mit Waterproof-Ventil möglich'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q11/a11)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q11/a11" value="init_11_InitialDummy"><xsl:if test="//survey/result/q11/a11[. ='init_11_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q11/a11"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q11/a11/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q11/a11"><xsl:if test="//survey/result/q11/a11[. = 'init_11_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q11/a11</xsl:attribute><xsl:attribute name="value">init_11_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q11/a11" value="id_4dd2240285141030e10080000ab5dd78"><xsl:if test="//survey/result/q11/a11[. ='id_4dd2240285141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q11/a11"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q11/a11/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q11/a11"><xsl:if test="//survey/result/q11/a11[. = 'id_4dd2240285141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q11/a11</xsl:attribute><xsl:attribute name="value">id_4dd2240285141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q11/a11" value="id_4dd2250885141030e10080000ab5dd78"><xsl:if test="//survey/result/q11/a11[. ='id_4dd2250885141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q11/a11"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q11/a11/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q11/a11"><xsl:if test="//survey/result/q11/a11[. = 'id_4dd2250885141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q11/a11</xsl:attribute><xsl:attribute name="value">id_4dd2250885141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q12)) + (count(//noDisplay/q12/*))= 1)"><div class="Question" Id="q12"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'12. Wasch-Trocken-Turm'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q12/a12)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q12/a12" value="init_12_InitialDummy"><xsl:if test="//survey/result/q12/a12[. ='init_12_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q12/a12"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q12/a12/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q12/a12"><xsl:if test="//survey/result/q12/a12[. = 'init_12_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q12/a12</xsl:attribute><xsl:attribute name="value">init_12_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q12/a12" value="id_4dd2271585141030e10080000ab5dd78"><xsl:if test="//survey/result/q12/a12[. ='id_4dd2271585141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q12/a12"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q12/a12/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q12/a12"><xsl:if test="//survey/result/q12/a12[. = 'id_4dd2271585141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q12/a12</xsl:attribute><xsl:attribute name="value">id_4dd2271585141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q12/a12" value="id_4dd2281485141030e10080000ab5dd78"><xsl:if test="//survey/result/q12/a12[. ='id_4dd2281485141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q12/a12"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q12/a12/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q12/a12"><xsl:if test="//survey/result/q12/a12[. = 'id_4dd2281485141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q12/a12</xsl:attribute><xsl:attribute name="value">id_4dd2281485141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q13)) + (count(//noDisplay/q13/*))= 1)"><div class="Question" Id="q13"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'13. Anderes Gerät im Turm'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q13/a13_matnr)"><tr><td class="ListAnswerFieldText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Produktnummer:'"/></xsl:call-template></td><td class="ListAnswerField"><input class="AnswerFieldRW" type="text" name="survey/result/q13/a13_matnr" size="30 " maxlength="30 "><xsl:attribute name="value"><xsl:value-of select="//survey/result/q13/a13_matnr"/></xsl:attribute><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q13/a13_matnr"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q13/a13_matnr/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input></td></tr></xsl:if><xsl:if test="not(//noDisplay/q13/a13_matdesc)"><tr><td class="ListAnswerFieldText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Bezeichnung:'"/></xsl:call-template></td><td class="ListAnswerField"><input class="AnswerFieldRW" type="text" name="survey/result/q13/a13_matdesc" size="30 " maxlength="50 "><xsl:attribute name="value"><xsl:value-of select="//survey/result/q13/a13_matdesc"/></xsl:attribute><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q13/a13_matdesc"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q13/a13_matdesc/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q14)) + (count(//noDisplay/q14/*))= 1)"><div class="Question" Id="q14"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'14. WTV mit Auszug vorhanden'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q14/a14)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q14/a14" value="init_14_InitialDummy"><xsl:if test="//survey/result/q14/a14[. ='init_14_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q14/a14"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q14/a14/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q14/a14"><xsl:if test="//survey/result/q14/a14[. = 'init_14_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q14/a14</xsl:attribute><xsl:attribute name="value">init_14_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q14/a14" value="id_4dd22d8585141030e10080000ab5dd78"><xsl:if test="//survey/result/q14/a14[. ='id_4dd22d8585141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q14/a14"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q14/a14/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q14/a14"><xsl:if test="//survey/result/q14/a14[. = 'id_4dd22d8585141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q14/a14</xsl:attribute><xsl:attribute name="value">id_4dd22d8585141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q14/a14" value="id_4dd22e9685141030e10080000ab5dd78"><xsl:if test="//survey/result/q14/a14[. ='id_4dd22e9685141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q14/a14"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q14/a14/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q14/a14"><xsl:if test="//survey/result/q14/a14[. = 'id_4dd22e9685141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q14/a14</xsl:attribute><xsl:attribute name="value">id_4dd22e9685141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q15)) + (count(//noDisplay/q15/*))= 1)"><div class="Question" Id="q15"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'15. Eingebaut'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q15/a15)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q15/a15" value="init_15_InitialDummy"><xsl:if test="//survey/result/q15/a15[. ='init_15_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q15/a15"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q15/a15/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q15/a15"><xsl:if test="//survey/result/q15/a15[. = 'init_15_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q15/a15</xsl:attribute><xsl:attribute name="value">init_15_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q15/a15" value="id_4dd231ea85141030e10080000ab5dd78"><xsl:if test="//survey/result/q15/a15[. ='id_4dd231ea85141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q15/a15"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q15/a15/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q15/a15"><xsl:if test="//survey/result/q15/a15[. = 'id_4dd231ea85141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q15/a15</xsl:attribute><xsl:attribute name="value">id_4dd231ea85141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q15/a15" value="id_4dd2331685141030e10080000ab5dd78"><xsl:if test="//survey/result/q15/a15[. ='id_4dd2331685141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q15/a15"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q15/a15/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q15/a15"><xsl:if test="//survey/result/q15/a15[. = 'id_4dd2331685141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q15/a15</xsl:attribute><xsl:attribute name="value">id_4dd2331685141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q16)) + (count(//noDisplay/q16/*))= 1)"><div class="Question" Id="q16"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'16. Integriert'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q16/a16)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q16/a16" value="init_16_InitialDummy"><xsl:if test="//survey/result/q16/a16[. ='init_16_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q16/a16"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q16/a16/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q16/a16"><xsl:if test="//survey/result/q16/a16[. = 'init_16_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q16/a16</xsl:attribute><xsl:attribute name="value">init_16_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q16/a16" value="id_4dd2367685141030e10080000ab5dd78"><xsl:if test="//survey/result/q16/a16[. ='id_4dd2367685141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q16/a16"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q16/a16/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q16/a16"><xsl:if test="//survey/result/q16/a16[. = 'id_4dd2367685141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q16/a16</xsl:attribute><xsl:attribute name="value">id_4dd2367685141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q16/a16" value="id_4dd2379b85141030e10080000ab5dd78"><xsl:if test="//survey/result/q16/a16[. ='id_4dd2379b85141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q16/a16"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q16/a16/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q16/a16"><xsl:if test="//survey/result/q16/a16[. = 'id_4dd2379b85141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q16/a16</xsl:attribute><xsl:attribute name="value">id_4dd2379b85141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q17)) + (count(//noDisplay/q17/*))= 1)"><div class="Question" Id="q17"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'17. Untergebaut'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q17/a17)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q17/a17" value="init_17_InitialDummy"><xsl:if test="//survey/result/q17/a17[. ='init_17_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q17/a17"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q17/a17/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q17/a17"><xsl:if test="//survey/result/q17/a17[. = 'init_17_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q17/a17</xsl:attribute><xsl:attribute name="value">init_17_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q17/a17" value="id_4dd23b1f85141030e10080000ab5dd78"><xsl:if test="//survey/result/q17/a17[. ='id_4dd23b1f85141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q17/a17"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q17/a17/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q17/a17"><xsl:if test="//survey/result/q17/a17[. = 'id_4dd23b1f85141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q17/a17</xsl:attribute><xsl:attribute name="value">id_4dd23b1f85141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q17/a17" value="id_4dd23c5f85141030e10080000ab5dd78"><xsl:if test="//survey/result/q17/a17[. ='id_4dd23c5f85141030e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q17/a17"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q17/a17/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q17/a17"><xsl:if test="//survey/result/q17/a17[. = 'id_4dd23c5f85141030e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q17/a17</xsl:attribute><xsl:attribute name="value">id_4dd23c5f85141030e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q18)) + (count(//noDisplay/q18/*))= 1)"><div class="Question" Id="q18"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'18. Freistehend'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q18/a18)"><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q18/a18" value="init_18_InitialDummy"><xsl:if test="//survey/result/q18/a18[. ='init_18_InitialDummy']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q18/a18"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q18/a18/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q18/a18"><xsl:if test="//survey/result/q18/a18[. = 'init_18_InitialDummy']"><input type="hidden"><xsl:attribute name="name">survey/result/q18/a18</xsl:attribute><xsl:attribute name="value">init_18_InitialDummy</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q18/a18" value="id_4dd20e5685071800e10080000ab5dd78"><xsl:if test="//survey/result/q18/a18[. ='id_4dd20e5685071800e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q18/a18"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q18/a18/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q18/a18"><xsl:if test="//survey/result/q18/a18[. = 'id_4dd20e5685071800e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q18/a18</xsl:attribute><xsl:attribute name="value">id_4dd20e5685071800e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></td></tr><tr><td class="ListAnswerRadioButton"><input class="AnswerRadioButtonRW" type="radio" name="survey/result/q18/a18" value="id_4dd20f8f85071800e10080000ab5dd78"><xsl:if test="//survey/result/q18/a18[. ='id_4dd20f8f85071800e10080000ab5dd78']"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q18/a18"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerRadioButtonRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q18/a18/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input><xsl:for-each select="//readOnly/q18/a18"><xsl:if test="//survey/result/q18/a18[. = 'id_4dd20f8f85071800e10080000ab5dd78']"><input type="hidden"><xsl:attribute name="name">survey/result/q18/a18</xsl:attribute><xsl:attribute name="value">id_4dd20f8f85071800e10080000ab5dd78</xsl:attribute></input></xsl:if></xsl:for-each></td><td class="ListAnswerRadioButtonText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q19)) + (count(//noDisplay/q19/*))= 1)"><div class="Question" Id="q19"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'19. Einbauvarianten'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q19/a19)"><tr><td class="ListAnswerListbox"><select class="AnswerListboxRW" name="survey/result/q19/a19" size="1"><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q19/a19"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerListboxRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q19/a19/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><option value="init_19_InitialDummy"><xsl:if test="//survey/result/q19/a19[. = 'init_19_InitialDummy']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></option><option value="id_4dd2134985071800e10080000ab5dd78"><xsl:if test="//survey/result/q19/a19[. = 'id_4dd2134985071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'GDU'"/></xsl:call-template></option><option value="id_4dd2148c85071800e10080000ab5dd78"><xsl:if test="//survey/result/q19/a19[. = 'id_4dd2148c85071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Montage-Set'"/></xsl:call-template></option><option value="id_4dd215d285071800e10080000ab5dd78"><xsl:if test="//survey/result/q19/a19[. = 'id_4dd215d285071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Integriert'"/></xsl:call-template></option><option value="id_4dd2172285071800e10080000ab5dd78"><xsl:if test="//survey/result/q19/a19[. = 'id_4dd2172285071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Normal'"/></xsl:call-template></option><option value="id_4dd2186e85071800e10080000ab5dd78"><xsl:if test="//survey/result/q19/a19[. = 'id_4dd2186e85071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'keine Zuordnung'"/></xsl:call-template></option></select><xsl:for-each select="//readOnly/q19/a19"><xsl:for-each select="//survey/result/q19/a19"><input type="hidden"><xsl:attribute name="name">survey/result/q19/<xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each></xsl:for-each></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q20)) + (count(//noDisplay/q20/*))= 1)"><div class="Question" Id="q20"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'20. Farbe'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q20/a20)"><tr><td class="ListAnswerListbox"><select class="AnswerListboxRW" name="survey/result/q20/a20" size="1"><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q20/a20"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerListboxRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q20/a20/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><option value="init_20_InitialDummy"><xsl:if test="//survey/result/q20/a20[. = 'init_20_InitialDummy']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></option><option value="id_4dd21c6385071800e10080000ab5dd78"><xsl:if test="//survey/result/q20/a20[. = 'id_4dd21c6385071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'braun'"/></xsl:call-template></option><option value="id_4dd21db985071800e10080000ab5dd78"><xsl:if test="//survey/result/q20/a20[. = 'id_4dd21db985071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'weiss'"/></xsl:call-template></option><option value="id_4dd21f1285071800e10080000ab5dd78"><xsl:if test="//survey/result/q20/a20[. = 'id_4dd21f1285071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'schwarz'"/></xsl:call-template></option><option value="id_4dd2206e85071800e10080000ab5dd78"><xsl:if test="//survey/result/q20/a20[. = 'id_4dd2206e85071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'edelstahl'"/></xsl:call-template></option><option value="id_4dd221cd85071800e10080000ab5dd78"><xsl:if test="//survey/result/q20/a20[. = 'id_4dd221cd85071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'aluminium'"/></xsl:call-template></option><option value="id_4dd2232f85071800e10080000ab5dd78"><xsl:if test="//survey/result/q20/a20[. = 'id_4dd2232f85071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'andere'"/></xsl:call-template></option><option value="id_4dd2249485071800e10080000ab5dd78"><xsl:if test="//survey/result/q20/a20[. = 'id_4dd2249485071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'keine Zuordnung'"/></xsl:call-template></option></select><xsl:for-each select="//readOnly/q20/a20"><xsl:for-each select="//survey/result/q20/a20"><input type="hidden"><xsl:attribute name="name">survey/result/q20/<xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each></xsl:for-each></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q21)) + (count(//noDisplay/q21/*))= 1)"><div class="Question" Id="q21"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'21. Bandung'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q21/a21)"><tr><td class="ListAnswerListbox"><select class="AnswerListboxRW" name="survey/result/q21/a21" size="1"><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q21/a21"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerListboxRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q21/a21/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><option value="init_21_InitialDummy"><xsl:if test="//survey/result/q21/a21[. = 'init_21_InitialDummy']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Auswahl erforderlich'"/></xsl:call-template></option><option value="id_4dd228d085071800e10080000ab5dd78"><xsl:if test="//survey/result/q21/a21[. = 'id_4dd228d085071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'rechts'"/></xsl:call-template></option><option value="id_4dd22a3f85071800e10080000ab5dd78"><xsl:if test="//survey/result/q21/a21[. = 'id_4dd22a3f85071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'links'"/></xsl:call-template></option><option value="id_4dd22bb185071800e10080000ab5dd78"><xsl:if test="//survey/result/q21/a21[. = 'id_4dd22bb185071800e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'keine Zuordnung'"/></xsl:call-template></option></select><xsl:for-each select="//readOnly/q21/a21"><xsl:for-each select="//survey/result/q21/a21"><input type="hidden"><xsl:attribute name="name">survey/result/q21/<xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each></xsl:for-each></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q22)) + (count(//noDisplay/q22/*))= 1)"><div class="Question" Id="q22"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'22. Nischen-Breite'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q22/a22)"><tr><td class="ListAnswerField"><input class="AnswerFieldRW" type="text" name="survey/result/q22/a22" size="48 " maxlength="48 "><xsl:attribute name="value"><xsl:value-of select="//survey/result/q22/a22"/></xsl:attribute><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q22/a22"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q22/a22/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input></td><td class="ListAnswerFieldText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q23)) + (count(//noDisplay/q23/*))= 1)"><div class="Question" Id="q23"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'23. Nischen-Höhe'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q23/a23)"><tr><td class="ListAnswerField"><input class="AnswerFieldRW" type="text" name="survey/result/q23/a23" size="48 " maxlength="48 "><xsl:attribute name="value"><xsl:value-of select="//survey/result/q23/a23"/></xsl:attribute><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q23/a23"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q23/a23/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input></td><td class="ListAnswerFieldText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q24)) + (count(//noDisplay/q24/*))= 1)"><div class="Question" Id="q24"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'24. Sockel-Höhe'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q24/a24)"><tr><td class="ListAnswerField"><input class="AnswerFieldRW" type="text" name="survey/result/q24/a24" size="48 " maxlength="48 "><xsl:attribute name="value"><xsl:value-of select="//survey/result/q24/a24"/></xsl:attribute><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q24/a24"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q24/a24/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input></td><td class="ListAnswerFieldText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q25_biproposal)) + (count(//noDisplay/q25_biproposal/*))= 1)"><div class="Question" Id="q25_biproposal"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'25. Neugeräte Vorschlag'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q25_biproposal/a25_biproposal_matnr)"><tr><td class="ListAnswerFieldText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Produktnummer:'"/></xsl:call-template></td><td class="ListAnswerField"><input class="AnswerFieldRW" type="text" name="survey/result/q25_biproposal/a25_biproposal_matnr" size="30 " maxlength="30 "><xsl:attribute name="value"><xsl:value-of select="//survey/result/q25_biproposal/a25_biproposal_matnr"/></xsl:attribute><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q25_biproposal/a25_biproposal_matnr"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q25_biproposal/a25_biproposal_matnr/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input></td></tr></xsl:if><xsl:if test="not(//noDisplay/q25_biproposal/a25_biproposal_matdesc)"><tr><td class="ListAnswerFieldText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Bezeichnung:'"/></xsl:call-template></td><td class="ListAnswerField"><input class="AnswerFieldRW" type="text" name="survey/result/q25_biproposal/a25_biproposal_matdesc" size="30 " maxlength="50 "><xsl:attribute name="value"><xsl:value-of select="//survey/result/q25_biproposal/a25_biproposal_matdesc"/></xsl:attribute><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q25_biproposal/a25_biproposal_matdesc"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q25_biproposal/a25_biproposal_matdesc/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q26)) + (count(//noDisplay/q26/*))= 1)"><div class="Question" Id="q26"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'26. Grund der Störung'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q26/a26)"><tr><td class="ListAnswerText"><textarea class="AnswerTextRW" name="survey/result/q26/a26" rows="3 " cols="41 "><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerTextRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q26/a26"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerTextRO</xsl:attribute></xsl:for-each><xsl:value-of select="//survey/result/q26/a26"/><xsl:text/><xsl:for-each select="//onEvent/q26/a26/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></textarea></td><td class="ListAnswerTextText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q27)) + (count(//noDisplay/q27/*))= 1)"><div class="Question" Id="q27"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'27. Bemerkung'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q27/a27)"><tr><td class="ListAnswerText"><textarea class="AnswerTextRW" name="survey/result/q27/a27" rows="3 " cols="41 "><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerTextRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q27/a27"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerTextRO</xsl:attribute></xsl:for-each><xsl:value-of select="//survey/result/q27/a27"/><xsl:text/><xsl:for-each select="//onEvent/q27/a27/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></textarea></td><td class="ListAnswerTextText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/id_4dd20c2384ef12e0e10080000ab5dd78)) + (count(//noDisplay/id_4dd20c2384ef12e0e10080000ab5dd78/*))= 1)"><div class="Question" Id="id_4dd20c2384ef12e0e10080000ab5dd78"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Grund Fremdproduktekauf'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/id_4dd20c2384ef12e0e10080000ab5dd78/a30_biprodext)"><tr><td class="ListAnswerListbox"><select class="AnswerListboxRW" name="survey/result/id_4dd20c2384ef12e0e10080000ab5dd78/a30_biprodext" size="1"><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/id_4dd20c2384ef12e0e10080000ab5dd78/a30_biprodext"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerListboxRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/id_4dd20c2384ef12e0e10080000ab5dd78/a30_biprodext/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><option value="id_4dd209ce85141030e10080000ab5dd78"><xsl:if test="//survey/result/id_4dd20c2384ef12e0e10080000ab5dd78/a30_biprodext[. = 'id_4dd209ce85141030e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></option><option value="CUSTOMER_WISH"><xsl:if test="//survey/result/id_4dd20c2384ef12e0e10080000ab5dd78/a30_biprodext[. = 'CUSTOMER_WISH']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Kundenwunsch'"/></xsl:call-template></option><option value="DEALER_WISH"><xsl:if test="//survey/result/id_4dd20c2384ef12e0e10080000ab5dd78/a30_biprodext[. = 'DEALER_WISH']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Händlerwunsch'"/></xsl:call-template></option></select><xsl:for-each select="//readOnly/id_4dd20c2384ef12e0e10080000ab5dd78/a30_biprodext"><xsl:for-each select="//survey/result/id_4dd20c2384ef12e0e10080000ab5dd78/a30_biprodext"><input type="hidden"><xsl:attribute name="name">survey/result/id_4dd20c2384ef12e0e10080000ab5dd78/<xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each></xsl:for-each></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/id_4dd111b255800ff0e10080000ab5dd78)) + (count(//noDisplay/id_4dd111b255800ff0e10080000ab5dd78/*))= 1)"><div class="Question" Id="id_4dd111b255800ff0e10080000ab5dd78"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Interne Bemerkung'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/id_4dd111b255800ff0e10080000ab5dd78/id_4dd210d485141030e10080000ab5dd78)"><tr><td class="ListAnswerText"><textarea class="AnswerTextRW" name="survey/result/id_4dd111b255800ff0e10080000ab5dd78/id_4dd210d485141030e10080000ab5dd78" rows="3 " cols="41 "><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerTextRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/id_4dd111b255800ff0e10080000ab5dd78/id_4dd210d485141030e10080000ab5dd78"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerTextRO</xsl:attribute></xsl:for-each><xsl:value-of select="//survey/result/id_4dd111b255800ff0e10080000ab5dd78/id_4dd210d485141030e10080000ab5dd78"/><xsl:text/><xsl:for-each select="//onEvent/id_4dd111b255800ff0e10080000ab5dd78/id_4dd210d485141030e10080000ab5dd78/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></textarea></td><td class="ListAnswerTextText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/id_4dd1111d55800ff0e10080000ab5dd78)) + (count(//noDisplay/id_4dd1111d55800ff0e10080000ab5dd78/*))= 1)"><div class="Question" Id="id_4dd1111d55800ff0e10080000ab5dd78"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Händlerauswahl durch MES/MOS'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/id_4dd1111d55800ff0e10080000ab5dd78/a31_bimosdealer)"><tr><td class="ListAnswerListbox"><select class="AnswerListboxRW" name="survey/result/id_4dd1111d55800ff0e10080000ab5dd78/a31_bimosdealer" size="1"><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/id_4dd1111d55800ff0e10080000ab5dd78/a31_bimosdealer"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerListboxRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/id_4dd1111d55800ff0e10080000ab5dd78/a31_bimosdealer/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><option value="id_4dd20ced85141030e10080000ab5dd78"><xsl:if test="//survey/result/id_4dd1111d55800ff0e10080000ab5dd78/a31_bimosdealer[. = 'id_4dd20ced85141030e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></option><option value="Y"><xsl:if test="//survey/result/id_4dd1111d55800ff0e10080000ab5dd78/a31_bimosdealer[. = 'Y']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></option><option value="N"><xsl:if test="//survey/result/id_4dd1111d55800ff0e10080000ab5dd78/a31_bimosdealer[. = 'N']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></option></select><xsl:for-each select="//readOnly/id_4dd1111d55800ff0e10080000ab5dd78/a31_bimosdealer"><xsl:for-each select="//survey/result/id_4dd1111d55800ff0e10080000ab5dd78/a31_bimosdealer"><input type="hidden"><xsl:attribute name="name">survey/result/id_4dd1111d55800ff0e10080000ab5dd78/<xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each></xsl:for-each></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/id_4dd20b5c84ef12e0e10080000ab5dd78)) + (count(//noDisplay/id_4dd20b5c84ef12e0e10080000ab5dd78/*))= 1)"><div class="Question" Id="id_4dd20b5c84ef12e0e10080000ab5dd78"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Rückerstattungsbeleg'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefund)"><tr><td class="ListAnswerListbox"><select class="AnswerListboxRW" name="survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefund" size="1"><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefund"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerListboxRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefund/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><option value="id_4dd112db55800ff0e10080000ab5dd78"><xsl:if test="//survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefund[. = 'id_4dd112db55800ff0e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></option><option value="Y"><xsl:if test="//survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefund[. = 'Y']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Ja'"/></xsl:call-template></option><option value="N"><xsl:if test="//survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefund[. = 'N']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'Nein'"/></xsl:call-template></option></select><xsl:for-each select="//readOnly/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefund"><xsl:for-each select="//survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefund"><input type="hidden"><xsl:attribute name="name">survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/<xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each></xsl:for-each></td></tr></xsl:if><xsl:if test="not(//noDisplay/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason)"><tr><td class="ListAnswerListbox"><select class="AnswerListboxRW" name="survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason" size="1"><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason"><xsl:attribute name="disabled">disabled</xsl:attribute><xsl:attribute name="class">AnswerListboxRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each><option value="id_4dd114c155800ff0e10080000ab5dd78"><xsl:if test="//survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason[. = 'id_4dd114c155800ff0e10080000ab5dd78']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></option><option value="TEL_CUSTOMER"><xsl:if test="//survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason[. = 'TEL_CUSTOMER']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'gemäss Telefonat mit Kunde'"/></xsl:call-template></option><option value="TEL_DEALER"><xsl:if test="//survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason[. = 'TEL_DEALER']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'gemäss Telefonat mit Händler'"/></xsl:call-template></option><option value="TECHNICIAN"><xsl:if test="//survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason[. = 'TECHNICIAN']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'gemäss Techniker'"/></xsl:call-template></option><option value="ORDER"><xsl:if test="//survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason[. = 'ORDER']"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'gemäss Bestellung'"/></xsl:call-template></option></select><xsl:for-each select="//readOnly/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason"><xsl:for-each select="//survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/a29_birefundreason"><input type="hidden"><xsl:attribute name="name">survey/result/id_4dd20b5c84ef12e0e10080000ab5dd78/<xsl:value-of select="name(.)"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></xsl:for-each></xsl:for-each></td></tr></xsl:if></tbody></table></div></xsl:if><xsl:if test="not((count(//noDisplay/q28)) + (count(//noDisplay/q28/*))= 1)"><div class="Question" Id="q28"><div class="QuestionText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="'28. Maschinenalter'"/></xsl:call-template></div><table summary="Survey Questions" class="QuestionList"><tbody><xsl:if test="not(//noDisplay/q28/a28)"><tr><td class="ListAnswerField"><input class="AnswerFieldRW" type="text" name="survey/result/q28/a28" size="50 " maxlength="50 "><xsl:attribute name="value"><xsl:value-of select="//survey/result/q28/a28"/></xsl:attribute><xsl:if test="$C_Mode='DISPLAY'"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:if><xsl:for-each select="//readOnly/q28/a28"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="class">AnswerFieldRO</xsl:attribute></xsl:for-each><xsl:for-each select="//onEvent/q28/a28/*"><xsl:attribute name="{@Name}"><xsl:value-of select="@CallFunction"/></xsl:attribute></xsl:for-each></input></td><td class="ListAnswerFieldText"><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="''"/></xsl:call-template></td></tr></xsl:if></tbody></table></div></xsl:if><div class="Event"><xsl:if test="not($C_Mode='DISPLAY')"><input type="submit" class="ButtonInside" name="onInputProcessing(SUBMIT)" value="Sichern"/></xsl:if><xsl:if test="not($C_Mode='DISPLAY')"><input type="reset" class="ButtonInside" value="Eingaben zurücksetzen"/></xsl:if></div></div><!--End of Section--></form></body></html></xsl:template><xsl:template name="getLineBreak"><xsl:param name="source"/><xsl:variable name="sourceTextBR" select="string($source)"/><xsl:variable name="findBR"><BR></xsl:variable><xsl:choose><xsl:when test="contains($sourceTextBR, $findBR)"><xsl:value-of select="substring-before($sourceTextBR,$findBR)"/><br/><xsl:call-template name="getLineBreak"><xsl:with-param name="source" select="substring-after($sourceTextBR,$findBR)"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:value-of select="$sourceTextBR"/></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="getCRLF"><xsl:param name="source"/><xsl:variable name="sourceTextCRLF" select="string($source)"/><xsl:variable name="findCRLF">&#013;&#010;</xsl:variable><xsl:choose><xsl:when test="contains($sourceTextCRLF, $findCRLF)"><xsl:value-of select="substring-before($sourceTextCRLF,$findCRLF)"/> + <BR> + <xsl:call-template name="getCRLF"><xsl:with-param name="source" select="substring-after($sourceTextCRLF,$findCRLF)"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:value-of select="$sourceTextCRLF"/></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="getCOMMENT"><xsl:param name="source"/><xsl:variable name="sourceTextCMNT" select="string($source)"/><xsl:variable name="findCOMMENT"><COMMENT></xsl:variable><xsl:choose><xsl:when test="contains($sourceTextCMNT, $findCOMMENT)"><xsl:call-template name="getLineBreak"><xsl:with-param name="source" select="substring-before($sourceTextCMNT,$findCOMMENT)"/></xsl:call-template><xsl:element name="div"><xsl:attribute name="name">Comment</xsl:attribute><xsl:attribute name="class">Comment</xsl:attribute><xsl:call-template name="getLineBreak"><xsl:with-param name="source" select="substring-after($sourceTextCMNT,$findCOMMENT)"/></xsl:call-template></xsl:element></xsl:when><xsl:otherwise><xsl:call-template name="getLineBreak"><xsl:with-param name="source" select="$sourceTextCMNT"/></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="replaceString"><xsl:param name="source"/><xsl:param name="find"/><xsl:param name="replace"/><xsl:variable name="sourceText" select="string($source)"/><xsl:choose><xsl:when test="contains($sourceText, $find)"><xsl:value-of select="substring-before($sourceText,$find)"/><xsl:value-of select="$replace"/><xsl:call-template name="replaceString"><xsl:with-param name="source" select="substring-after($sourceText,$find)"/><xsl:with-param name="find" select="$find"/><xsl:with-param name="replace" select="$replace"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:value-of select="$sourceText"/></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="replaceParams"><xsl:param name="source"/><xsl:param name="index" select="1"/><xsl:variable name="sourceText" select="$source"/><xsl:variable name="indexSource" select="$index - 1"/><xsl:choose><xsl:when test="count(//replaceables/*) > $indexSource"><xsl:for-each select="//replaceables/*[$index]"><xsl:variable name="find"><xsl:value-of select="name()"/></xsl:variable><xsl:variable name="replace"><xsl:value-of select="."/></xsl:variable><xsl:choose><xsl:when test="contains($sourceText, $find)"><xsl:call-template name="replaceParams"><xsl:with-param name="source"><xsl:call-template name="replaceString"><xsl:with-param name="source" select="$sourceText"/><xsl:with-param name="find" select="$find"/><xsl:with-param name="replace" select="$replace"/></xsl:call-template></xsl:with-param><xsl:with-param name="index" select="$index+1"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="replaceParams"><xsl:with-param name="source" select="$sourceText"/><xsl:with-param name="index" select="$index+1"/></xsl:call-template></xsl:otherwise></xsl:choose></xsl:for-each></xsl:when><xsl:otherwise><xsl:call-template name="getCOMMENT"><xsl:with-param name="source"><xsl:call-template name="getCRLF"><xsl:with-param name="source" select="$sourceText"/></xsl:call-template></xsl:with-param></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template></xsl:stylesheet> + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.io.StringWriter; + +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6935697 + * @summary Test Transformer can compile large xsl file. + */ +public class BugDB12665704Test { + + @Test + public final void testTransform() { + + try { + String str = new String(); + ByteArrayOutputStream byte_stream = new ByteArrayOutputStream(); + File inputFile = new File(getClass().getResource("BugDB12665704.xml").getPath()); + FileReader in = new FileReader(inputFile); + int c; + + while ((c = in.read()) != -1) { + str = str + new Character((char) c).toString(); + } + + in.close(); + + System.out.println(str); + byte buf[] = str.getBytes(); + byte_stream.write(buf); + String style_sheet_uri = "BugDB12665704.xsl"; + byte[] xml_byte_array = byte_stream.toByteArray(); + InputStream xml_input_stream = new ByteArrayInputStream(xml_byte_array); + + Source xml_source = new StreamSource(xml_input_stream); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(); + StreamSource source = new StreamSource(getClass().getResource(style_sheet_uri).toString()); + transformer = tFactory.newTransformer(source); + + ByteArrayOutputStream result_output_stream = new ByteArrayOutputStream(); + Result result = new StreamResult(result_output_stream); + transformer.transform(xml_source, result); + result_output_stream.close(); + + // expected success + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + @Test + public void testSAPTransform() { + StringWriter out = new StringWriter(); + try { + String xml = getXML(getClass().getResource("BugDB12665704.xml").getPath()); + getTransformer().transform(new StreamSource(new StringReader(xml)), new StreamResult(out)); + } catch (TransformerConfigurationException ex) { + // Trace.dump(xslt); + // Trace.dump(xml); + System.err.println("can't process xslt: " + ex.getMessage() + " (" + ex + ")"); + } catch (TransformerException ex) { + // Trace.dump(xslt); + // Trace.dump(xml); + System.err.println("can't process xml: " + ex.getMessage() + " (" + ex + ")"); + } catch (Exception ex) { + // Trace.dump(xslt); + // Trace.dump(xml); + System.err.println("can't create processor: " + ex.getMessage() + " (" + ex + ")"); + } + } + + Transformer getTransformer() { + Transformer transformer = null; + try { + InputStream xin = this.getClass().getResourceAsStream("BugDB12665704.xsl"); + StreamSource xslt = new StreamSource(xin); + TransformerFactory fc = TransformerFactory.newInstance(); + transformer = fc.newTransformer(xslt); + + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + + return transformer; + } + + String getXML(String sourceFile) throws IOException { + BufferedReader inputStream = null; + StringBuilder sb = new StringBuilder(); + try { + inputStream = new BufferedReader(new FileReader(sourceFile)); + String l; + + while ((l = inputStream.readLine()) != null) { + sb.append(l); + } + + } finally { + if (inputStream != null) { + inputStream.close(); + } + } + return sb.toString(); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CLITest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CLITest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test internal transform CLI. + */ +public class CLITest { + + @Test + public void testCLI() { + try { + String[] args = new String[] { "-XSLTC", "-XSL", getClass().getResource("tigertest.xsl").toString(), "-IN", + getClass().getResource("tigertest-in.xml").toString(), }; + com.sun.org.apache.xalan.internal.xslt.Process._main(args); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,5 @@ +<?xml version="1.0"?> +<ObjectSetRoot> +<Object> +</Object> +</ObjectSetRoot> diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:variable name="validAffectsRelClasses"> +</xsl:variable> + +<xsl:key name="UniqueAffectsRelObjects" + match="/ObjectSetRoot/Object[ + contains($validAffectsRelClasses, @Class)]" + use="not(@OBID=preceding-sibling::Object[ + contains($validAffectsRelClasses, @Class)]/@OBID)"/> +</xsl:stylesheet> diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileReader; +import java.io.InputStream; + +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6401137 + * @summary Test transform certain xsl. + */ +public class CR6401137Test { + + @Test + public final void testTransform() { + + try { + String str = new String(); + ByteArrayOutputStream byte_stream = new ByteArrayOutputStream(); + File inputFile = new File(getClass().getResource("CR6401137.xml").getPath()); + FileReader in = new FileReader(inputFile); + int c; + + while ((c = in.read()) != -1) { + str = str + new Character((char) c).toString(); + } + + in.close(); + + System.out.println(str); + byte buf[] = str.getBytes(); + byte_stream.write(buf); + String style_sheet_uri = "CR6401137.xsl"; + byte[] xml_byte_array = byte_stream.toByteArray(); + InputStream xml_input_stream = new ByteArrayInputStream(xml_byte_array); + + Source xml_source = new StreamSource(xml_input_stream); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(); + StreamSource source = new StreamSource(getClass().getResourceAsStream(style_sheet_uri)); + transformer = tFactory.newTransformer(source); + + ByteArrayOutputStream result_output_stream = new ByteArrayOutputStream(); + Result result = new StreamResult(result_output_stream); + transformer.transform(xml_source, result); + result_output_stream.close(); + + // expected success + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6551600.policy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6551600.policy Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,22 @@ +grant { + permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; + permission java.lang.RuntimePermission "accessDeclaredMembers"; + + permission java.io.FilePermission "${test.classes}/../../-", "read, write, delete"; + permission java.io.FilePermission ".", "read, write, delete"; + permission java.util.PropertyPermission "*", "read, write"; + + permission java.lang.RuntimePermission "setSecurityManager"; + permission java.lang.RuntimePermission "createSecurityManager"; + permission java.lang.RuntimePermission "createClassLoader"; + permission java.lang.RuntimePermission "setIO"; + permission java.lang.RuntimePermission "setContextClassLoader"; + permission java.security.SecurityPermission "getPolicy"; + + permission java.io.FilePermission "${test.src}/-", "read, write, delete"; + permission java.io.FilePermission "${user.dir}/-", "read, write, delete"; + permission java.io.FilePermission "${java.io.tmpdir}/-", "read, write, delete"; + + permission java.io.FilePermission "//localhost/C$/xslt_unc_test.xml", "read, write, delete"; + +}; diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6551600Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6551600Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/* + * @bug 6551600 + * @summary Test using UNC path as StreamResult. + */ +public class CR6551600Test { + + @Test + public final void testUNCPath() { + String hostName = ""; + try { + hostName = java.net.InetAddress.getLocalHost().getHostName(); + } catch (java.net.UnknownHostException e) { + // falls through + } + + String path = "\\\\" + hostName + "\\C$\\xslt_unc_test.xml"; + String os = System.getProperty("os.name"); + if (os.indexOf("Windows") < 0) { + path = "///tmp/test.xml"; + } + else { + policy.PolicyUtil.changePolicy(getClass().getResource("CR6551600.policy").getFile()); + } + + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document doc = builder.newDocument(); + Element root = doc.createElement("test"); + doc.appendChild(root); + // create an identity transform + Transformer t = TransformerFactory.newInstance().newTransformer(); + File f = new File(path); + StreamResult result = new StreamResult(f); + DOMSource source = new DOMSource(doc); + System.out.println("Writing to " + f); + t.transform(source, result); + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + + File file = new File(path); + if (file.exists()) { + file.deleteOnExit(); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6577667.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6577667.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xlink="http://www.w3.org/1999/xlink" + > + <xsl:output omit-xml-declaration = "yes" /> +<xsl:template match="mo" > + <xsl:choose> + <xsl:when test="and * and" ></xsl:when> + <xsl:when test="and and and" ></xsl:when> + <xsl:when test="* and *" ></xsl:when> + <xsl:when test="not(preceding-sibling::elem1 and following-sibling::elem2)"></xsl:when> + <xsl:when test="not(preceding-sibling::* and following-sibling::*)"></xsl:when> + <xsl:when test="or * or" ></xsl:when> + <xsl:when test="and or or" ></xsl:when> + <xsl:when test="* or *" ></xsl:when> + <xsl:when test="not(preceding-sibling::elem1 or following-sibling::elem2)"></xsl:when> + <xsl:when test="not(preceding-sibling::* or following-sibling::*)"></xsl:when> + <xsl:when test="and | and" ></xsl:when> + <xsl:when test="* | *" ></xsl:when> + <xsl:when test="not(preceding-sibling::elem1 | following-sibling::elem2)"></xsl:when> + <xsl:when test="not(preceding-sibling::* | following-sibling::*)"></xsl:when> + </xsl:choose> +</xsl:template> +</xsl:stylesheet> + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6577667Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6577667Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.InputStream; + +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6577667 + * @summary Test XSLT can parse statement "not(preceding-sibling::* or following-sibling::*)" in stylesheet file. + */ +public class CR6577667Test { + + @Test + public final void testTransform() { + try { + InputStream xin = this.getClass().getResourceAsStream("CR6577667.xsl"); + StreamSource xslt = new StreamSource(xin); + TransformerFactory fc = TransformerFactory.newInstance(); + Transformer transformer = fc.newTransformer(xslt); + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6652519Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6652519Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; + +/* + * @bug 6652519 + * @summary Test transfoming from StreamSource to DOMResult. + */ +public class CR6652519Test { + + @Test + public final void test1() { + try { + long start = System.currentTimeMillis(); + Transformer t = TransformerFactory.newInstance().newTransformer(); + File file = new File(getClass().getResource("msgAttach.xml").getFile()); + StreamSource source = new StreamSource(file); + DOMResult result = new DOMResult(); + t.transform(source, result); + + long end = System.currentTimeMillis(); + System.out.println("Test2:Total Time Taken=" + (end - start)); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + public final void xtest2() { + try { + long start = System.currentTimeMillis(); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document doc = db.parse(new File(getClass().getResource("msgAttach.xml").getFile())); + long end = System.currentTimeMillis(); + System.out.println("Test1: Total Time Taken=" + (end - start)); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6689809Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6689809Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.CharArrayWriter; + +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6689809 + * @summary Test Transformer can handle XPath predicates in xsl:key elements. + */ +public class CR6689809Test { + + @Test + public final void testTransform() { + + try { + StreamSource input = new StreamSource(getClass().getResourceAsStream("PredicateInKeyTest.xml")); + StreamSource stylesheet = new StreamSource(getClass().getResourceAsStream("PredicateInKeyTest.xsl")); + CharArrayWriter buffer = new CharArrayWriter(); + StreamResult output = new StreamResult(buffer); + + TransformerFactory.newInstance().newTransformer(stylesheet).transform(input, output); + + Assert.assertEquals(buffer.toString(), "0|1|2|3", "XSLT xsl:key implementation is broken!"); + // expected success + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<catalog> + <book> + <title>Java + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,22 @@ + + + + +

+ + + +
+ + + +

MyTemplate has been called. param x=.

+
+ + +
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829Inc.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829Inc.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + +

Dummy has been called.

+
+ +
+ diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; +import java.io.StringWriter; + +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6905829 + * @summary Test XSLT can parse certain xsl. + */ +public class CR6905829Test { + + @Test + public final void testTransform() { + try { + String file = getClass().getResource("CR6905829.xsl").getFile(); + Transformer t = TransformerFactory.newInstance().newTransformer(new StreamSource(new File(file))); + + System.out.printf("transformer: %s%n", t.getClass().getName()); + + StringWriter streamResult = new StringWriter(); + t.transform(new StreamSource(getClass().getResourceAsStream("CR6905829.xml")), new StreamResult(streamResult)); + + // expected success + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6935697.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6935697.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,158 @@ +Data Objects +Data Fields +select all +select none +Choose Data Object +Choose Data Fields +More Options, or Finish +Next +Back +Finish +Apply +Sort Direction +View Fields +Sorted Fields +Ascending +Descending +OK +Cancel +Report Groups +Report Group +Report Fields +Group Properties +Display Group Header/Footer +Group Sort Direction +Group Type +Surface Prompts +Header +Footer +Display in +Row Filter +Group Filter +Summary Function(s) +Report Footer +Group Footer +Detail +Same Value +Choose Content Type +If you group by a field, you can only choose one Summary Function for one Chart Value. +You must select at least one summary function for each chart value. +Sum +Average +Minimum +Maximum +Count +Count Distinct +Group +Summary +Columns +rows +Values +Show intermediate summary functions +Summary Levels +Hide +Arrange +data object +You must click Add/Update Entry to apply the filter +Filter Entry +Crosstab Editor +Drag fields here to put the values on the row axis. +There must be at least one field in either rows or columns. +There must be at least one field selected for values. +Invalid value for Time Group quantity. Year should be a perfect divisor of 10, Month of 12, Week of 52, and Hour of 24. Minute and Second should be a perfect divisor of 60. Quarter and Day of Year/Month/Week values can only be 1. +Fields +Sort +Data Objects +Actions +Editable Fields +Filter +Top N +Drilling +Calculation +Summary +Group +Driving +General +Content +Shading +Text +Align +Cond Format +Value Format +Data Labels +Font +Active Data +Axis +Content Type +Inputs +Associations +Gauge Styles +Themes +Background color +Collapse Edit Pane +Expand Edit Pane +Move Edit Pane +Display the Top N based on the first series of the chart +Display the Top N based on the sum of the series of the chart +Display the Top N based on the current sort criteria +Layout +Quantity +Add a field displaying the rank number +Field Name +Rank Field +Select Style +High Performance +Horizon +Medallion +Macro Options +Data Transfer +Run this macro before +Run this macro after +Name +Run on data transfer +Name definition for data +For Updating Ordered List views, apply a sort for Top N to display. +For Updating Ordered List views, apply a sort for Rank Colors to display. +View Editor +Summarize +You must choose an aggregate function to Summarize a List. +For Updating Ordered List views, a field must be selected in the Fields page if you want to sort on it. +Patterns +Cannot create a negative or zero grouped time bucket. +Cannot create time buckets with a non time based function. +is not a supported quantity for this time unit. \nSelect a quantity that divides evenly into +Cannot create a continuous time series with multiple groupings or units. +Target +Calculation +Percent Of Total +Tab Contents +Toolbar +Dashboard Contents +is not a supported quantity for Quarters. \nQuarters can only use a quantity of +You must group by the same number of fields for all Data Objects. +You must group by the same type of fields for all Data Objects. +Chart Data Fields +A field cannot be selected as an index and a measure. +Please select an Index +Please select a Measure +Please type in a Pass Filter +Index +SPC Chart Measures +3D View +Data +PropertiesTime Unit +Quantity +Time Groups +Year +Quarter +Month +Week +Day of Year +Day of Month +Day of Week +Hour +Minute +Second +Use time series +Continuous time series +Use time groupsbam_as_viewedit_doselect diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6935697.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6935697.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,1452 @@ + + + + + + + 21 + + + + + + + + + StreamingList + UpdatesList + List + UpdatingOrderedList + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Font + + + + ActiveData + + + + Driving + + + + CollapsedList + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Font + + + + ActiveData + + + + Driving + + + + ActionList + + + General + + + + Actions + + + + EditableFields + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Font + + + + ActiveData + + + + Driving + + + + OWCSpreadsheet + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + ActiveData + + + + ExcelSpreadsheet + + + General + + + + Macros + + + + DataTransfer + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + Columnar + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Font + + + + ActiveData + + + + DialGauge + + + GeneralDial + + + + Styles + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Font + + + + Arrow + MarketArrow + + + GeneralArrow + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Font + + + + RangeGauge + + + GeneralRange + + + + Styles + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Font + + + + + SurfacePrompts + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + SurfacePrompts + + + + + Container + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + Drilling + + + + + RowGroup + ColumnGroup + + + General + + + + Layout + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + + CustomContent + + + General + + + + ChooseContentType + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + + TabGroup + + + + + TabContents + + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + + Dashboard + + + + + DashboardContents + + + + + + DashboardToolbar + + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + + ActionForm + + + chooseActionFormType + + + + inputs + + + + associations + + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + + BarChart + LineChart + AreaChart + ComboChart + StackedBarChart + + + General + + + + Axis + + + + DataLabels + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Themes + + + + Font + + + + ActiveData + + + + Patterns + + + + Target + + + + + ThreeDBarChart + ThreeDLineChart + ThreeDAreaChart + ThreeDComboChart + ThreeDStackedBarChart + + + General + + + + Axis + + + + DataLabels + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Themes + + + + Font + + + + ActiveData + + + + Patterns + + + + Target + + + + 3DView + + + + + + + General + + + + DataLabels + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Font + + + + + RChart + SChart + PChart + + + General + + + + Axis + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Themes + + + + Font + + + + ActiveData + + + + PieChart + + + General + + + + DataLabels + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Themes + + + + Font + + + + ActiveData + + + + Patterns + + + + ThreeDPieChart + + + General + + + + DataLabels + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + ValueFormat + + + + Themes + + + + Font + + + + ActiveData + + + + Patterns + + + + 3DView + + + + CrossTab + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + ValueFormat + + + + Themes + + + + ActiveData + + + + Driving + + + + + Matrix + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + ValueFormat + + + + ConditionalFormat + + + + Themes + + + + ActiveData + + + + Driving + + + + SummaryCrosstab + + + General + + + + BordersAndShading + + + + + & + + + TextAndAlignment + + + + Font + + + + ValueFormat + + + + ActiveData + + + + Driving + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DataTabsScroller + + 2 + + + + + + + + + + + + + + + + + + + + + + + viewEditor.SelectTab(''); + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + +
+
+ + .OnResize(); + + + position:relative;overflow:hidden;width:100%;height:px; + +
+ + position:absolute;width:100%;left:0px;top:px; + + +
+
+
+
+ +
+ + + + + + UpdatingOrderedList + ActionList + + + datasets + + + + fields + + + + sort + + + + rowFilter + + + + topN + + + + calculations + + + + drilling + + + + surfacePrompts + + + + CollapsedList + List + OWCSpreadsheet + ExcelSpreadsheet + + + datasets + + + + fields + + + + sort + + + + rowFilter + + + + calculations + + + + drilling + + + + surfacePrompts + + + + StreamingList + UpdatesList + + + datasets + + + + fields + + + + rowFilter + + + + calculations + + + + drilling + + + + surfacePrompts + + + + CrossTab + + + datasets + + + + crosstabFields + + + + aggregate + + + + rowFilter + + + + calculations + + + + drilling + + + + surfacePrompts + + + + Matrix + + + datasets + + + + crosstabFields + + + + rowFilter + + + + drilling + + + + calculations + + + + surfacePrompts + + + + SummaryCrosstab + + + datasets + + + + crosstabFields + + + + aggregate + + + + rowFilter + + + + calculations + + + + drilling + + + + surfacePrompts + + + + Columnar + + + datasets + + + + fields + + + + group + + + + aggregate + + + + rowFilter + + + + calculations + + + + drilling + + + + StackedBarChart + LineChart + AreaChart + ComboChart + ThreeDStackedBarChart + ThreeDLineChart + ThreeDAreaChart + ThreeDComboChart + + + datasets + + + + chartFields + + + + rowFilter + + + + topN + + + + calculations + + + + drilling + + + + surfacePrompts + + + + RChart + SChart + PChart + + + datasets + + + + chartFields + + + + rowFilter + + + + calculations + + + + drilling + + + + surfacePrompts + + + + BarChart + ThreeDBarChart + + + datasets + + + + chartFields + + + + rowFilter + + + + topN + + + + calculations + + + + drilling + + + + surfacePrompts + + + + PieChart + ThreeDPieChart + + + + datasets + + + + chartFields + + + + rowFilter + + + + calculations + + + + drilling + + + + surfacePrompts + + + + Arrow + MarketArrow + RangeGauge + DialGauge + + + datasets + + + + kPIFields + + + + rowFilter + + + + calculations + + + + drilling + + + + surfacePrompts + + + + + +
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6935697Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6935697Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.FileOutputStream; + +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6935697 + * @summary Test XSLT can parse the certain xsl. + */ +public class CR6935697Test { + + @Test + public final void testTransform() { + + try { + + String inFilename = "CR6935697.xml"; + String xslFilename = "CR6935697.xsl"; + String outFilename = "CR6935697.out"; + + // Create transformer factory + TransformerFactory factory = TransformerFactory.newInstance(); + // Use the factory to create a template containing the xsl file + Templates template = factory.newTemplates(new StreamSource(getClass().getResourceAsStream(xslFilename))); + // Use the template to create a transformer + Transformer xformer = template.newTransformer(); + // Prepare the input and output files + Source source = new StreamSource(getClass().getResourceAsStream(inFilename)); + Result result = new StreamResult(new FileOutputStream(outFilename)); + // Apply the xsl file to the source file and write the result to the + // output file + xformer.transform(source, result); + + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,21 @@ + + + + + + E3 + + + + + + + + + E3 + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,49 @@ + + + + + + + + + Working (by replacing the count() argument with a variable): + + + + + Node ; + + count = + + --------- + + Not working in the 2nd loop iteration (by using the union expression as count() argument): + + + + + + Node ; + + count = + + --------- + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; +import java.io.StringWriter; + +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6941869 + * @summary Test XSLT evaluate "count(.|key('props', d/e)[1])" correctly. + */ +public class CR6941869Test { + + @Test + public final void testTransform() { + File xml = new File(getClass().getResource("CR6941869.xml").getFile()); + File xsl = new File(getClass().getResource("CR6941869.xsl").getFile()); + try { + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(); + StreamSource source = new StreamSource(xsl); + transformer = tFactory.newTransformer(source); + // the xml result + StringWriter xmlResultString = new StringWriter(); + StreamResult xmlResultStream = new StreamResult(xmlResultString); + + transformer.transform(new StreamSource(xml), xmlResultStream); + System.out.println(xmlResultString.toString()); + String temp = xmlResultString.toString(); + int pos = temp.lastIndexOf("count"); + if (temp.substring(pos + 8, pos + 9).equals("1")) { + Assert.fail("count=1"); + } else if (temp.substring(pos + 8, pos + 9).equals("2")) { + // expected success + System.out.println("count=2"); + } + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,5 @@ + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,19 @@ + + + + + + + namevalue + packagevalue + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.StringWriter; + +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6957215 + * @summary Test XSLT generates the element content using xsl:attribute instructions. + */ +public class CR6957215Test { + + @Test + public final void testTransform() { + xsl(getClass().getResource("CR6957215.xml").getFile(), getClass().getResource("CR6957215.xsl").getFile()); + } + + public static void xsl(String inFilename, String xslFilename) { + try { + // Create transformer factory + TransformerFactory factory = TransformerFactory.newInstance(); + + // Use the factory to create a template containing the xsl file + Templates template = factory.newTemplates(new StreamSource(new FileInputStream(xslFilename))); + + // Use the template to create a transformer + Transformer xformer = template.newTransformer(); + + // Prepare the input and output files + Source source = new StreamSource(new FileInputStream(inFilename)); + + StringWriter strResult = new StringWriter(); + Result result = new StreamResult(strResult); + + // Apply the xsl file to the source file and write the result to the + // output file + xformer.transform(source, result); + String resultString = strResult.toString(); + System.out.println(resultString); + if (resultString.indexOf("aaa-ref/") > 0) + Assert.fail("missing attributes"); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (TransformerConfigurationException e) { + // An error occurred in the XSL file + e.printStackTrace(); + } catch (TransformerException e) { + e.printStackTrace(); + // An error occurred while applying the XSL file + // Get location of error in input file + SourceLocator locator = e.getLocator(); + int col = locator.getColumnNumber(); + int line = locator.getLineNumber(); + String publicId = locator.getPublicId(); + String systemId = locator.getSystemId(); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,14 @@ + + + + + + +

+ These pages are all about XSLT, an XML-based language for translating one set of XML into another set of XML, or into HTML. Of course, there are all sorts of other pages around that cover XSLT. Jeni's XSLT Pages, though, are dedicated to helping people understand and make the most of using XSLT. +

+

+ My warmest thanks to all those people who post interesting problems on XSL-List, and especially to those of you that have encouraged me to set up this site through your kind emails. +

+ +
diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,618 @@ + + + + + + + + + + + + + + + + + + + + + <xsl:call-template name="get-metadata"> + <xsl:with-param name="what" select="'title'" /> + <xsl:with-param name="about" select="$uri" /> + </xsl:call-template> + + + + + + + + + + + + + + + + + + + + + + +

+ + +

+
+ + + + + + + + + + /index.xml + + /index.html + + + + + + + + + + + + ../index.xml + ../index.html + + + + + index.xml + index.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
+ $ + + + = + + + [= ] + + +
+
+ + +
    + +
+
+ +
+
+ + +
  • :
  • +
    + + + + + + + '' + "" + + + + + + + + + + + +
    + +
    +
    + + +
    + +
    +
    + + +
    +

    + + + + + + +

    + +
    +
    + + +
    +		
    +	
    +
    + + + + +
    +        
    +      
    +
    + + + + + +
    +
    + + + + + + + + + +
    + + + + + + + + + + + +
    + + + + + + + + + + + [] + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + resources/icons/ + click- + + .gif + + + javascript:this.src='resources/icons/over-.gif' + javascript:this.src='resources/icons/click-.gif' + javascript:this.src='resources/icons/.gif' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + img + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http:// + + + mailto: + + + + + + + + + offsite + mailto + local + + + + + + + + + + + + + home + mail + goto + + + + + + +
    +
    +

    + + + + + + + + last modified + + + + + + + + by + + + + + + Jeni Tennison + + +

    +
    +
    + +
    diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringWriter; + +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 7098746 + * @summary Test transforming as expected. + */ +public class CR7098746Test { + + @Test + public final void testTransform() { + + try { + + String inFilename = "CR7098746.xml"; + String xslFilename = "CR7098746.xsl"; + + StringWriter sw = new StringWriter(); + // Create transformer factory + TransformerFactory factory = TransformerFactory.newInstance(); + // set the translet name + // factory.setAttribute("translet-name", "myTranslet"); + + // set the destination directory + // factory.setAttribute("destination-directory", "c:\\temp"); + // factory.setAttribute("generate-translet", Boolean.TRUE); + + // Use the factory to create a template containing the xsl file + Templates template = factory.newTemplates(new StreamSource(getClass().getResourceAsStream(xslFilename))); + // Use the template to create a transformer + Transformer xformer = template.newTransformer(); + // Prepare the input and output files + Source source = new StreamSource(getClass().getResourceAsStream(inFilename)); + // Result result = new StreamResult(new + // FileOutputStream(outFilename)); + Result result = new StreamResult(sw); + // Apply the xsl file to the source file and write the result to the + // output file + xformer.transform(source, result); + + String out = sw.toString(); + if (out.indexOf("

    ") < 0) { + Assert.fail(out); + } + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/DOMResultTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/DOMResultTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import org.testng.annotations.Test; +import org.testng.Assert; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.SAXException; + +/* + * @summary Test DOMResult. + */ +public class DOMResultTest { + + @Test + public void testDOMResult1() { + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + String xml = this.getClass().getResource("toys.xml").getFile(); + Document doc = db.parse(new FileInputStream(new File(xml))); + TransformerFactory tff = TransformerFactory.newInstance(); + Transformer tf = tff.newTransformer(); + // get element node + Node toys = doc.getChildNodes().item(1); + // supposed to insert new node at index=4 + int index = 4; + String systemId = "customSysId"; + DOMResult result = new DOMResult(toys, systemId); + result.setNextSibling(result.getNode().getChildNodes().item(index)); + int length = result.getNode().getChildNodes().getLength(); + // copy the first element node and insert it to position + // marked by index + Node source = doc.getLastChild().getChildNodes().item(1); + tf.transform(new DOMSource(source), result); + + // document length verification + if (result.getNode().getChildNodes().getLength() != length + 1) { + Assert.fail("incorrect nodes length"); + } + // element content verification + Node newnode = result.getNode().getChildNodes().item(index); + System.out.println(newnode.getTextContent()); + if (!source.getTextContent().equals(newnode.getTextContent())) { + Assert.fail("target node content is not matched with source"); + } + // element systemid verification + if (!result.getSystemId().equals(systemId)) { + Assert.fail("systemId is not matched"); + } + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } catch (TransformerConfigurationException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } catch (TransformerException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } + } + + @Test + public void testDOMResult2() { + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + String xml = this.getClass().getResource("toys.xml").getFile(); + Document doc = db.parse(new FileInputStream(new File(xml))); + TransformerFactory tff = TransformerFactory.newInstance(); + Transformer tf = tff.newTransformer(); + // get element node + Node toys = doc.getChildNodes().item(1); + // supposed to insert new node at index=4 + int index = 4; + String systemId = "customSysId"; + DOMResult result = new DOMResult(toys, toys.getChildNodes().item(index), systemId); + int length = result.getNode().getChildNodes().getLength(); + // copy the first element node and insert it to position + // marked by index + Node source = doc.getLastChild().getChildNodes().item(1); + tf.transform(new DOMSource(source), result); + + // document length verification + if (result.getNode().getChildNodes().getLength() != length + 1) { + Assert.fail("incorrect nodes length"); + } + // element content verification + Node newnode = result.getNode().getChildNodes().item(index); + System.out.println(newnode.getTextContent()); + if (!source.getTextContent().equals(newnode.getTextContent())) { + Assert.fail("target node content is not matched with source"); + } + // element systemid verification + if (!result.getSystemId().equals(systemId)) { + Assert.fail("systemId is not matched"); + } + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } catch (TransformerConfigurationException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } catch (TransformerException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } + } + + @Test + public void testDOMResult3() { + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + String xml = this.getClass().getResource("toys.xml").getFile(); + Document doc = db.parse(new FileInputStream(new File(xml))); + TransformerFactory tff = TransformerFactory.newInstance(); + Transformer tf = tff.newTransformer(); + // get element node + Node toys = doc.getChildNodes().item(1); + // supposed to insert new node at index=4 + int index = 4; + DOMResult result = new DOMResult(toys, toys.getChildNodes().item(index)); + int length = result.getNode().getChildNodes().getLength(); + // copy the first element node and insert it to position + // marked by index + Node source = doc.getLastChild().getChildNodes().item(1); + tf.transform(new DOMSource(source), result); + + // document length verification + if (result.getNode().getChildNodes().getLength() != length + 1) { + Assert.fail("incorrect nodes length"); + } + // element content verification + Node newnode = result.getNode().getChildNodes().item(index); + System.out.println(newnode.getTextContent()); + if (!source.getTextContent().equals(newnode.getTextContent())) { + Assert.fail("target node content is not matched with source"); + } + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } catch (TransformerConfigurationException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } catch (TransformerException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/FactoryFindTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/FactoryFindTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.net.URL; +import java.net.URLClassLoader; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test creating TransformerFactory with ContextClassLoader. + */ +public class FactoryFindTest { + + boolean myClassLoaderUsed = false; + + @Test + public void testFactoryFind() { + try { + // System.setProperty("jaxp.debug", "true"); + + TransformerFactory factory = TransformerFactory.newInstance(); + Assert.assertTrue(factory.getClass().getClassLoader() == null); + + Thread.currentThread().setContextClassLoader(null); + factory = TransformerFactory.newInstance(); + Assert.assertTrue(factory.getClass().getClassLoader() == null); + + Thread.currentThread().setContextClassLoader(new MyClassLoader()); + factory = TransformerFactory.newInstance(); + if (System.getSecurityManager() == null) + Assert.assertTrue(myClassLoaderUsed); + else + Assert.assertFalse(myClassLoaderUsed); + } catch (Exception ex) { + Assert.fail(ex.toString()); + } + + } + + class MyClassLoader extends URLClassLoader { + + public MyClassLoader() { + super(new URL[0]); + } + + public Class loadClass(String name) throws ClassNotFoundException { + myClassLoaderUsed = true; + return super.loadClass(name); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ +12 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + + First: + Second: + Third: + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringWriter; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6905829 + * @summary Test XSLT can work against the certain xsl. + */ +public class Issue2204Test { + + @Test + public final void testTransform() { + try { + Transformer t = TransformerFactory.newInstance().newTransformer(new StreamSource(getClass().getResourceAsStream("Issue2204.xsl"))); + + System.out.printf("transformer: %s%n", t.getClass().getName()); + + StringWriter streamResult = new StringWriter(); + t.transform(new StreamSource(getClass().getResourceAsStream("Issue2204.xml")), new StreamResult(streamResult)); + + System.out.println(streamResult.toString()); + if (streamResult.toString().indexOf("3") > 0) { + Assert.fail("Function Count on variable modifies number of nodes in variable."); + } + // expected success + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2290.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2290.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2290Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2290Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test XSL extension for RTF works, for https://issues.apache.org/jira/i#browse/XALANJ-2290. + */ +public class Issue2290Test { + + @Test + public final void testTransform() throws Exception { + DocumentFragment outNode = null; + DocumentBuilder docBuilder = null; + Document outDoc = null; + // TransformerImpl transformer = null; + StringReader execReaderXML = null; + Properties propFormat = null; + StringWriter sw = null; + + try { + // template = TransformerFactory.newInstance().newTemplates(new + // StreamSource("D:/Work/Apache/TestVar.xsl")); + // transformer = (TransformerImpl) template.newTransformer(); + Transformer t = TransformerFactory.newInstance().newTransformer(new StreamSource(getClass().getResourceAsStream("Issue2290.xsl"))); + System.out.print("Created Transformer"); + execReaderXML = new StringReader(" Stuff"); + + + docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + outDoc = docBuilder.newDocument(); + outNode = outDoc.createDocumentFragment(); + System.out.println("Created Fragment"); + System.out.println("execute transformer."); + // transformer.transform(new StreamSource(execReaderXML),new + // DOMResult(outNode)); + t.transform(new StreamSource(execReaderXML), new DOMResult(outNode)); + System.out.println("Finsished transformer."); + sw = new StringWriter(); + + StreamResult sr = new StreamResult(sw); + t = TransformerFactory.newInstance().newTransformer(); + t.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + t.transform(new DOMSource(outNode), sr); + System.out.println(sw.toString()); + } catch (Exception e) { + Assert.fail(e.toString()); + } finally { + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/MsWordXMLImport.xsl.data --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/MsWordXMLImport.xsl.data Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x-symbol + + + + + swiss + + + modern + + + roman + + + script + + + decorative + + + system + + + system + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text + + + + + + + text + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + frame + + + page + + + as-char + + + paragraph + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + page + cm + cm + cm + cm + + + + + + + + + + + + + + + + + + + + + + + + + + page + cm + cm + cm + cm + + + + + + + + + + + + + List + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bullet Symbols + + + + Numbering Symbols + + + + + + + + + + + + Numbering Symbols + + + + + + + + + + + + + + end + + + center + + + start + + + + + + + + + + + + + + + 0 + + + + + + + + + 0cm + + + + 0.20cm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + middle + line + + cm + cm + + + + + + + + + + + + + 0 + + + + + + + + + 0cm + + + 0.20cm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + List + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + 0 + + + + + + + + + + + + + 1 + + + I + + + i + + + A + + + a + + + 一, 二, 三, ... + + + ア, イ, ウ, ... + + + イ, ロ, ハ, ... + + + 1, 2, 3, ... + + + 壱, 弐, 参, ... + + + ①, ②, ③, ... + + + ア, イ, ウ, ... + + + イ, ロ, ハ, ... + + + 가, 나, 다, ... + + + ㄱ, ㄴ, ㄷ, ... + + + 甲, 乙, 丙, ... + + + 子, 丑, 寅, ... + + + 壹, 貳, 參, ... + + + 壹, 贰, 叁, ... + + + 일, 이, 삼, ... + + + א, ב, ג, ... + + + أ, ب, ت, ... + + + ก, ข, ฃ, ... + + + Native Numbering + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + pm + + cm + cm + + + cm + cm + cm + + + cm + cm + cm + + + cm + cm + cm + + + cm + + + + + + + + + cm + + + + + + + + + + + + Standard + + + + + cm + 0.792cm + true + + + + + cm + 0.792cm + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + + true + + + + + + + 1 + 1 + + + 3 + + + 2 + + + 1 + + + 0 + + + + + + + + + + + + + + + + Table + table + + + + + + + + + + margins + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + 0 + + + + + + + + + + + + + + TableFrame + graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no-limit + + + + + top + + + middle + + + bottom + + + from-top + + + top + + + from-top + + + + + + + + + + + + + + + + + + + + + + + + + + + + + left + + + center + + + right + + + from-left + + + outside + + + left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #ffffff + 100% + parallel + + + + + + + table-column + Table.C + + + + + + + + + + + + + + table-row + Table.R + + + + + + + + + + + + + + + + + Table.RC + table-cell + + + + + + + + + + + + + + + + + + + + + + top + + + middle + + + bottom + + + automatic + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + single + + + + + + hidden + solid + double + + + + + + + + + c0c0c0 + + + + + + c0c0c0 + + + + + + c0c0c0 + + 000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.002cm 0.035cm 0.002cm + + + + 0.002cm 0.088cm 0.002cm + + + + 0.035cm 0.035cm 0.035cm + + + + 0.088cm 0.088cm 0.088cm + + + + + + + + 0.002cm 0.035cm 0.002cm + + + + .002cm 0.088cm 0.002cm + + + + 0.035cm 0.035cm 0.035cm + + + + 0.088cm 0.088cm 0.088cm + + + + + + + + + + 0.002cm 0.088cm 0.035cm + + + + 0.002cm 0.088cm 0.088cm + + + + 0.002cm 0.088cm 0.141cm + + + + + + 0.088cm 0.035cm 0.035cm + + + + + + + + 0.002cm 0.088cm 0.088cm + + + + 0.002cm 0.088cm 0.141cm + + + + 0.088cm 0.088cm 0.141cm + + + + + + + + 0.002cm 0.035cm 0.002cm + + + + 0.035cm 0.035cm 0.035cm + + + + + + 0.035cm 0.088cm 0.088cm + + + + 0.088cm 0.035cm 0.035cm + + + + + + + + 0.088cm 0.088cm 0.141cm + + + 0.141cm 0.088cm 0.088cm + + + + + + + + + + 0.002cm 0.035cm 0.002cm + + + + 0.035cm 0.035cm 0.035cm + + + + + + 0.088cm 0.035cm 0.035cm + + + + 0.035cm 0.088cm 0.088cm + + + + + + + + 0.141cm 0.088cm 0.088cm + + + 0.088cm 0.088cm 0.141cm + + + + + + + + + + 0.002cm 0.088cm 0.002cm + + + + + + 0.002cm 0.088cm 0.035cm + + + + 0.002cm 0.088cm 0.002cm + + + + + + + + 0.002cm 0.088cm 0.035cm + + + + 0.088cm 0.035cm 0.035cm + + + + + + + + 0.002cm 0.088cm 0.088cm + + + + 0.088cm 0.035cm 0.035cm + + + + + + + + 0.002cm 0.088cm 0.141cm + + + + 0.088cm 0.035cm 0.035cm + + + + + + + + 0.088cm 0.088cm 0.141cm + + + 0.141cm 0.088cm 0.088cm + + + + + + + + + + 0.002cm 0.088cm 0.035cm + + + + 0.002cm 0.088cm 0.088cm + + + + 0.002cm 0.088cm 0.141cm + + + + 0.088cm 0.088cm 0.141cm + + + + + + 0.035cm 0.035cm 0.035cm + + + + + + + + + + + + + + + 0.088cm 0.088cm 0.088cm + + + + 0.088cm 0.088cm 0.141cm + + + + + + + + 0.002cm 0.088cm 0.002cm + + + + + + 0.002cm 0.088cm 0.002cm + + + + 0.002cm 0.088cm 0.035cm + + + + + + + + 0.088cm 0.035cm 0.035cm + + + + 0.002cm 0.088cm 0.035cm + + + + + + + + 0.088cm 0.035cm 0.035cm + + + + 0.002cm 0.088cm 0.088cm + + + + + + + + 0.088cm 0.035cm 0.035cm + + + + 0.002cm 0.088cm 0.141cm + + + + + + + + 0.141cm 0.088cm 0.088cm + + + + 0.088cm 0.088cm 0.141cm + + + + + + + 0.002cm solid #000000 + + + + + + + + + + TableFrame + TableFr + + + + as-char + + + paragraph + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Table + + + + + + + + + + + + + Table + + + + + + + + + + + + Table.C + + + + + + + Table.R + + + + + + + Table.RC + + + + + + + + + + + + + + + + + + + + + Times New Roman + + + + pt + pt + + + pt + + + + 10pt + 10pt + 10pt + + + + + + + + + + + + + + + + cm + + + + + + + + + + + + + + + + + + + + + + + Standard + + + Standard1 + + + + + + + + + + + + + + Standard + + + Standard1 + + + + + + + + + + + + + + + Standard + + + Standard1 + + + + + + + + + + + cm + + + cm + + + cm + + + cm + + + + rl-tb + end + + + + + center + + + + + end + + + start + + + + + + + start + + + end + + + + + justify + false + + + + false + + + + cm + + + % + + + cm + + + + cm + + + cm + + + + + + + + + #000000 + + + + + + + + + + + + page + + + + + + cm + + + char + + + + + + + + -_. + + + + + hyphen + + + underscore + + + dot + + + middle-dot + + + + + + + + + true + + + avoid + + + 2 + 2 + + + false + + + normal + + + simple + + + none + + + + + middle + + + + + + + + + + + + + cm + + + + + + + cm + + + + + + + cm + + + + + + + cm + + + #000000 0.15cm 0.15cm + + + + false + + + + + + T + text + + + + + + + + + + + + + + + + + + + + + + + + + + + + bold + bold + + + bold + + + italic + italic + + + italic + + + uppercase + + + small-caps + + + single-line + + + double-line + + + true + + + 1pt 1pt + 1pt 1pt + + + engraved + + + embossed + + + true + + + # + + + cm + + + + + + + + 58% + 100% + + + + + + + + + super + sub + + + + + + pt + pt + + + pt + + + + + #000000 + + + #ffff00 + + + #00ff00 + + + #00ffff + + + #ff00ff + + + #0000ff + + + #ff0000 + + + #000080 + + + #008080 + + + #008000 + + + #800080 + + + #800000 + + + #808000 + + + #808080 + + + #c0c0c0 + + + + + + + single + false + + + bold + + + bold-dotted + + + bold-dash + + + long-dash + + + bold-long-dash + + + bold-dot-dash + + + bold-dot-dot-dash + + + bold-wave + + + double-wave + + + + + + + # + + + + true + #000000 + + + + # + + + + + + accent below + + + disc below + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text:h + text:p + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + T + + + + + + + + + + + + + + + + + + + + + + simple + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Microsoft Word 2003 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + measure_conversion.xsl: Find no conversion for to 'mm'! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + measure_conversion.xsl: Find no conversion for to 'cm'! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + measure_conversion.xsl: Find no conversion for to 'in'! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + measure_conversion.xsl: Find no conversion for to 'dpt'! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + measure_conversion.xsl: Find no conversion for to 'pica'! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + measure_conversion.xsl: Find no conversion for to 'pt'! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + measure_conversion.xsl: Find no conversion for to 'twip'! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + measure_conversion.xsl: Find no conversion for to 'px'! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + measure_conversion.xsl: Find no conversion for to 'twip'! + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/NCAA_Conference_Schedule_XML.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/NCAA_Conference_Schedule_XML.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/OpenJDK100017Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/OpenJDK100017Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.IOException; + +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.sax.TransformerHandler; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6883209 + * @summary Test XSLT won't cause StackOverflow when it handle many characters. + */ +public class OpenJDK100017Test { + + @Test + public final void testXMLStackOverflowBug() throws TransformerConfigurationException, IOException, SAXException { + try { + SAXTransformerFactory stf = (SAXTransformerFactory) TransformerFactory.newInstance(); + TransformerHandler ser = stf.newTransformerHandler(); + ser.setResult(new StreamResult(System.out)); + + StringBuilder sb = new StringBuilder(4096); + for (int x = 4096; x > 0; x--) { + sb.append((char) x); + } + ser.characters(sb.toString().toCharArray(), 0, sb.toString().toCharArray().length); + ser.endDocument(); + } catch (StackOverflowError se) { + se.printStackTrace(); + Assert.fail("StackOverflow"); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/PredicateInKeyTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/PredicateInKeyTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,29 @@ + + +0123 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/PredicateInKeyTest.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/PredicateInKeyTest.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + | + + | + + | + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SAX2DOMTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SAX2DOMTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamSource; + +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; +import org.xml.sax.XMLReader; +import org.xml.sax.ext.LexicalHandler; +import org.xml.sax.helpers.AttributesImpl; +import org.xml.sax.helpers.XMLFilterImpl; + +/* + * @summary Test Transforming from SAX to DOM. + */ +public class SAX2DOMTest { + + @Test + public void test() throws Exception { + SAXParserFactory fac = SAXParserFactory.newInstance(); + fac.setNamespaceAware(true); + SAXParser saxParser = fac.newSAXParser(); + + StreamSource sr = new StreamSource(this.getClass().getResourceAsStream("SAX2DOMTest.xml")); + InputSource is = SAXSource.sourceToInputSource(sr); + RejectDoctypeSaxFilter rf = new RejectDoctypeSaxFilter(saxParser); + SAXSource src = new SAXSource(rf, is); + Transformer transformer = TransformerFactory.newInstance().newTransformer(); + DOMResult result = new DOMResult(); + transformer.transform(src, result); + + Document doc = (Document) result.getNode(); + System.out.println("Name" + doc.getDocumentElement().getLocalName()); + + String id = "XWSSGID-11605791027261938254268"; + Element selement = doc.getElementById(id); + if (selement == null) { + System.out.println("getElementById returned null"); + } + + } + + public static class RejectDoctypeSaxFilter extends XMLFilterImpl implements XMLReader, LexicalHandler { + + /** Standard SAX 2.0 ext property */ + static final String LEXICAL_HANDLER_PROP = "http://xml.org/sax/properties/lexical-handler"; + + static final String WSU_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd".intern(); + static final String SIGNATURE_LNAME = "Signature".intern(); + static final String ENCRYPTED_DATA_LNAME = "EncryptedData".intern(); + static final String DSIG_NS = "http://www.w3.org/2000/09/xmldsig#".intern(); + static final String XENC_NS = "http://www.w3.org/2001/04/xmlenc#".intern(); + static final String ID_NAME = "ID".intern(); + + /** LexicalHandler to forward events to, if any */ + private LexicalHandler lexicalHandler; + + public RejectDoctypeSaxFilter(SAXParser saxParser) throws Exception { + XMLReader xmlReader; + try { + xmlReader = saxParser.getXMLReader(); + } catch (Exception e) { + throw new Exception("Couldn't get an XMLReader while constructing a RejectDoctypeSaxFilter", e); + } + + // Set ourselves up to be the SAX LexicalHandler + try { + xmlReader.setProperty(LEXICAL_HANDLER_PROP, this); + } catch (Exception e) { + throw new Exception("Couldn't set the lexical handler property while constructing a RejectDoctypeSaxFilter", e); + } + + // Set the parent XMLReader of this SAX filter + setParent(xmlReader); + } + + /* + * Override setProperty() to capture any LexicalHandler that is set for + * forwarding of events. + */ + public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { + if (LEXICAL_HANDLER_PROP.equals(name)) { + lexicalHandler = (LexicalHandler) value; + } else { + super.setProperty(name, value); + } + } + + // + // Beginning of SAX LexicalHandler callbacks... + // + + public void startDTD(String name, String publicId, String systemId) throws SAXException { + throw new SAXException("Document Type Declaration is not allowed"); + } + + public void endDTD() throws SAXException { + } + + public void startEntity(String name) throws SAXException { + if (lexicalHandler != null) { + lexicalHandler.startEntity(name); + } + } + + public void endEntity(String name) throws SAXException { + if (lexicalHandler != null) { + lexicalHandler.endEntity(name); + } + } + + public void startCDATA() throws SAXException { + if (lexicalHandler != null) { + lexicalHandler.startCDATA(); + } + } + + public void endCDATA() throws SAXException { + if (lexicalHandler != null) { + lexicalHandler.endCDATA(); + } + } + + public void comment(char[] ch, int start, int length) throws SAXException { + if (lexicalHandler != null) { + lexicalHandler.comment(ch, start, length); + } + } + + // + // End of SAX LexicalHandler callbacks + // + + public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { + if (atts != null) { + boolean eos = false; + if (namespaceURI == DSIG_NS || XENC_NS == namespaceURI) { + eos = true; + } + int length = atts.getLength(); + AttributesImpl attrImpl = new AttributesImpl(); + for (int i = 0; i < length; i++) { + String name = atts.getLocalName(i); + if (name != null && (name.equals("Id"))) { + if (eos || atts.getURI(i) == WSU_NS) { + attrImpl.addAttribute(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), ID_NAME, atts.getValue(i)); + } else { + attrImpl.addAttribute(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i)); + } + } else { + attrImpl.addAttribute(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i)); + } + } + super.startElement(namespaceURI, localName, qName, attrImpl); + } else { + super.startElement(namespaceURI, localName, qName, atts); + } + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SAX2DOMTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SAX2DOMTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,109 @@ + + + + + MIICvjCCAicCBEUKVsswDQYJKoZIhvc + NAQEEBQAwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpD + YWxpZm9ybmlhMRQwEgYDVQQHEwtTYW50YSBDbGFyYTEZMBcGA1UEChMQU3VuIE1pY3Jvc3lz + dGVt + czErMCkGA1UECxMiU3VuIEphdmEgU3lzdGVtIEFwcGxpY2F0aW9uIFNlcnZlcjEjMCEGA1UE + AxMa + a3VtYXJqYXlhbnRpLmluZGlhLnN1bi5jb20wHhcNMDYwOTE1MDczMTIzWhcNMTYwOTEyMDcz + MTIz + WjCBpTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFDASBgNVBAcTC1NhbnRh + IENs + YXJhMRkwFwYDVQQKExBTdW4gTWljcm9zeXN0ZW1zMSswKQYDVQQLEyJTdW4gSmF2YSBTeXN0 + ZW0g + QXBwbGljYXRpb24gU2VydmVyMSMwIQYDVQQDExprdW1hcmpheWFudGkuaW5kaWEuc3VuLmNv + bTCB + nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArvcLWMmE7KUE+QJhhv + +sNEpsVnOgDQ8Q2Q7WUUHh + psY/o059aaurJT6GpmBL8fOoVRw08hsRN5B1rBUSjEQhlVNP/RM5tKow/hdXNt + +zBhQ11d8Kocvd + VJcTSsuLCQombPJj0gzVeu3UOa0n290YvakbDxpBLoA14d4K/ + lA6BOsCAwEAATANBgkqhkiG9w0B + AQQFAAOBgQCWxwpM2eVlE2mG6rsnrhJMQdtaLIoEilh6xtUTkFgLW + +H6rRSFAr7pxCO2OiwWWzRa + FQuuigYlhDpTcCcQARElhlL5ZHLP84cgp/ + 2KfFKXBphOx9xNoThFLDuh2ExUUydfqZMXYhpN39fe + ziQeqggTVsTKHTfFsNpAW09ZoXx5ug== + + + + + + + + + elU7zQXCWw3VUeb7CRRhm2Qc0HTF6tQz4MAaLDrlw60oBi0bHi2npe + vNuhQuDIMBcqA4U9f51zK7 + /tR8602YjpMETlby/w01yLGb2IvzKsFAL02NilRUT4o1Jj2PiLibcbVonzuye/ + dfoNKi5dNeQY6k + In3JurQmap8QEEpEoIM= + + + + + + + + + + ZnUgV0uixMVhb7LYujc+vGwlnZdfG7c9MtI3+M8P92Oyh2Mk + +xfQsADTlk2Gqux6gRLAeKjafdXG + gVsdZvWkc9+tvKE9cGRv8Gm2d7ephTdSDwKRX1m7I8Q52U87MCrBWPfWEZAhm/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+U5QOUYSvYpMPop20QDUNje7 + +SIDcHG3xp9Vx78gI7HOqmeBzFla49wXJxF + ffK86OmEV14= + + + + + + + + 97000.0 + 7000.0 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +/* + * @summary Test XSLT shall report TransformerException for unsafe xsl when FEATURE_SECURE_PROCESSING is true. + */ +public class SecureProcessingTest { + static boolean _isSecureMode = false; + static { + if (System.getSecurityManager() != null) { + _isSecureMode = true; + System.out.println("Security Manager is present"); + } else { + System.out.println("Security Manager is NOT present"); + } + } + + + + @Test + public final void testSecureProcessing() { + + // SECURE_PROCESSING == false + + // the style sheet + InputStream xslStream = this.getClass().getResourceAsStream("SecureProcessingTest.xsl"); + StreamSource xslSource = new StreamSource(xslStream); + + // the xml source + InputStream xmlStream = this.getClass().getResourceAsStream("SecureProcessingTest.xml"); + StreamSource xmlSource = new StreamSource(xmlStream); + + // the xml result + StringWriter xmlResultString = new StringWriter(); + StreamResult xmlResultStream = new StreamResult(xmlResultString); + + // the transformer + TransformerFactory transformerFactory = null; + Transformer transformer = null; + + // transform with a non-secure Transformer + // expect success + String xmlResult; + if (!_isSecureMode) { // jaxp secure feature can not be turned off when + // security manager is present + try { + transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false); + transformer = transformerFactory.newTransformer(xslSource); + transformer.transform(xmlSource, xmlResultStream); + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + Assert.fail(ex.toString()); + } catch (TransformerException ex) { + ex.printStackTrace(); + Assert.fail(ex.toString()); + } + + // expected success + // and the result is ... + xmlResult = xmlResultString.toString(); + System.out.println("Transformation result (SECURE_PROCESSING == false) = \"" + xmlResult + "\""); + } + + // now do same transformation but with SECURE_PROCESSING == true + // expect Exception + boolean exceptionCaught = false; + + // the style sheet + xslStream = this.getClass().getResourceAsStream("SecureProcessingTest.xsl"); + xslSource = new StreamSource(xslStream); + + // the xml source + xmlStream = this.getClass().getResourceAsStream("SecureProcessingTest.xml"); + xmlSource = new StreamSource(xmlStream); + + // the xml result + xmlResultString = new StringWriter(); + xmlResultStream = new StreamResult(xmlResultString); + + // the transformer + transformerFactory = null; + transformer = null; + + // transform with a secure Transformer + try { + transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + transformer = transformerFactory.newTransformer(xslSource); + transformer.transform(xmlSource, xmlResultStream); + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + Assert.fail(ex.toString()); + } catch (TransformerException ex) { + // expected failure + System.out.println("expected failure: " + ex.toString()); + ex.printStackTrace(System.out); + exceptionCaught = true; + } + + // unexpected success? + if (!exceptionCaught) { + // and the result is ... + xmlResult = xmlResultString.toString(); + System.err.println("Transformation result (SECURE_PROCESSING == true) = \"" + xmlResult + "\""); + Assert.fail("SECURITY_PROCESSING == true, expected failure but got result: \"" + xmlResult + "\""); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,15 @@ + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.File; +import java.io.StringWriter; + +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test Sources. + */ +public class SourceTest { + + @Test + public final void testDOMSource() { + String xml = getClass().getResource("SourceTest.xml").getFile(); + xml = "file://" + xml; + File xsl = new File(getClass().getResource("SourceTest.xsl").getFile()); + try { + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(); + StreamSource source = new StreamSource(xsl); + transformer = tFactory.newTransformer(source); + // the xml result + StringWriter xmlResultString = new StringWriter(); + StreamResult xmlResultStream = new StreamResult(xmlResultString); + + Source xmlSource = new DOMSource(); + xmlSource.setSystemId(xml); + + transformer.transform(xmlSource, xmlResultStream); + System.out.println(xmlResultString.toString()); + String temp = xmlResultString.toString(); + int pos = temp.lastIndexOf("count"); + if (temp.substring(pos + 8, pos + 9).equals("1")) { + Assert.fail("count=1"); + } else if (temp.substring(pos + 8, pos + 9).equals("2")) { + // expected success + System.out.println("count=2"); + } + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + @Test + public final void testSAXSource() { + String xml = getClass().getResource("SourceTest.xml").getFile(); + File xsl = new File(getClass().getResource("SourceTest.xsl").getFile()); + try { + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(); + StreamSource source = new StreamSource(xsl); + transformer = tFactory.newTransformer(source); + // the xml result + StringWriter xmlResultString = new StringWriter(); + StreamResult xmlResultStream = new StreamResult(xmlResultString); + + Source xmlSource = new SAXSource(); + xmlSource.setSystemId(xml); + + transformer.transform(xmlSource, xmlResultStream); + System.out.println(xmlResultString.toString()); + String temp = xmlResultString.toString(); + int pos = temp.lastIndexOf("count"); + if (temp.substring(pos + 8, pos + 9).equals("1")) { + Assert.fail("count=1"); + } else if (temp.substring(pos + 8, pos + 9).equals("2")) { + // expected success + System.out.println("count=2"); + } + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } + + @Test + public final void testStreamSource() { + String xml = getClass().getResource("SourceTest.xml").getFile(); + File xsl = new File(getClass().getResource("SourceTest.xsl").getFile()); + try { + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(); + StreamSource source = new StreamSource(xsl); + transformer = tFactory.newTransformer(source); + // the xml result + StringWriter xmlResultString = new StringWriter(); + StreamResult xmlResultStream = new StreamResult(xmlResultString); + + Source xmlSource = new StreamSource(); + xmlSource.setSystemId(xml); + + transformer.transform(xmlSource, xmlResultStream); + System.out.println(xmlResultString.toString()); + String temp = xmlResultString.toString(); + int pos = temp.lastIndexOf("count"); + if (temp.substring(pos + 8, pos + 9).equals("1")) { + Assert.fail("count=1"); + } else if (temp.substring(pos + 8, pos + 9).equals("2")) { + // expected success + System.out.println("count=2"); + } + } catch (Exception e) { + // unexpected failure + e.printStackTrace(); + Assert.fail(e.toString()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,21 @@ + + + + + + E3 + + + + + + + + + E3 + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,52 @@ + + + + + + + + + Working (by replacing the count() argument with a variable): + + + + + Node ; + + count = + + --------- + + + Not working in the 2nd loop iteration (by using the union expression as count() argument): + + + + + + + Node ; + + + count = + + --------- + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/StAXSourceTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/StAXSourceTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.StringReader; +import java.io.StringWriter; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLEventWriter; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.stax.StAXResult; +import javax.xml.transform.stax.StAXSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test parsing from StAXSource. + */ +public class StAXSourceTest { + + @Test + public final void testStAXSource() throws XMLStreamException { + XMLInputFactory ifactory = XMLInputFactory.newInstance(); + XMLOutputFactory ofactory = XMLOutputFactory.newInstance(); + + String xslStylesheet = "" + + " " + " " + " " + + " " + " " + + " " + " " + " " + ""; + StringReader xslStringReader = new StringReader(xslStylesheet); + StringReader xmlStringReader = new StringReader(xslStylesheet); // identity + // on + // itself, + StringWriter xmlStringWriter = new StringWriter(); + + XMLEventReader styleReader = ifactory.createXMLEventReader(xslStringReader); + XMLEventReader docReader = ifactory.createXMLEventReader(xmlStringReader); + XMLEventWriter writer = ofactory.createXMLEventWriter(xmlStringWriter); + + StAXSource stylesheet = new StAXSource(styleReader); + StAXSource document = new StAXSource(docReader); + StAXResult result = new StAXResult(writer); + + try { + document.setSystemId("sourceSystemId"); + } catch (UnsupportedOperationException e) { + System.out.println("Expected UnsupportedOperationException in StAXSource.setSystemId()"); + } catch (Exception e) { + Assert.fail("StAXSource.setSystemId() does not throw java.lang.UnsupportedOperationException"); + } + + TransformerFactory tfactory = TransformerFactory.newInstance(); + try { + Transformer transformer = tfactory.newTransformer(stylesheet); + transformer.transform(document, result); + } catch (TransformerConfigurationException tce) { + throw new XMLStreamException(tce); + } catch (TransformerException te) { + throw new XMLStreamException(te); + } finally { + styleReader.close(); + docReader.close(); + writer.close(); + } + + try { + result.setSystemId("systemId"); + } catch (UnsupportedOperationException e) { + System.out.println("Expected UnsupportedOperationException in StAXResult.setSystemId()"); + } catch (Exception e) { + Assert.fail("StAXResult.setSystemId() does not throw java.lang.UnsupportedOperationException"); + } + + if (result.getSystemId() != null) { + Assert.fail("StAXResult.getSystemId() does not return null"); + } + } + + @Test + public final void testStAXSource2() throws XMLStreamException { + XMLInputFactory ifactory = XMLInputFactory.newInstance(); + ifactory.setProperty("javax.xml.stream.supportDTD", Boolean.TRUE); + + StAXSource ss = new StAXSource(ifactory.createXMLStreamReader(getClass().getResource("5368141.xml").toString(), + getClass().getResourceAsStream("5368141.xml"))); + DOMResult dr = new DOMResult(); + + TransformerFactory tfactory = TransformerFactory.newInstance(); + try { + Transformer transformer = tfactory.newTransformer(); + transformer.transform(ss, dr); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerFactoryTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerFactoryTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.IOException; +import java.io.InputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stax.StAXResult; +import javax.xml.transform.stax.StAXSource; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +/* + * @summary Test TransformerFactory. + */ +public class TransformerFactoryTest { + + private static URIResolver resolver = new URIResolver() { + + private int n = 0; + + public Source resolve(String href, String base) throws TransformerException { + + System.out.println("resolving: " + href); + + if (n++ > 10) { + Assert.fail("Nesting too deep when resolving: " + href); + } + + return new StreamSource(this.getClass().getResourceAsStream(href)); + } + }; + + private static Document load(InputStream in) throws IOException { + + Document document = null; + + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder db = dbf.newDocumentBuilder(); + document = db.parse(in); + } catch (ParserConfigurationException parserConfigurationException) { + parserConfigurationException.printStackTrace(); + Assert.fail(parserConfigurationException.toString()); + } catch (SAXException saxException) { + saxException.printStackTrace(); + Assert.fail(saxException.toString()); + } + + return document; + } + + /** + *

    + * Test stylesheets that import other stylesheets. + *

    + * + *

    + * Inspired by: CR 6236727-2125981 XSLTC never stops resolving imported + * stylesheets when outer stylesheet is a DOMSource + *

    + */ + @Test + public final void testImport() { + + TransformerFactory tff = TransformerFactory.newInstance(); + tff.setURIResolver(resolver); + Templates tt = null; + Transformer tf = null; + + // work-a-round is to use a StreamSource. + // test should complete + System.out.println("StreamSource: pre-Transformer creation"); + System.out.flush(); // in case import hangs + try { + InputStream xin = this.getClass().getResourceAsStream("outer.xsl"); + tt = tff.newTemplates(new StreamSource(xin)); + tf = tt.newTransformer(); + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + Assert.fail(ex.toString()); + } + System.out.println("StreamSource: post-Transformer creation"); + + // CR is that DOMSource never stops resolving + System.out.println("DOMSource: pre-Transformer creation"); + System.out.flush(); // in case import hangs + try { + InputStream xin = this.getClass().getResourceAsStream("outer.xsl"); + tt = tff.newTemplates(new DOMSource(load(xin))); + tf = tt.newTransformer(); + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + Assert.fail(ex.toString()); + } catch (IOException ioException) { + ioException.printStackTrace(); + Assert.fail(ioException.toString()); + } + System.out.println("DOMSource: post-Transformer creation"); + } + + /** + * Refer to 6631168 : StAXSource & StAXResult support in JavaSE6 + */ + @Test + public final void testFeatures() { + TransformerFactory tff = TransformerFactory.newInstance(); + Assert.assertTrue(tff.getFeature(StAXSource.FEATURE)); + Assert.assertTrue(tff.getFeature(StAXResult.FEATURE)); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.io.StringWriter; + +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.AssertJUnit; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.ContentHandler; +import org.xml.sax.DTDHandler; +import org.xml.sax.EntityResolver; +import org.xml.sax.ErrorHandler; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.AttributesImpl; + +/* + * @summary Test Transformer. + */ +public class TransformerTest { + + private static final String LINE_SEPARATOR = System.getProperty("line.separator"); + + private static final String XML_DOCUMENT = "" + ""; + + //Test for JDK-6305029 + @Test + public final void testTransform() throws TransformerException { + + // test SAXSource + SAXSource saxSource = new SAXSource(new MyXMLReader(), new InputSource()); + + StringWriter builder = new StringWriter(); + TransformerFactory.newInstance().newTransformer().transform(saxSource, new StreamResult(builder)); + + AssertJUnit.assertEquals("Identity transform of SAXSource", XML_DOCUMENT, builder.toString()); + + // test StreamSource + StreamSource streamSource = new StreamSource(new StringReader(XML_DOCUMENT)); + + StringWriter streamResult = new StringWriter(); + + TransformerFactory.newInstance().newTransformer().transform(streamSource, new StreamResult(streamResult)); + + AssertJUnit.assertEquals("Identity transform of StreamSource", XML_DOCUMENT, streamResult.toString()); + } + + private static class MyXMLReader implements XMLReader { + + private static final String NAMESPACES = "http://xml.org/sax/features/namespaces"; + + private static final String NAMESPACE_PREFIXES = "http://xml.org/sax/features/namespace-prefixes"; + + private boolean namespaces = true; + + private boolean namespacePrefixes = false; + + private EntityResolver resolver; + + private DTDHandler dtdHandler; + + private ContentHandler contentHandler; + + private ErrorHandler errorHandler; + + public boolean getFeature(final String name) throws SAXNotRecognizedException, SAXNotSupportedException { + + if (name.equals(NAMESPACES)) { + return namespaces; + } else if (name.equals(NAMESPACE_PREFIXES)) { + return namespacePrefixes; + } else { + throw new SAXNotRecognizedException(); + } + } + + public void setFeature(final String name, final boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { + + if (name.equals(NAMESPACES)) { + namespaces = value; + } else if (name.equals(NAMESPACE_PREFIXES)) { + namespacePrefixes = value; + } else { + throw new SAXNotRecognizedException(); + } + } + + public Object getProperty(final String name) throws SAXNotRecognizedException, SAXNotSupportedException { + return null; + } + + public void setProperty(final String name, final Object value) throws SAXNotRecognizedException, SAXNotSupportedException { + } + + public void setEntityResolver(final EntityResolver theResolver) { + this.resolver = theResolver; + } + + public EntityResolver getEntityResolver() { + return resolver; + } + + public void setDTDHandler(final DTDHandler theHandler) { + dtdHandler = theHandler; + } + + public DTDHandler getDTDHandler() { + return dtdHandler; + } + + public void setContentHandler(final ContentHandler handler) { + contentHandler = handler; + } + + public ContentHandler getContentHandler() { + return contentHandler; + } + + public void setErrorHandler(final ErrorHandler handler) { + errorHandler = handler; + } + + public ErrorHandler getErrorHandler() { + return errorHandler; + } + + public void parse(final InputSource input) throws IOException, SAXException { + + parse(); + } + + public void parse(final String systemId) throws IOException, SAXException { + + parse(); + } + + private void parse() throws SAXException { + contentHandler.startDocument(); + contentHandler.startPrefixMapping("prefix", "namespaceUri"); + + AttributesImpl atts = new AttributesImpl(); + if (namespacePrefixes) { + atts.addAttribute("", "xmlns:prefix", "xmlns:prefix", "CDATA", "namespaceUri"); + } + + contentHandler.startElement("namespaceUri", "localName", namespacePrefixes ? "prefix:localName" : "", atts); + contentHandler.endElement("namespaceUri", "localName", namespacePrefixes ? "prefix:localName" : ""); + contentHandler.endPrefixMapping("prefix"); + contentHandler.endDocument(); + } + } + + @Test + public final void testCR6272879() { + + final String xsl = "" + LINE_SEPARATOR + + "" + LINE_SEPARATOR + + "" + LINE_SEPARATOR + "" + LINE_SEPARATOR + + "" + LINE_SEPARATOR + " " + LINE_SEPARATOR + + " " + LINE_SEPARATOR + " " + LINE_SEPARATOR + + " " + LINE_SEPARATOR + " " + LINE_SEPARATOR + + " " + LINE_SEPARATOR + " " + LINE_SEPARATOR + " " + + LINE_SEPARATOR + " " + LINE_SEPARATOR + " " + LINE_SEPARATOR + "" + LINE_SEPARATOR + + "" + LINE_SEPARATOR + ""; + + final String sourceXml = "" + + LINE_SEPARATOR + // "" + LINE_SEPARATOR + + // "" + LINE_SEPARATOR + + // "" + LINE_SEPARATOR + + // "]>" + + // LINE_SEPARATOR + + + "" + LINE_SEPARATOR + " " + LINE_SEPARATOR + " Valeur 1" + LINE_SEPARATOR + + " " + LINE_SEPARATOR + " " + LINE_SEPARATOR + " Valeur 2" + LINE_SEPARATOR + + " " + LINE_SEPARATOR + ""; + + Document document; + Node node; + + System.out.println("Stylesheet:"); + System.out.println("=================================="); + System.out.println(xsl); + System.out.println(); + + System.out.println("Source file before transformation:"); + System.out.println("=================================="); + System.out.println(sourceXml); + System.out.println(); + + System.out.println("Source file after transformation:"); + System.out.println("================================="); + document = getTransformation(xsl, sourceXml); + + System.out.println(document); + + System.out.println("Node content for element valeur2:"); + System.out.println("================================="); + NodeList nodes = document.getElementsByTagName("valeur2"); + nodes = document.getElementsByTagName("valeur2"); + for (int i = 0; i < nodes.getLength(); i++) { + node = nodes.item(i); + System.out.println(" Node value: " + node.getFirstChild().getNodeValue()); + System.out.println(" Node attribute: " + node.getAttributes().item(0).getNodeValue()); + + AssertJUnit.assertEquals("Node value mismatch", "Valeur " + (i + 1), node.getFirstChild().getNodeValue()); + AssertJUnit.assertEquals("Node attribute mismatch", "Attribut " + (i + 1), node.getAttributes().item(0).getNodeValue()); + } + } + + private static Document getTransformation(final String xsl, final String sourceXml) { + + Transformer transformer; + DOMResult reponse; + Document document = null; + + try { + InputStream in = new ByteArrayInputStream(xsl.getBytes()); + transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(in)); + + reponse = new DOMResult(); + transformer.transform(new StreamSource(new ByteArrayInputStream(sourceXml.getBytes())), reponse); + document = (Document) reponse.getNode(); + } catch (Exception e) { + String msg = "Exception in getTransformation: " + e; + System.err.println(msg); + Assert.fail(msg); + } + + return (document); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerUtilFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerUtilFactory.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import javax.xml.transform.util.DOMUtil; +import javax.xml.transform.util.SAXUtil; +import javax.xml.transform.util.StAXUtil; +import javax.xml.transform.util.StreamUtil; +import javax.xml.transform.util.TransformerUtil; + +public class TransformerUtilFactory { + + public final static String DOM = "dom"; + + public final static String SAX = "sax"; + + public final static String StAX = "stax"; + + public final static String STREAM = "stream"; + + /** Creates a new instance of TransformerUtilFactory */ + private TransformerUtilFactory() { + } + + public static TransformerUtil getUtil(String type) throws Exception { + if (type.equals(DOM)) { + return DOMUtil.getInstance(); + } else if (type.equals(STREAM)) + return StreamUtil.getInstance(); + else if (type.equals(SAX)) + return SAXUtil.getInstance(); + else if (type.equals(StAX)) + return StAXUtil.getInstance(); + else + return null; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/VersionDefaultHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/VersionDefaultHandler.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +public class VersionDefaultHandler extends DefaultHandler { + + private String version = null; + + private String encoding = null; + + /** Creates a new instance of VersionDefaultHandler */ + public VersionDefaultHandler() { + } + + Locator saxLocator = null; + + public void setDocumentLocator(Locator locator) { + saxLocator = locator; + } + + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { + version = ((org.xml.sax.ext.Locator2) saxLocator).getXMLVersion(); + encoding = ((org.xml.sax.ext.Locator2) saxLocator).getEncoding(); + } + + public void error(SAXParseException e) throws SAXException { + e.printStackTrace(); + } + + public String getVersion() { + return version; + } + + public String getEncoding() { + return encoding; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/VersionEventWriter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/VersionEventWriter.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform; + +import javax.xml.namespace.NamespaceContext; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLEventWriter; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.StartDocument; +import javax.xml.stream.events.XMLEvent; + +public class VersionEventWriter implements XMLEventWriter { + + private String version = null; + + private String encoding = null; + + /** Creates a new instance of VersionEventWriter */ + public VersionEventWriter() { + } + + public void add(XMLEvent event) throws XMLStreamException { + if (event.getEventType() == XMLStreamConstants.START_DOCUMENT) { + version = ((StartDocument) event).getVersion(); + encoding = ((StartDocument) event).getCharacterEncodingScheme(); + } + } + + public void flush() throws XMLStreamException { + } + + public void close() throws XMLStreamException { + } + + public void add(XMLEventReader reader) throws XMLStreamException { + } + + public java.lang.String getPrefix(java.lang.String uri) throws XMLStreamException { + return null; + } + + public void setPrefix(java.lang.String prefix, java.lang.String uri) throws XMLStreamException { + } + + public void setDefaultNamespace(java.lang.String uri) throws XMLStreamException { + } + + public void setNamespaceContext(NamespaceContext context) throws XMLStreamException { + } + + public NamespaceContext getNamespaceContext() { + return null; + } + + public String getVersion() { + return version; + } + + public String getEncoding() { + return encoding; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/ViewEditor1.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/ViewEditor1.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,50 @@ + + + + + + 21 + + + + + + + + + + + + + + + + + + + + + + + PieChart + ThreeDPieChart + + + + + datasets + + + + + + chartFields + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/attribset27.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/attribset27.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,4 @@ + + + a + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/attribset27.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/attribset27.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + none + + + + + + underline + + + + black + + + + 14pt + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + +<_test01><_test-04>T%e!s#t$
    1000509.90.0860833333333333345134545.22916666666667114.44-16.886.70A1Vn

    2000503.80.08438888888888889-003011-0.503055555555555698.33-61.146.29gG9

    3Psc33 Psc000520.10.08891666666666666-054227-5.707500000000000593.75-65.934.61K0IIIbCN-0.5

    4Peg86 Peg000542.00.09513234613.39611111111111106.19-47.985.51G5III

    5000616.00.1044444444444444558261258.43666666666666117.03-03.925.96G5V

    6000619.00.10527777777777779-490430-49.075321.61-66.385.70G1IV

    7Cas10 Cas000626.50.1073611111111111264114664.19611111111111118.061.755.59B9III

    8000636.80.1102222222222222229011729.02138888888889111.26-32.836.13K0V

    9000650.10.11391666666666667-230627-23.107552.21-79.146.18A7V

    10000718.20.12172222222222222-172311-17.38638888888888874.36-75.906.19A6Vn
    diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog_10.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog_10.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + +<_test01><_test-04>T%e!s#t$
    1000509.90.0860833333333333345134545.22916666666667114.44-16.886.70A1Vn

    2000503.80.08438888888888889-003011-0.503055555555555698.33-61.146.29gG9

    3Psc33 Psc000520.10.08891666666666666-054227-5.707500000000000593.75-65.934.61K0IIIbCN-0.5

    4Peg86 Peg000542.00.09513234613.39611111111111106.19-47.985.51G5III

    5000616.00.1044444444444444558261258.43666666666666117.03-03.925.96G5V

    6000619.00.10527777777777779-490430-49.075321.61-66.385.70G1IV

    7Cas10 Cas000626.50.1073611111111111264114664.19611111111111118.061.755.59B9III

    8000636.80.1102222222222222229011729.02138888888889111.26-32.836.13K0V

    9000650.10.11391666666666667-230627-23.107552.21-79.146.18A7V

    10000718.20.12172222222222222-172311-17.38638888888888874.36-75.906.19A6Vn
    diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/config.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/config.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/config.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/config.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,4 @@ + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/default-layout.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/default-layout.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + + <xsl:value-of select="$layout.page.title"/> + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/global-variables.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/global-variables.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/global.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/global.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,272 @@ + + + + + + + + + + +
    + + + + + + +
      + +
    • +
      +
    +
    +
    +
    +
    + + + + + http + + s + + :// + + + : + + + + + + + + + + + + + + /album.do?key= + + + + + + + + + + + + + + + + /media.do?id= + + + &albumKey= + + + + + &original=true + + + &size= + + + &quality= + + + + + + &download=true + + + + + + + + + + + /album.do?key= + + + &itemId= + + + + + + + + + + + MB + + + + KB + + + + bytes + + + + + + + + + + + + + + + /downloadAlbum.do?albumKey= + + + + &original=true + + + + &size= + + + + &quality= + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/home.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/home.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,514 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SUB NAV + + + + + + + + + + sub nav data: collection = [ + + ]; album = [ + + ] + + + + +
    + + Tab + +
    +

    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    +
    +
    + + +
    +
    This is here to "clear" the floats.
    +
    +
    +

    +
      + + + There are no collections. + +
    +

    +
      + + + There are no albums. + +
    +
    + + + +
    + main-pane content here +
    + + + + + + + +
    + +
    +

    + +

    +
    +
    +
    + + +
    +
    +
    + + +
    +
    This is here to "clear" the floats.
    +
    + + +
    +

    + +

    +
    +
    +
    + + +
    +
    +
    + + +
    +
    This is here to "clear" the floats.
    +
    + + +
    +

    + +

    +
    + + +
    +
    This is here to "clear" the floats.
    +
    + + +
    +

    + +

    +
    + + +
    +
    This is here to "clear" the floats.
    +
    + + +
    +

    + +

    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +
    +
    + + +
    +
    This is here to "clear" the floats.
    +
    + +
    + +
    + +
    + +
    + + + +
  • + + selected + + + + + +
  • + +
    + + + +
  • + + selected + + + + +
  • +
    + + + + + {@name} + + +
    diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/in.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/in.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ +Data Objects +Fields +bam_as_viewedit_doselect diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/inner.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/inner.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,1 @@ + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/logon.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/logon.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,70 @@ + + + + + + + + + + + + no-sub-nav + + + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + +
    diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/maps.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/maps.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + + map1key1value + map1key2value + + map2key1value + map2key2value + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/msgAttach.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/msgAttach.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ + +<?xml version="1.0" encoding="UTF-8"?><cabecMsg xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.09"><versaoDados>1.03</versaoDados></cabecMsg><enviNFe xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.09"><idLote>200602220000001</idLote><NFe><infNFe Id="NFe28070413349550000324550010000109000000110809" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110809"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>zYASgizMNBAzgn+ot4ejStxDPTA=</DigestValue></Reference></SignedInfo><SignatureValue>WnrapbX3Ewvi10agoVw2ZXl2drRxQdEbe3AHEXwIcr3LbDKGsMhqQusQGgifJkEbLL+IKC2kE9BE/HVFLxhFN9zj7zasTo6voeRApftKmibfASYcLSMTMkRcE97qU7BKQveBb0rYtKoumF020DUofx4TQlq0XhXHwQRSMfjU+PI=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRF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KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110801" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110801"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>eDf91anljJDYxbEccusEuMITI6w=</DigestValue></Reference></SignedInfo><SignatureValue>1l8xkXfjmhtrkFMXXHxyS2FQ7jM1hBIeqAxk/zVVgaAhAUvOnyqvt6EnIkbkqo+4uRyASFjhr5oFUHz5ryj9oSz+wW2Si95QIXUciWvDSAw2vbWaeusHI4fpJYqjyhUlXAelmQtgl9lkBaXhWrHkyLxTYZuUS0VHyu3SoqlY8L4=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110802" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110802"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>KgIkUWcNbSYo+9i4n1Wib3gggRI=</DigestValue></Reference></SignedInfo><SignatureValue>BrV4+H1tm4SN9sjNT2ICKOfNsVGeMAsQilsuqIwflhGJxUVxaCEn8DJ7XaUQkh+Bw1HVd4nyR6XZHVJBtUssK2rN2B24boptcBbBlEs5Q91Guq3lSmWp8lORAf5UTVUuftsrllTmmjsSSgWVB5xog+lQI5/ULX8s+xI05OgFkDE=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110803" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110803"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><D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rBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110804" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110804"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>Omf325HzAlgBnP9MoAA2Gbf4vbo=</DigestValue></Reference></SignedInfo><SignatureValue>vzjdVi3qU160PgIsCX9Qq07JVy98gwmtFZud6Unkn9uozWVgXGm9V2V3NJ67ke7pkcYZonXHrOTmOGTpuoaW0ZiQ55Mo50zlDS5TCBWn26stI12ecYwrqpgDENpoCKBRa5ZCa7GMaWZZyEgAYYQ8YeI9BtMqaKJn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A1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110805" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110805"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>ctmsHHDqE+E+UssdsL4jajRQVWk=</DigestValue></Reference></SignedInfo><SignatureValue>nCoM230bM4Befsnpl3w5/G0ocn1MVkGoqIMIFkcijK7QzBY7n3tK2B9tr9dFv1mN+y/WFZ6+66tKYefaioSNiI0QLVIXfrdYMtZ4+Ewe1N/1xHKlGqujglkmNRF17KH106lBxOltsuxZd5AsyxZ+nF37GIjWzpY/0jOJD4c+OO8=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJN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4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110806" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110806"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>UVJeRp5XuzdojbAnEjuohV8NFO8=</DigestValue></Reference></SignedInfo><SignatureValue>5Zm+uGuO/xHT/CwgUIWobkM+JaAaYCym4/Kr4goBugykbLXyxXpHAvO4bYN050usn5kMGfELISipAVoaHXvrZ67FgaHkcKGHkymHGS+f8wLLL5TsNVRtZomdJjEy3GVQic8xpU4HUYrgOGktWpOnblaVzir0lZPeuRdkLbRe2y8=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110807" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110807"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>U+jxoc1fo7d4WXa0CrvP1YBQwgA=</DigestValue></Reference></SignedInfo><SignatureValue>QAYBZN3c09rcoVij+fkp4lahEAD5cZV3zjdqvNEE2lzTbzqonHgdT5GyO9VRCikUNm0f3gAbwjyQnSmvTqw4YfVCf6ZYlFBAZ+pOkGdVsOkJ4QArZiU1+hSnLo5iN3WW7b5E7vw0EMv55nGW1zF0ghajClPBsQ+nbUSyYZ09ujk=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110808" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110808"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>rNWb1uYrH9oj+IaQzAQgBgoN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WBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110810" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110810"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>g3nEVfyjf0bEYF0+TFE+f8I0Ekg=</DigestValue></Reference></SignedInfo><SignatureValue>VnwKnzSdKtp2i8rqNAFNc5NPrh1YWRTy4xvlSkcCdxHX0RAwlQ1mFL0wFUVOjNvt3KUVn9d4X5x76yjFbnXDPkcOrf/mpFl5JMhy2oruovcC0MtWrnvguSM/Ujyyl2p4MPLT1lzcUHAFPijh4MPOX694EX+KXxMW8jz9UqpXfn0=</SignatureValue><KeyIn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6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110811" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110811"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>nhhsoA1RmioP/vXoARwWijDfkAg=</DigestValue></Reference></SignedInfo><SignatureValue>SNh8Aa27uDRSZRe7nhkEa6ZTVfJV3ljwUSlwikYTMiEMk+B6/62IQqIyfVhfSN1Lx1grYgUfrzoNRanYZWQEUcIk07ENQcIS5KgY9ydSSuuOFVuiRsk/6INm1gjR4XCq4F/tWAdenasZCtZ0DPRNH5la4GSuKevNfoLOGbKgC00=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0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Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110812" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110812"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>DFhT+RWH4lqQbbUvFNAXv/GseL0=</DigestValue></Reference></SignedInfo><SignatureValue>250R3TBs7J3uMUiLMywVtlIqn9PpB9Z9vH2vRQtcalB/Jx6bZbhYgRX6GhfVH7wrGfmtfU694g5sKm3447afm74mGV/5rvUlmECOnozuKv+SvXRK0wFvogaaXo5qCYlAqh9rOCa3W4RfVbq9TWfGevyKA7e0uKsjPctcKR/L4xg=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110813" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110813"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>Al5DzbSR6cps7LzToU+cyzc51GY=</DigestValue></Reference></SignedInfo><SignatureValue>bGf13rBYoifk5Z2e97D/TiS8oy7qjB+TAfd0ECwgtn0VlWI0z8V9QQWaShjHI6sV5EVJEZlx3s/3HeFPFRiv12d5466EuzI5ftJpZNqAOS+CMkFeRFVGazaIcRY2ncw7wKNsaEmfEn+cnIAgfmXozI34q41R+bG6a/sPcLVJf3k=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110814" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110814"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>0VdDjtU1ZtFc2w5EQU9FWV276ao=</DigestValue></Reference></SignedInfo><SignatureValue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AwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110815" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110815"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>P+vIva8ejzq9bYhM1xL46vbdbEE=</DigestValue></Reference></SignedInfo><SignatureValue>tod/k9ZRlFEMakj89FM12YkHFvBJ2m4wDJwq9bPe6X3CKbv1mYIUAXTkasJL1BF5aJa/z+V0pvK2xTSOznvF1Y5H+TpdaToiZtMeFCbRF+nTqW+cudA3KsgSCjQs2U2kid4BWUNID9hCQHSCUoHsoVbsXDeD0Lbu6r/B0IB8FDU=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwI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BQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110816" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110816"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>llPDkiDAQfwf0brph3hhqCNXliI=</DigestValue></Reference></SignedInfo><SignatureValue>uFDUFef+q2r65uDmR8hS2DR+PAxVBtifJrOdVGmrdA0zQojPYziTlR0kZN/JIkBUkPklz9ejKoxx+XjVhZhu3OgI1ceHya0smOJEMDLfIJ0vHO7WmkunNl0/SBeR4yEGtjm7UxQ55/ZEHU0N/+cDn3iyzOB9t4wabUn5txA9JiA=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5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28070413349550000324550010000109000000110817" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110817"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>qjS8ay1R+Kl2cRxAcxet6HZdt4M=</DigestValue></Reference></SignedInfo><SignatureValue>HoafBrpcYfLjXnH9GHUoZIuxjIhrpLyQeiM3KQMaWx6uyS7c2oXPtVs80L49S7i1CMma+RAywTiGf79RzI95mBy/Vlk4wa51m5h6qizT8NZMP3Pa2ern9+mDhDV7kNgvNl7JDi7hCPvACpGZy54TuzXs2luH5O8iUVYR+g2jD7Y=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110818" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110818"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>xgoWPViXwimNipoyKVr8h/69A7I=</DigestValue></Reference></SignedInfo><SignatureValue>bvGpF6fK/R2srzaaqG3XVDFxkvcvZ97MxAT4CBoezfiQywHPjXaEzmUXF/LMGjfbV1UEjFdoE+ZlPRU1F6Y3IreJvfQNLvXoGlnKASSHIZYWq/HCuv2q5DlUfw916LjUgygRbuPLaF8YJdqS+HxYsWJFxQu9ZChtb+rWYjCiCkw=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110819" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110819"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>YTY3upEgZtcegklKapx3PmBt1eI=</DigestValue></Reference></SignedInfo><SignatureValue>Nma+uO1zfJMPDGNgg2tRR43CQJCal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BAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110820" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110820"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>hZA9ZbAfkJ1gGw/5zgVaFfXmuz4=</DigestValue></Reference></SignedInfo><SignatureValue>WUC6gHMQLuJa73yxDSuSzxVqds5ZBjl5OqtzOTLEEp83mKZwkako1zIhF59D2JXh5TnhwulWv7xqDzf3CxELf/rhftYIh108zFR7DDKMim2ofDcJ0ibWwBYYduVydpLQ37nGb0Cs8E8hVf5FDSamauvJhrXfC2jLfPQk1OCOmLc=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswC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awYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110821" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110821"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>mcwN77/JOXRmUj3Un5rnQukgOCk=</DigestValue></Reference></SignedInfo><SignatureValue>fDXHeIDC4hz/dpsT66Mi1aPryUrpuCISosHapZ7VKsvjeC+y4jFAXEXR5+9OuJr1SPzhKyhwbr8do3K6spTKYkOOZFZ4Ujk9xhGIXabtK/WLt6FuIuk98xXZVOtzwU3IyYeObkaJg1SzAKwq0qIW4rkfmn/4uJfayXNXaseJnhc=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110822" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110822"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>1a2RQgN0sJrLDRPQHR59US0EYT0=</DigestValue></Reference></SignedInfo><SignatureValue>jcNqHv8KDQKkcbov9Ffsix5qssBSMdx1kuM2AO3YjbjNOoJgSb+GmMy/j/iVnANeVDNLM4vjapHrPxCEFIG4E1ZuA7hId7JFajNDN1oXa32TtBfThJ27Rw35NJUcWI+YA+8JDnPa2qQCdxUWkiXvwyJ21zQzIZsw5UdvuQUqxm4=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110823" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110823"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>XmVTTTXirQvExYZ4yHj2Bz0bw/c=</DigestValue></Reference></SignedInfo><SignatureValue>1RNe6RLJyXBr3/lGcqLipxwcUvUIYznpp8cwEsIPMhVnVK+250ZGyy3ap2NvgnLDvXlmQOVUu6xUthwF8ll58dspBFIfHAqoww/KojAg+6V3Wwm+DwVc7222KbJ6eu451iqI68cUaRYQiciPTa2Y9DfDtxoprKBN488/PkOYyhY=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110824" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110824"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>YauB6rHbqykRGk5K/ESVswxJpvs=</DigestValue></Reference></SignedInfo><SignatureValue>iBHHYQzntaGIOO62UUQ/p2svvoR8XjDoO8es7vyJ35PmrFWtocWdM9FEUW1V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hCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110825" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110825"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>sBG0b72pNgwjtyk2sCcr2SOPgyo=</DigestValue></Reference></SignedInfo><SignatureValue>EMAWKqa79y8wFYN1TProwZcZO20OCPU6rSm41Z+QN5QdT1DcU823Lu+aNfPv70SY9ra5/6kOO1uE4My5UXsyawjPDY5EZV8di9Goyebg27DgDLWcpvwZfrBUOwGo3Q9x/VpWI5qY9OHaWpwxttIIuo2PbZl4k3+VVAkeCdeo7Q0=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0l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SgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110826" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110826"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>gDyFrITIpGqBPPeUls+UoQ1eFFw=</DigestValue></Reference></SignedInfo><SignatureValue>p3lSbnCBYnKbz6rpghVwsRzjIleu8R4dlvexNH+lxtYMPMSEll1C6qMHFo393SpKJu0Yufb7NRfDBhQFBYWwHJ5/GDchagr79ihn0hVRo58wDIbWwpHPqP5QlyGttdUm2BMTXaNsvwzJWycZqkkLwvjRO1M+5CD91pYYAB27u2A=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110827" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110827"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>nq3klXHixnYIhGVm/zzRuGSMwv0=</DigestValue></Reference></SignedInfo><SignatureValue>QPp1qTof2JWZjqlWtMLOW2Hz0XrMqMd+Gp+kKqLZDBGbqQ/YCUKXnGjUiEPoO2Zy96Y98JlLaC7yFWkeslM2wMxmQEQoAFlWp5gdtjmzhFBPpuHYsS8WAz2VJVDlGik02JkXDKG/6sbHrxTQkq9ksp5ijygmRSvlxNBnG7AS9oM=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110828" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110828"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>KxutkHGJ8tvxNtSAy8N4b7sgfOU=</DigestValue></Reference></SignedInfo><SignatureValue>GZ9XS/REkXN97VEYMz1AAPZ4J9Lb08TNhsloCuH8QaTaPqIIuT4dlcQgdBX7oysVc1NXUoSxFKUeej2ZMdD/J2EPxPacM8S3XlbZe5CoHKaxqR3hqPW5ANxzN61ldjDKPz+mY7dmgVttyEYQKdy44rt3lf0TqcdWfBiucZYylAM=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110829" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110829"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>9eOPR0G4en+2xpr+R6nlm83gxVM=</DigestValue></Reference></SignedInfo><SignatureValue>t/Iwe+qlyWyuQpAHWdK//Lm+sRes/6EQb3I3XpFId+Xo4b8bdbcqv+Wlb7oPT5He654Yeg88z1mpHSZdtV5f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CBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110830" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110830"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>PKubq8TelaLWOEu6e2hUS7KlvBA=</DigestValue></Reference></SignedInfo><SignatureValue>jQPSq10OxqJKbEwlQuW+RqQGV5a9iKKuc2+BZ8Qa1S9hQyg/PjtQHQYBR2LARUZIzfocfGb5+8HyGVxijtuIj2KPIH/8QGoqSHC0Ngtl9VCc7YCnOP10DOsasc6FynGZpa+0LOV+zJO119syZY4feIc67Py84fku/GJ8M1spOzg=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJB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Mp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110831" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110831"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>fSUS3zUG0gFM15Rb5Xeuowu5q8Y=</DigestValue></Reference></SignedInfo><SignatureValue>WnN/escY4TTLdqKWdlhl9VCaotMF1lkFjxSx32va5+nFXr/gYY+bZw7tYMPq8q0glhE3i5tG08Ai3zewmIIYGLbraf/2HSogXeYbM9PfoNPwlP2tXMWbvwWqg8sm5JviGS/P7kKcbKxtB35oUk0lCo0m72Kt6vaY3bmYRsv/VNQ=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110832" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110832"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>ShPPZLiE8+w2+TYc4IbHUFAJtew=</DigestValue></Reference></SignedInfo><SignatureValue>rQgO5c6bD+bB3WyRfrCb/96/JkH0bjMARhL0Rh744IdvLX+DL/u8+n/F3bTuM5nMg2MxqiCM5dJVhjfBZ8HlpUn2Ed6gTMRGRufrHEYq4Vb8CYiloLQBkXBt1Adf31Rwo1H+ASTu+GrCQyypTSJjlDy0R2+E8keWfabj15xjyts=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110833" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110833"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>vH6jMKDthPy/f/oqcOu3Kl9jQIM=</DigestValue></Reference></SignedInfo><SignatureValue>Cv24RtVaYwqxTJBFFkoji77H/x76K1jKIbuulbZ0Nm9lcYk4sz14YT5ewKlmpbypuUtbl5NCSkSPsWZ4y7QCTpbddmtUX1ZPcbRLPg9I8xWG1NbcyQqlCkpS0h76163wLFjzQp4gf+a9aSVzTkw9r/URj/0m4RcmiA4UhC+mhg4=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110834" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110834"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>p7hP4H+8hnM91WiYpcftVEgr+Cw=</DigestValue></Reference></SignedInfo><SignatureValue>FvsM3yhnphCD3/KOg9beknJx1+kcw4RWNJQbXsWUvwQOa6uz6PFuKjHeDdUSa0tTRoRQ8t15TfP38SyOco/DmoMfBmCuj70tQxk78BZ/Z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lmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110835" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110835"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>VCjVED64OxI7juJhG+0yWNlXusg=</DigestValue></Reference></SignedInfo><SignatureValue>NnmraR5m+J0bapZxL+8xsruVjidhmHqFrQwhHG4xeXeIytfQ3GgtLpaMYWO+Y+U/TrP1wKz10blLRfLa3vSuYEDuy1TI5tNjwPdmdLDXc+65YkYlO1rBYXuYHm0KIf61GPHIhvay5XUnV8VhzS7Utv2lT8p8/JyxqMHKEdg/FPY=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU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ZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110836" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110836"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>9+uhMXb1wz6fc3iQbovsGOoMKC4=</DigestValue></Reference></SignedInfo><SignatureValue>tW1I5Ai8xb3GMGxkjJLpraqQLKp2dJxfdLUmm8vlpJtlFdAT4S2EYQftsiRI05ojjOrYBWb+pWemZtNhbEHSeGDMzZ6YNJwN6r7sGaRVH8IdM/2j1U87qc6jBok85nAOvAr+qoLNV4rLAca8HdqwX+evgECCvIvPuOFMovCFyi0=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110837" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110837"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>pzvez2i5zHJO5NK7aGrsXzawOKM=</DigestValue></Reference></SignedInfo><SignatureValue>qJlA6hsqLbKMrjDavcfvaxG1q5OfvmeU7hVUmhJ2ipn3dKI6VpOuXaepFTA/hDz9+S1P7uc7UZj9tc/ndcUMEY1Fu97KbYpo9wyOZcKc2roxvwFlVah/3dIm3W2aH/nzanOXfx6hWCRzVyFpWlHnfkWiqsFbdyD9Y+dkiaJ6EBg=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110838" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110838"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>YjkOrMdDzFQvTy/lqIxwm4HXEZU=</DigestValue></Reference></SignedInfo><SignatureValue>5OfLaCwWLSOr1PPrj8mm6TYFynD2TJlsvmontCO2+lZ83GvHCmv/o/az72L4zTJLA+7EjWLXyVDaniVLz0KT580yAAVETdy7Am+ZGWSNgEyp+Fwc5eL4AiHtMPABnhdY1Y7GIZ+m74XPJLW31ybwH8G8tJEkib9bmVUK6LLcal8=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110839" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110839"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>mpqSlfCCvmFn5WrxQ9Dfl5uWuPU=</DigestValue></Reference></SignedInfo><SignatureValue>yISvrdTREuQiZ1uA4dl1HrIuk1VpcYc5bWYWa7Te01UMXNZ/bmqz0LH8oFiVoqPRnHHTSJ7NvgHC79z9z+EuDbrga1uTvLlY7CvtbxD1AuChyPc7IbkM5PGIS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0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110840" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110840"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>9IyNbREn2DYaDA6UUVNTmUx7Pdo=</DigestValue></Reference></SignedInfo><SignatureValue>MkQ4Ors8jwGneaOz+4cbbyL8u/kBUyx26JXe0skHJmKYq08uvihpylT7DHPr3ysXwMMhjsE5uuQQnKh48JpxmIkOXFTEzKvKnliiIsjFb5ENA+QG66Ae4Wmzt1z0CeUaGLf12qzAHJfxiNklvl1vSS7Gdxt9jGN1p8sm1ziqXU4=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANB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ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110841" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110841"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>KBQvgLVJ/pHIs2mchbP6r+XUV3w=</DigestValue></Reference></SignedInfo><SignatureValue>sTwck2qlVfUm+txPJzt7BshWT3zyUGYiLG4MR0RH2zm/DcjsBj/679m1/7k8lrt2E83jCSwZq8y6lVTSzJJlmXW+TVLyH3wCirheAXsWdCxQaYSeOilCPqb1kgB/qNcPReadT421qJfRGO3nMmd89HI4pCjHH1aYQPeGgytkcm4=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110842" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110842"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>3g5AU6Z5Pat0IPL/OYpTRwx4taQ=</DigestValue></Reference></SignedInfo><SignatureValue>VmXtcslq9V5bKh+ZzPRl9o+h9E04S2XiUwxvz605kN8hzCOPUTNzEMBlm1eiXKg9UAsRrFhCtJcUyqZdwN2ldVN57lxwZlPQ1Qj5DDyhG4MYtynBXNI5DhlrBb0xKOHFxsUJ4YkgtNGxwDfUyUlKwpNrgBABrbxe4W1Ibf/aX7M=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110843" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110843"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>h9UKsUjSbe8JbvsUApBt2psKKAU=</DigestValue></Reference></SignedInfo><SignatureValue>TVt205QhgqS2gZc9S0IxRbgc5x+d/iXhpCQpwYpGHbsVfvjmAPl3+zRKscTC3asPH8Nf2+6IGHwtElFqF2tE9c1RrS3cDuyjiXfKaGC5KmZ/5teXuGN1l4WF4/jitaSLu0nHcfmwxVQj3XH25+gHNXBAZXJCj1mHQO0jsmgDEz0=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110844" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110844"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>HbZModFP0Iui9gfuR7n/4sHi024=</DigestValue></Reference></SignedInfo><SignatureValue>WPU7Sj9DeVV91fBDnlAM/JKlKaC57/ID4/jbFYkcX4uO/tf0fpVUkOEwhxDUKldf/REsxKzOy3LAs/VoOLgqh3PmMBOZkTGWQjasY150ZCZHOIPuUk6wrObozuI+V0g3Xfff6pxId+t7Z3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aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110845" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110845"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>t72hWlvvtDZ6wNPjniZ2pDoTj/w=</DigestValue></Reference></SignedInfo><SignatureValue>XnKgmioztIbSGyiwYq0Xc5jGA5bxvoqGaNfWSulvY/e4CM6KY95fwMS9GYbEjTxMB8wcIZpziq8jlEMRnNkF+yHn/4QI+8y8K17EF7pebG4XHUuOGAditKlHbC85Fehj40+/+S0kc2iSe2D+FzY1TGe/2B7x78u45LaUtLT9sXE=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1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oLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110846" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110846"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>YsqTqpi1W7aZmk0w4pmyS9ICgIs=</DigestValue></Reference></SignedInfo><SignatureValue>NgHBGSEmJP4tPp4LViQYbDLfs7fQti90qvTJJ8KR2N0N8SPbmldwI8JRZyTldlQwUlRyaUqEE6OwFPW0vA0b4Upqqyl6p+MM7/ax+pU6PT7c/5xRzpSyPpvbLAYyMDA6dyQwfGgnxw+R1wRlZidxjyU+qX+C6xKc9/EhGC1MUOY=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110847" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110847"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>gjvLgyWmYcXiyBgjtBHrmH3do0E=</DigestValue></Reference></SignedInfo><SignatureValue>wQxpEm1stUvHMiMUQxMVzQlh/GKqusqgA3UGiVHDmFhnx4Fe9m7Kbp8iPzD5zhcRbFl2hVYJa1+2L0tL78unUO60uEjIFt47d/5F++rCgHkfcQAK2mdR4rl51tof8T75lvH/YJWqATZBcm7nyXEUyNlMBTyXt3NbZ4pkvjZPADU=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110848" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110848"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>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DAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110849" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110849"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>SXeCCjCKON99cwODW7wBGEO1vnk=</DigestValue></Reference></SignedInfo><SignatureValue>hlSBLj1DztVcfDubBVkCJ1Tgm5nvAqJF01lK2fbNzYRBozUwd7nQ+fvnHK+UI9OaR7wJKJwSY/nqK7OV1Iz1h+Nu/zFg/YV3hrG+mV+EvOzJEKhp0c7+NO45FQKhB5a+jLFCFCypOJW0OyyVGe1inhI6mC8iCCBy08LElb3x3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MBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110850" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110850"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>I58ROhWJ1+GlmoKlUDAbplxrJ8w=</DigestValue></Reference></SignedInfo><SignatureValue>jb3X9Sh3OvC+EGDdH3crhS9l1TJbiIpkQ0oPbXDWLnyOCMRx3QoXC6AEqhDqP6M0eiumhDIZr4AtL96gL0KdUedTuoH1e/CV0uOvvKrz0ZQex/6grLG195lm1wiZPk4T6+OzVjez0rOmyB4BQxtC26ER0OlXrJj9uNI4bG0neCQ=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFN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+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe></enviNFe> + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/numbering63.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/numbering63.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,70 @@ + + + Test for source tree numbering + + Level A + + Level B + + + Level B + + Level C + + + + Level B + + Level C + + Level D + + + + + + Level A + + Level B + + Level C + + Level D + + Level E + + + + + + + Level A + + Level B + + Level C + + Level D + + Level E + + + + Level D + + Level E + + + + + Level C + + Level D + + + + + Level B + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/numbering63.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/numbering63.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + : + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/outer.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/outer.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/redirect.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/redirect.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/redirect.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/redirect.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,18 @@ + + + + + + + + + Euro 1: € + + + + Euro 1: € + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/sax/Bug6451633.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/sax/Bug6451633.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform.sax; + +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.sax.TransformerHandler; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.helpers.AttributesImpl; + +/* + * @bug 6451633 + * @summary Test TransformerHandler ignores empty text node. + */ +public class Bug6451633 { + + @Test + public void test() throws Exception { + TransformerHandler th = ((SAXTransformerFactory) TransformerFactory.newInstance()).newTransformerHandler(); + + DOMResult result = new DOMResult(); + th.setResult(result); + + th.startDocument(); + th.startElement("", "root", "root", new AttributesImpl()); + th.characters(new char[0], 0, 0); + th.endElement("", "root", "root"); + th.endDocument(); + + // there's no point in having empty text --- we should remove it + Assert.assertEquals(0, ((Document) result.getNode()).getDocumentElement().getChildNodes().getLength()); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/src.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/src.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,33 @@ + + + + localhost + 8484 + Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3 + en + /matte + /logon.do + + + org.springframework.web.servlet.support.RequestContext@4bf0ff + + + You must be logged in and have sufficient access privileges to view the requested page. + + + http://localhost:8484/matte/home.do + + + + */* + en + gzip, deflate + JSESSIONID=42E37E740D15356C0E861590CEA4A421; JSESSIONID=5647B2F0C0A7E5E673970E4A21D2F3FD + Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3 + keep-alive + localhost:8484 + + + no model + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/template.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/template.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,5 @@ + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tigertest-in.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tigertest-in.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,7 @@ + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tigertest.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tigertest.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tmp.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tmp.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,1 @@ +<_test01/><_test-04>T%e!s#t$
    1000509.90.0860833333333333345134545.22916666666667114.44-16.886.70A1Vn

    2000503.80.08438888888888889-003011-0.503055555555555698.33-61.146.29gG9

    3Psc33 Psc000520.10.08891666666666666-054227-5.707500000000000593.75-65.934.61K0IIIbCN-0.5

    4Peg86 Peg000542.00.09513234613.39611111111111106.19-47.985.51G5III

    5000616.00.1044444444444444558261258.43666666666666117.03-03.925.96G5V

    6000619.00.10527777777777779-490430-49.075321.61-66.385.70G1IV

    7Cas10 Cas000626.50.1073611111111111264114664.19611111111111118.061.755.59B9III

    8000636.80.1102222222222222229011729.02138888888889111.26-32.836.13K0V

    9000650.10.11391666666666667-230627-23.107552.21-79.146.18A7V

    10000718.20.12172222222222222-172311-17.38638888888888874.36-75.906.19A6Vn
    diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/toys.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/toys.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,38 @@ + + + + + + Lego-Model01 + 65.99 + + + Lego-Model2 + 69.99 + + + Lego-Model3 + 14.99 + + + Barbie-Pink + 12.99 + + + Barbie-Blue + 13.99 + + + Barbie-White + 13.99 + + + Barbie-Plain + 13.99 + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/transform.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/transform.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/upload-media-form.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/upload-media-form.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,126 @@ + + + + + + + + + + + + +
    +

    + +

    +
    + +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    + +
    +
    +
    +
    + +
    + +
    + +
    +
    +
    +
    + +
    + +
    + +
    +
    +
    +
    + +
    +
    +
    + + + + + +
    diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/upload-media.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/upload-media.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + no-sub-nav + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util.xsl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,128 @@ + + + + + + + + + " + \" + + + + + + + + + ' + \' + + + + + + + + + + + + \ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 350 + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/DOMUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/DOMUtil.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform.util; + +import java.io.InputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; + +import org.testng.Assert; +import org.w3c.dom.Document; + +public class DOMUtil extends TransformerUtil { + + DocumentBuilder docBuilder = null; + + private static DOMUtil instance = null; + + /** Creates a new instance of DOMUtil */ + private DOMUtil() throws Exception { + if (docBuilder == null) + docBuilder = getDomParser(); + } + + public static synchronized DOMUtil getInstance() throws Exception { + if (instance == null) + instance = new DOMUtil(); + return instance; + } + + public Source prepareSource(InputStream is) throws Exception { + docBuilder.reset(); + Document doc1 = docBuilder.parse(is); + return new DOMSource(doc1); + } + + public Result prepareResult() { + Document target = docBuilder.newDocument(); + return new DOMResult(target); + } + + public void checkResult(Result result, String version) { + String resultVersion = ((Document) ((DOMResult) result).getNode()).getXmlVersion(); + Assert.assertTrue(version.equals(resultVersion), "Expected XML Version is 1.1, but actual version " + resultVersion); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/SAXUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/SAXUtil.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform.util; + +import java.io.InputStream; + +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.VersionDefaultHandler; +import javax.xml.transform.sax.SAXResult; +import javax.xml.transform.sax.SAXSource; + +import org.testng.Assert; +import org.xml.sax.InputSource; + +public class SAXUtil extends TransformerUtil { + + private static SAXUtil instance = null; + + /** Creates a new instance of SAXUtil */ + private SAXUtil() { + + } + + public static synchronized SAXUtil getInstance() throws Exception { + if (instance == null) + instance = new SAXUtil(); + return instance; + } + + public Source prepareSource(InputStream is) throws Exception { + return new SAXSource(new InputSource(is)); + } + + public Result prepareResult() throws Exception { + VersionDefaultHandler dh = new VersionDefaultHandler(); + return new SAXResult(dh); + } + + public void checkResult(Result result, String inputVersion) throws Exception { + String version = ((VersionDefaultHandler) ((SAXResult) result).getHandler()).getVersion(); + Assert.assertTrue(inputVersion.equals(version), "Expected XML Version is 1.1, but actual version " + version); + } + + public void checkResult(Result result, String inputVersion, String encoding) throws Exception { + checkResult(result, inputVersion); + String resultEncoding = ((VersionDefaultHandler) ((SAXResult) result).getHandler()).getEncoding(); + Assert.assertTrue(encoding.equals(resultEncoding), "Expected XML Version is " + encoding + " , but actual encoding " + resultEncoding); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/StAXUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/StAXUtil.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform.util; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.XMLStreamWriter; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.TransformerUtilFactory; +import javax.xml.transform.VersionEventWriter; +import javax.xml.transform.stax.StAXResult; +import javax.xml.transform.stax.StAXSource; + +import org.testng.Assert; + +public class StAXUtil extends TransformerUtil { + + private static StAXUtil instance = null; + + /** Creates a new instance of StAXUtil */ + private StAXUtil() { + } + + public static synchronized StAXUtil getInstance() throws Exception { + if (instance == null) + instance = new StAXUtil(); + return instance; + } + + public Source prepareSource(InputStream is) throws Exception { + XMLEventReader reader = XMLInputFactory.newInstance().createXMLEventReader(is); + return new StAXSource(reader); + } + + public Result prepareResult() throws Exception { + VersionEventWriter writer = new VersionEventWriter(); + return new StAXResult(writer); + } + + public void checkResult(Result staxResult, String version) throws Exception { + VersionEventWriter writer = (VersionEventWriter) ((StAXResult) staxResult).getXMLEventWriter(); + Assert.assertTrue(writer.getVersion().equals(version), "Expected XML Version is 1.1, but actual version " + writer.getVersion()); + } + + public void checkResult(Result staxResult, String version, String encoding) throws Exception { + VersionEventWriter writer = (VersionEventWriter) ((StAXResult) staxResult).getXMLEventWriter(); + Assert.assertTrue(writer.getVersion().equals(version), "Expected XML Version is 1.1, but actual version " + writer.getVersion()); + Assert.assertTrue(writer.getEncoding().equals(encoding), "Expected encoding is " + encoding + ", but actual encoding " + writer.getEncoding()); + } + + public Source prepareStreamSource(InputStream is) throws Exception { + XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(is); + return new StAXSource(reader); + } + + public Result prepareStreamResult() throws Exception { + XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(new FileOutputStream(TEMP_FILE)); + return new StAXResult(writer); + } + + public void checkStreamResult(Result staxResult, String version) throws Exception { + ((StAXResult) staxResult).getXMLStreamWriter().close(); + ((StreamUtil) TransformerUtilFactory.getUtil(TransformerUtilFactory.STREAM)).checkStream(new FileInputStream(TEMP_FILE), version); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/StreamUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/StreamUtil.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform.util; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.VersionDefaultHandler; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.w3c.dom.Document; + +public class StreamUtil extends TransformerUtil { + + DocumentBuilder docBuilder = null; + + private static StreamUtil instance = null; + + /** Creates a new instance of StreamUtil */ + private StreamUtil() throws Exception { + if (docBuilder == null) + docBuilder = getDomParser(); + } + + public static synchronized StreamUtil getInstance() throws Exception { + if (instance == null) + instance = new StreamUtil(); + return instance; + } + + public Source prepareSource(InputStream is) throws Exception { + return new StreamSource(is); + } + + public Result prepareResult() throws Exception { + FileOutputStream fos = new FileOutputStream(TEMP_FILE); + return new StreamResult(fos); + } + + public void checkResult(Result result, String inputVersion) throws Exception { + ((StreamResult) result).getOutputStream().close(); + FileInputStream fis = new FileInputStream(TEMP_FILE); + checkStream(fis, inputVersion); + } + + public void checkStream(FileInputStream fis, String inputVersion) throws Exception { + docBuilder.reset(); + Document output = docBuilder.parse(fis); + String version = output.getXmlVersion(); + Assert.assertTrue(inputVersion.equals(version), "Expected XML Version is 1.1, but actual version " + version); + } + + public void checkResult(Result result, String version, String encoding) throws Exception { + // use sax parser, as encoding info cannot be set on DOM document + SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); + VersionDefaultHandler dh = new VersionDefaultHandler(); + parser.parse(new File(TEMP_FILE), dh); + Assert.assertTrue(dh.getVersion().equals(version), "Expected version is " + version + " actual version " + dh.getVersion()); + Assert.assertTrue(dh.getEncoding().equals(encoding), "Expected version is " + encoding + " actual version " + dh.getEncoding()); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/TransformerUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/TransformerUtil.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.transform.util; + +import java.io.InputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Result; +import javax.xml.transform.Source; + +public abstract class TransformerUtil { + + protected String type; + + protected final String TEMP_FILE = "tmp.xml"; + + public abstract Source prepareSource(InputStream is) throws Exception; + + public abstract Result prepareResult() throws Exception; + + public abstract void checkResult(Result result, String version) throws Exception; + + public void checkResult(Result result, String version, String encoding) throws Exception { + checkResult(result, version); + } + + public DocumentBuilder getDomParser() throws Exception { + DocumentBuilderFactory docBF = DocumentBuilderFactory.newInstance(); + return docBF.newDocumentBuilder(); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/6773084.policy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/6773084.policy Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,23 @@ +grant { + permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; + permission java.lang.RuntimePermission "accessDeclaredMembers"; + + permission java.io.FilePermission "${test.classes}/../../-", "read, write, delete"; + permission java.io.FilePermission ".", "read, write, delete"; + permission java.util.PropertyPermission "*", "read, write"; + + permission java.lang.RuntimePermission "setSecurityManager"; + permission java.lang.RuntimePermission "createSecurityManager"; + permission java.lang.RuntimePermission "createClassLoader"; + permission java.lang.RuntimePermission "setIO"; + permission java.lang.RuntimePermission "setContextClassLoader"; + permission java.security.SecurityPermission "getPolicy"; + + permission java.io.FilePermission "${test.src}/-", "read, write, delete"; + permission java.io.FilePermission "${user.dir}/-", "read, write, delete"; + permission java.io.FilePermission "${java.io.tmpdir}/-", "read, write, delete"; + + + permission java.lang.RuntimePermission "modifyThread"; + +}; diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966232.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966232.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; + +/* + * @bug 4966232 + * @summary Test SchemaFactory.newSchema(Source) returns a Schema instance for DOMSource & SAXSource. + */ +public class Bug4966232 { + + // test for W3C XML Schema 1.0 - newSchema(Source schema) + // supports and return a valid Schema instance + // SAXSource - valid schema + + @Test + public void testSchemaFactory01() throws Exception { + SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + InputSource is = new InputSource(Bug4966232.class.getResourceAsStream("test.xsd")); + SAXSource ss = new SAXSource(is); + Schema s = sf.newSchema(ss); + Assert.assertNotNull(s); + } + + // test for W3C XML Schema 1.0 - newSchema(Source schema) + // supports and return a valid Schema instance + // DOMSource - valid schema + + @Test + public void testSchemaFactory02() throws Exception { + Document doc = null; + SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + doc = dbf.newDocumentBuilder().parse(Bug4966232.class.getResource("test.xsd").toExternalForm()); + DOMSource ds = new DOMSource(doc); + Schema s = sf.newSchema(ds); + Assert.assertNotNull(s); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +import util.DraconianErrorHandler; + +/* + * @bug 4966254 + * @summary Test validate(StreamSource) & validate(StreamSource,null) works instead of throws IOException. + */ +public class Bug4966254 { + + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void testValidator01() throws Exception { + getValidator().validate(getInstance()); + } + + @Test + public void testValidator02() throws Exception { + getValidator().validate(getInstance(), null); + } + + private StreamSource getInstance() { + return new StreamSource(Bug4966254.class.getResource(("Bug4966254.xml")).toExternalForm()); + } + + private Validator getValidator() throws SAXException { + Schema s = getSchema(); + Validator v = s.newValidator(); + Assert.assertNotNull(v); + v.setErrorHandler(new DraconianErrorHandler()); + return v; + } + + private Schema getSchema() throws SAXException { + SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + Schema s = sf.newSchema(Bug4966254.class.getResource("Bug4966254.xsd")); + Assert.assertNotNull(s); + return s; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969042.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969042.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.IOException; +import java.io.StringReader; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.ValidatorHandler; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 4969042 + * @summary Test ValidationHandler shall invoke ignorableWhitespace() of the + * user-defined ContentHandler once the validator detects any ignorable whitespaces. + */ +public class Bug4969042 { + + public static final String XSD = "\n" + "\n" + " \n" + + " \n" + " \n" + " \n" + " \n" + + " \n" + " \n" + "\n"; + + public static final String XML = "\n" + "\n" + " \n" + " 123abc\n" + " \n" + + "\n"; + + private ValidatorHandler createValidatorHandler(String xsd) throws SAXException { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + StringReader reader = new StringReader(xsd); + StreamSource xsdSource = new StreamSource(reader); + + Schema schema = schemaFactory.newSchema(xsdSource); + return schema.newValidatorHandler(); + } + + private XMLReader createXMLReader() throws ParserConfigurationException, SAXException { + SAXParserFactory parserFactory = SAXParserFactory.newInstance(); + if (!parserFactory.isNamespaceAware()) { + parserFactory.setNamespaceAware(true); + } + + return parserFactory.newSAXParser().getXMLReader(); + } + + private void parse(XMLReader xmlReader, String xml) throws SAXException, IOException { + StringReader reader = new StringReader(xml); + InputSource inSource = new InputSource(reader); + + xmlReader.parse(inSource); + } + + @Test + public void test() throws SAXException, ParserConfigurationException, IOException { + XMLReader xmlReader = createXMLReader(); + ValidatorHandler validatorHandler = createValidatorHandler(XSD); + xmlReader.setContentHandler(validatorHandler); + + final boolean[] invoked = { false, false }; + DefaultHandler contentHandler = new DefaultHandler() { + public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { + invoked[0] = true; + } + + public void characters(char[] ch, int start, int length) throws SAXException { + invoked[1] = true; + } + }; + validatorHandler.setContentHandler(contentHandler); + + parse(xmlReader, XML); + + Assert.assertTrue(invoked[0], "Method ignorableWhitespace() was not invoked."); + Assert.assertTrue(invoked[1], "Method characters() was not invoked."); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969089.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969089.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.StringReader; + +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 4969089 + * @summary Test when an ErrorHandler is set for a SchemaFactory, SchemaFactory.newSchema(Source[]) + * method throws an exception that is not equal to the exception thrown from the ErrorHandler. + */ +public class Bug4969089 { + + @Test + public void test1() { + String xsd1 = "\n" + "\n" + " \n" + "\n"; + + final SAXException EUREKA = new SAXException("NewSchema007"); + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + StringReader reader = new StringReader(xsd1); + StreamSource source = new StreamSource(reader); + DefaultHandler errorHandler = new DefaultHandler() { + public void fatalError(SAXParseException _) throws SAXException { + throw EUREKA; + } + + public void error(SAXParseException _) throws SAXException { + throw EUREKA; + } + }; + schemaFactory.setErrorHandler(errorHandler); + + try { + schemaFactory.newSchema(new Source[] { source }); + Assert.fail("SAXException was not thrown."); + } catch (SAXException e) { + Assert.assertSame(e, EUREKA); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969110.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969110.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.ValidatorHandler; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; + +/* + * @bug 4969110 + * @summary Test ValidationHandler.set/getProperty() throws a correct exception + * instead of a sun internal exception in case the "property name" parameter is invalid. + */ +public class Bug4969110 { + + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + @Test + public void test1() throws SAXException { + try { + ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler(); + validatorHandler.getProperty("unknown1234"); + Assert.fail("SAXNotRecognizedException was not thrown."); + } catch (SAXNotRecognizedException e) { + } + } + + @Test + public void test2() throws SAXException { + try { + doTest(null); + Assert.fail("NullPointerException was not thrown."); + } catch (NullPointerException e) { + } + } + + @Test + public void test3() throws SAXException { + try { + doTest("unknown1234"); + Assert.fail("SAXNotRecognizedException was not thrown."); + } catch (SAXNotRecognizedException e) { + } + } + + public void doTest(String name) throws SAXException { + ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler(); + validatorHandler.setProperty(name, "123"); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969689.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969689.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; + + +/* + * @bug 4969689 + * @summary Test SchemaFactory.get/setFeature() throw NullPointerException + * instead of SAXNotRecognizedException in case the "feature name" parameter is null. + */ +public class Bug4969689 { + + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + @Test + public void test01() throws SAXNotRecognizedException, SAXNotSupportedException { + try { + schemaFactory.getFeature(null); + Assert.fail("exception expected"); + } catch (NullPointerException e) { + ; // expected + } + } + + @Test + public void test() throws SAXNotRecognizedException, SAXNotSupportedException { + try { + schemaFactory.setFeature(null, false); + Assert.fail("exception expected"); + } catch (NullPointerException e) { + ; // as expected + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969692.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969692.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 4969692 + * @summary Test Validator.get/setFeature() throw NullPointerException + * instead of SAXNotRecognizedException in case the "feature name" parameter is null. + */ +public class Bug4969692 { + + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + @Test + public void test01() throws SAXException { + Validator validator = schemaFactory.newSchema().newValidator(); + try { + validator.getFeature(null); + Assert.fail("exception expected"); + } catch (NullPointerException e) { + ; + } + } + + @Test + public void test02() throws SAXException { + Validator validator = schemaFactory.newSchema().newValidator(); + try { + validator.setFeature(null, false); + Assert.fail("exception expected"); + } catch (NullPointerException e) { + ; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969693.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969693.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 4969693 + * @summary Test Validator.get/setProperty() throw NullPointerException + * instead of SAXNotRecognizedException in case the "property name" parameter is null. + */ +public class Bug4969693 { + + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + @Test + public void test01() throws SAXException { + Validator validator = schemaFactory.newSchema().newValidator(); + try { + validator.getProperty(null); + Assert.fail("exception expected"); + } catch (NullPointerException e) { + ; + } + } + + @Test + public void test02() throws SAXException { + Validator validator = schemaFactory.newSchema().newValidator(); + try { + validator.setProperty(null, "abc"); + Assert.fail("exception expected"); + } catch (NullPointerException e) { + ; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969695.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969695.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; + +/* + * @bug 4969695 + * @summary Test SchemaFactory.get/setProperty() throw NullPointerException + * instead of SAXNotRecognizedException in case the "property name" parameter is null. + */ +public class Bug4969695 { + + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + @Test + public void test01() throws SAXNotRecognizedException, SAXNotSupportedException { + try { + schemaFactory.getProperty(null); + Assert.fail("exception expected"); + } catch (NullPointerException e) { + ; // expected + } + } + + @Test + public void test() throws SAXNotRecognizedException, SAXNotSupportedException { + try { + schemaFactory.setProperty(null, "123"); + Assert.fail("exception expected"); + } catch (NullPointerException e) { + ; // as expected + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969732.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969732.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.StringReader; + +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.TypeInfoProvider; +import javax.xml.validation.ValidatorHandler; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 4969732 + * @summary Test TypeInfoProvider.getElementTypeInfo() throws IllegalStateException + * in case the method is not called from method startElement() or endElement(). + */ +public class Bug4969732 { + + public static final String XSD = "\n" + "\n" + " \n" + + "\n"; + + public static final String XML = "\n" + "1234abc\n"; + + private ValidatorHandler createValidatorHandler(String xsd) throws SAXException { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + StringReader reader = new StringReader(xsd); + StreamSource xsdSource = new StreamSource(reader); + + Schema schema = schemaFactory.newSchema(xsdSource); + return schema.newValidatorHandler(); + } + + private XMLReader createXMLReader() throws Exception { + SAXParserFactory parserFactory = SAXParserFactory.newInstance(); + parserFactory.setNamespaceAware(true); + + return parserFactory.newSAXParser().getXMLReader(); + } + + private void parse(XMLReader xmlReader, String xml) throws Exception { + StringReader reader = new StringReader(xml); + InputSource inSource = new InputSource(reader); + + xmlReader.parse(inSource); + } + + @Test + public void test1() throws Exception { + XMLReader xmlReader = createXMLReader(); + final ValidatorHandler validatorHandler = createValidatorHandler(XSD); + xmlReader.setContentHandler(validatorHandler); + + DefaultHandler handler = new DefaultHandler() { + public void characters(char[] ch, int start, int length) throws SAXException { + TypeInfoProvider infoProvider = null; + synchronized (validatorHandler) { + infoProvider = validatorHandler.getTypeInfoProvider(); + } + if (infoProvider == null) { + Assert.fail("Can't obtain TypeInfo object."); + } + + try { + infoProvider.getElementTypeInfo(); + Assert.fail("IllegalStateException was not thrown."); + } catch (IllegalStateException e) { + // as expected + System.out.println("OK"); + } + } + }; + validatorHandler.setContentHandler(handler); + + parse(xmlReader, XML); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970380.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970380.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.ValidatorHandler; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXNotRecognizedException; + +/* + * @bug 4970380 + * @summary Test validatorHandler.getFeature(...) with unknown name and "http://xml.org/sax/features/namespace-prefixes". + */ +public class Bug4970380 { + + @Test + public void test1() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler(); + + try { + validatorHandler.getFeature("unknown1234"); + Assert.fail("SAXNotRecognizedException was not thrown."); + } catch (SAXNotRecognizedException e) { + ; // expected + } + + if (!validatorHandler.getFeature("http://xml.org/sax/features/namespace-prefixes")) { + // as expected + System.out.println("getFeature(namespace-prefixes): OK"); + } else { + Assert.fail("Expected false, returned true."); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970383.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970383.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.ValidatorHandler; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 4970383 + * @summary Test validatorHandler.setFeature throws NullPointerException if name parameter is null. + */ +public class Bug4970383 { + + @Test + public void test() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler(); + try { + validatorHandler.setFeature(null, false); + Assert.fail("should report an error"); + } catch (NullPointerException e) { + ; // expected + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970400.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970400.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.ValidatorHandler; + +import org.testng.annotations.Test; + +/* + * @bug 4970400 + * @summary Test ValidatorHandler recognizes namespace-prefixes feature. + */ +public class Bug4970400 { + + @Test + public void test1() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler(); + validatorHandler.setFeature("http://xml.org/sax/features/namespace-prefixes", false); + validatorHandler.setFeature("http://xml.org/sax/features/namespace-prefixes", true); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970402.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970402.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.IOException; +import java.io.StringReader; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.TypeInfoProvider; +import javax.xml.validation.ValidatorHandler; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 4970402 + * @summary Test TypeInfoProvider's attribute accessing methods throw IndexOutOfBoundsException when index parameter is invalid. + */ +public class Bug4970402 { + + public static final String XSD = "\n" + "\n" + " \n" + + " \n" + " \n" + " \n" + " \n" + + " \n" + " \n" + " \n" + "\n"; + + public static final String XML = "\n" + "\n" + " 123abc\n" + + "\n"; + + private ValidatorHandler createValidatorHandler(String xsd) throws SAXException { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + StringReader reader = new StringReader(xsd); + StreamSource xsdSource = new StreamSource(reader); + + Schema schema = schemaFactory.newSchema(xsdSource); + return schema.newValidatorHandler(); + } + + private XMLReader createXMLReader() throws ParserConfigurationException, SAXException { + SAXParserFactory parserFactory = SAXParserFactory.newInstance(); + parserFactory.setNamespaceAware(true); + return parserFactory.newSAXParser().getXMLReader(); + } + + private void parse(XMLReader xmlReader, String xml) throws SAXException, IOException { + StringReader reader = new StringReader(xml); + InputSource inSource = new InputSource(reader); + + xmlReader.parse(inSource); + } + + @Test + public void test() throws Exception { + XMLReader xmlReader = createXMLReader(); + final ValidatorHandler validatorHandler = createValidatorHandler(XSD); + xmlReader.setContentHandler(validatorHandler); + + DefaultHandler handler = new DefaultHandler() { + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { + if (!"ns:test".equals(qName)) { + return; + } + + TypeInfoProvider infoProvider = null; + synchronized (validatorHandler) { + infoProvider = validatorHandler.getTypeInfoProvider(); + } + Assert.assertTrue(infoProvider != null, "Can't obtain TypeInfoProvider object."); + + try { + infoProvider.getAttributeTypeInfo(-1); + Assert.fail("IndexOutOfBoundsException was not thrown."); + } catch (IndexOutOfBoundsException e) { + ; // as expected + } + + try { + infoProvider.isIdAttribute(-1); + Assert.fail("IndexOutOfBoundsException was not thrown."); + } catch (IndexOutOfBoundsException e) { + ; // as expected + } + } + }; + validatorHandler.setContentHandler(handler); + + parse(xmlReader, XML); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970951.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970951.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.IOException; +import java.io.StringReader; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.TypeInfoProvider; +import javax.xml.validation.ValidatorHandler; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 4970951 + * @summary Test TypeInfoProvider.isSpecified(...) return true if the attribute was originally present. + */ +public class Bug4970951 { + + public static final String XSD = "\n" + "\n" + " \n" + + " \n" + " \n" + " \n" + " \n" + + " \n" + " \n" + " \n" + + " \n" + "\n"; + + public static final String XML = "\n" + "\n" + " 123abc\n" + + "\n"; + + private ValidatorHandler createValidatorHandler(String xsd) throws SAXException { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + StringReader reader = new StringReader(xsd); + StreamSource xsdSource = new StreamSource(reader); + + Schema schema = schemaFactory.newSchema(xsdSource); + return schema.newValidatorHandler(); + } + + private XMLReader createXMLReader() throws ParserConfigurationException, SAXException { + SAXParserFactory parserFactory = SAXParserFactory.newInstance(); + parserFactory.setNamespaceAware(true); + + return parserFactory.newSAXParser().getXMLReader(); + } + + private void parse(XMLReader xmlReader, String xml) throws SAXException, IOException { + StringReader reader = new StringReader(xml); + InputSource inSource = new InputSource(reader); + + xmlReader.parse(inSource); + } + + @Test + public void test() throws Exception { + XMLReader xmlReader = createXMLReader(); + final ValidatorHandler validatorHandler = createValidatorHandler(XSD); + xmlReader.setContentHandler(validatorHandler); + + DefaultHandler handler = new DefaultHandler() { + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { + if (!"ns:test".equals(qName)) { + return; + } + + TypeInfoProvider infoProvider = validatorHandler.getTypeInfoProvider(); + if (infoProvider == null) { + throw new SAXException("Can't obtain TypeInfoProvider object."); + } + + int index = attributes.getIndex("id"); + if (index == -1) { + throw new SAXException("The attribute 'id' is not in the list."); + } + + Assert.assertTrue(infoProvider.isSpecified(index)); + + index = attributes.getIndex("date"); + if (index == -1) { + throw new SAXException("The attribute 'date' is not in the list."); + } + + Assert.assertFalse(infoProvider.isSpecified(index)); + + System.out.println("OK"); + } + }; + validatorHandler.setContentHandler(handler); + + parse(xmlReader, XML); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4971605.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4971605.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; + +/* + * @bug 4971605 + * @summary Test SchemaFactory.newSchema(Source) returns a Schema instance for DOMSource. + */ +public class Bug4971605 { + + @Test + public void test1() throws Exception { + String xsd = "\n" + "\n" + " \n" + "\n"; + + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); + docBuilderFactory.setNamespaceAware(true); + DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); + + Node document = docBuilder.parse(new InputSource(new StringReader(xsd))); + Assert.assertNotNull(document); + + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + Schema schema = schemaFactory.newSchema(new Source[] { new DOMSource(document) }); + Assert.assertNotNull(schema, "Failed: newSchema returned null."); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4971607.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4971607.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.ValidatorHandler; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 4971607 + * @summary Test ValidatorHandler.getFeature(...) throws NullPointerException when name parameter is null. + */ +public class Bug4971607 { + + @Test + public void test1() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler(); + + try { + validatorHandler.getFeature(null); + Assert.fail(); + } catch (NullPointerException e) { + e.printStackTrace(); + ; // as expected + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4972882.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4972882.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +import util.DraconianErrorHandler; + +/* + * @bug 4972882 + * @summary Test Validator throws Exception when two identity-constraints are defined with the same {name} and {target namespace}. + */ +public class Bug4972882 { + + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test1() throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(true); + dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI); + dbf.setAttribute(SCHEMA_SOURCE, Bug4972882.class.getResource("targetNS00101m2_stub.xsd").toExternalForm()); + + DocumentBuilder builder = dbf.newDocumentBuilder(); + builder.setErrorHandler(new DraconianErrorHandler()); + + try { + builder.parse(Bug4972882.class.getResource("targetNS00101m2_stub.xml").toExternalForm()); + Assert.fail("failure expected"); + } catch (SAXException e) { + Assert.assertTrue(e.getMessage().indexOf("sch-props-correct.2") != -1); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4986844.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4986844.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 4986844 + * @summary Test SchemaFactory can detect particle restriction. + */ +public class Bug4986844 { + + @Test + public void test1() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + try { + schemaFactory.newSchema(Bug4986844.class.getResource("Bug4986844.xsd")); + Assert.fail("should report an error"); + } catch (SAXException e) { + if (e.getMessage().startsWith("rcase-RecurseUnordered.2")) + ; // as expected + else + throw e; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4986844.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4986844.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4987574.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4987574.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; +import java.io.FileWriter; +import java.io.PrintWriter; + +import javax.xml.validation.SchemaFactory; + +import org.testng.annotations.Test; + +/* + * @bug 4987574 + * @summary Test schemaFactory.newSchema doesn't throw NullPointerExceptio for empty schema. + */ +public class Bug4987574 { + + @Test + public void test1() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + File tmpFile = File.createTempFile("jaxpri", "bug"); + tmpFile.deleteOnExit(); + { + PrintWriter pw = new PrintWriter(new FileWriter(tmpFile)); + pw.println(""); + pw.close(); + } + + schemaFactory.newSchema(tmpFile); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988267.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988267.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 4988267 + * @summary Test SchemaFactory can detect particle restriction. + */ +public class Bug4988267 { + + @Test + public void test1() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + try { + schemaFactory.newSchema(Bug4988267.class.getResource("Bug4988267.xsd")); + Assert.fail("should report an error"); + } catch (SAXException e) { + if (e.getMessage().startsWith("cos-nonambig")) + ; // as expected + else + throw e; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988267.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988267.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988268.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988268.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; + +import org.testng.annotations.Test; + +/* + * @bug 4988268 + * @summary Test the schema is valid. + */ +public class Bug4988268 { + + @Test + public void test1() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + schemaFactory.newSchema(Bug4988268.class.getResource("Bug4988268.xsd")); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988268.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988268.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988387.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988387.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 4988387 + * @summary Test SchemaFactory can detect invalid XPath expressions. + */ +public class Bug4988387 { + + @Test + public void test1() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + try { + schemaFactory.newSchema(Bug4988387.class.getResource("Bug4988387.xsd")); + Assert.fail("incorrect XPath processed"); + } catch (SAXException e) { + Assert.assertTrue(e.getMessage().startsWith("c-general-xpath")); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988387.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988387.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4996446.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4996446.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.net.URL; + +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 4996446 + * @summary Test SchemaFactory can detect violations of the "Schema Component Constraint: Element Declarations Consistent". + */ +public class Bug4996446 { + + SchemaFactory schemaFactory = null; + + @BeforeMethod + protected void setUp() { + schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + } + + @AfterMethod + protected void tearDown() { + schemaFactory = null; + } + + @Test + public void testOne() { + + ErrorHandler errorHandler = new ErrorHandler(); + schemaFactory.setErrorHandler(errorHandler); + URL fileName = Bug4996446.class.getResource("Bug4996446.xsd"); + try { + schemaFactory.newSchema(fileName); + } catch (SAXException e) { + } + + if (errorHandler.errorCounter == 0) { + Assert.fail(" No Errors reported: " + errorHandler.errorCounter); + } + return; + } +} + +class ErrorHandler extends DefaultHandler { + public int errorCounter = 0; + + public void error(SAXParseException e) throws SAXException { + // System.out.println(e); + errorCounter++; + } + + public void fatalError(SAXParseException e) throws SAXException { + // System.out.println(e); + errorCounter++; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4996446.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4996446.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4997818.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4997818.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.StringReader; + +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.ls.LSInput; +import org.w3c.dom.ls.LSResourceResolver; + +/* + * @bug 4997818 + * @summary Test SchemaFactory.newSchema(...) throws an exception, which is thrown from LSResourceResolver. + */ + +public class Bug4997818 { + + @Test + public void test1() throws Exception { + String xsd1 = "\n" + "\n" + " \n" + + " \n" + " \n" + "\n"; + + final NullPointerException EUREKA = new NullPointerException("NewSchema015"); + + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + StringReader reader = new StringReader(xsd1); + StreamSource source = new StreamSource(reader); + LSResourceResolver resolver = new LSResourceResolver() { + public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { + LSInput input; + if (namespaceURI != null && namespaceURI.endsWith("jaxp13_test2")) { + throw EUREKA; + } else { + input = null; + } + + return input; + } + }; + schemaFactory.setResourceResolver(resolver); + + try { + schemaFactory.newSchema(new Source[] { source }); + Assert.fail("NullPointerException was not thrown."); + } catch (RuntimeException e) { + if (e != EUREKA) + throw e; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5011500.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5011500.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.ByteArrayInputStream; +import java.io.InputStreamReader; + +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; +import javax.xml.validation.ValidatorHandler; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 5011500 + * @summary Test ValidatorHanlder and Validator can work for the xml document. + */ +public class Bug5011500 { + + public static final String XSD = "\n" + "\n" + " \n" + " \n" + " \n" + + " \n" + " \n" + " \n" + + " \n" + " \n" + "\n"; + + public static final String XML = "\n" + "\n" + "\n" + + " 123abc\n" + "\n"; + + private ValidatorHandler validatorHandler; + private Validator validator; + + private XMLReader createXMLReader() throws Exception { + SAXParserFactory parserFactory = SAXParserFactory.newInstance(); + parserFactory.setNamespaceAware(true); + + return parserFactory.newSAXParser().getXMLReader(); + } + + private void parse(XMLReader xmlReader, String xml) throws Exception { + InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(xml.getBytes())); + InputSource inSource = new InputSource(reader); + + xmlReader.parse(inSource); + } + + @BeforeMethod + public void setUp() throws Exception { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(XSD.getBytes())); + StreamSource xsdSource = new StreamSource(reader); + + Schema schema = schemaFactory.newSchema(xsdSource); + + this.validatorHandler = schema.newValidatorHandler(); + this.validator = schema.newValidator(); + } + + @Test + public void test1() throws Exception { + DefaultHandler contentHandler = new DefaultHandler(); + validatorHandler.setContentHandler(contentHandler); + validatorHandler.setErrorHandler(contentHandler); + + XMLReader xmlReader = createXMLReader(); + xmlReader.setContentHandler(validatorHandler); + parse(xmlReader, XML); + } + + @Test + public void test2() throws Exception { + InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(XML.getBytes())); + StreamSource xmlSource = new StreamSource(reader); + + validator.validate(xmlSource); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.sax.TransformerHandler; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + +/* + * @bug 5072946 + * @summary Test Validator.validate(DOMSource,DOMResult) outputs to the result. + */ +public class Bug5072946 { + + @Test + public void test1() throws Exception { + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document dom = parser.parse(Bug5072946.class.getResourceAsStream("Bug5072946.xml")); + + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema s = sf.newSchema(Bug5072946.class.getResource("Bug5072946.xsd")); + Validator v = s.newValidator(); + + DOMResult r = new DOMResult(); + // r.setNode(dbf.newDocumentBuilder().newDocument()); + v.validate(new DOMSource(dom), r); + + Node node = r.getNode(); + Assert.assertNotNull(node); + Node fc = node.getFirstChild(); + Assert.assertTrue(fc instanceof Element); + Element e = (Element) fc; + + Assert.assertEquals("value", e.getAttribute("foo")); + } + + /** + * Tests if the identity transformer correctly sets the output node. + */ + @Test + public void test2() throws Exception { + SAXTransformerFactory sf = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); + TransformerHandler th = sf.newTransformerHandler(); + DOMResult r = new DOMResult(); + th.setResult(r); + + XMLReader reader = XMLReaderFactory.createXMLReader(); + reader.setContentHandler(th); + reader.parse(new InputSource(Bug5072946.class.getResourceAsStream("Bug5072946.xml"))); + + Assert.assertNotNull(r.getNode()); + } + + @Test + public void test3() throws Exception { + SAXTransformerFactory sf = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); + Transformer t = sf.newTransformer(); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Document dom = parser.parse(Bug5072946.class.getResourceAsStream("Bug5072946.xml")); + + DOMResult r = new DOMResult(); + + t.transform(new DOMSource(dom), r); + Assert.assertNotNull(r.getNode()); + + Node n = r.getNode().getFirstChild(); + r.setNode(n); + t.transform(new DOMSource(dom), r); + Assert.assertNotNull(r.getNode()); + Assert.assertSame(r.getNode(), n); + + r.setNextSibling(r.getNode().getFirstChild()); + t.transform(new DOMSource(dom), r); + Assert.assertNotNull(r.getNode()); + Assert.assertSame(r.getNode(), n); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6378043.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6378043.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6378043 + * @summary Test XPath expression "child::" can be parsed. + */ +public class Bug6378043 { + + static String SCHEMA_LANG = "http://www.w3.org/2001/XMLSchema"; + + @Test + public void testSelectorXPath() { + try { + Schema schema = SchemaFactory.newInstance(SCHEMA_LANG).newSchema(this.getClass().getResource("idI009.xsd")); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6449797.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6449797.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package javax.xml.validation; + +import javax.xml.XMLConstants; +import javax.xml.validation.SchemaFactory; + +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6449797 + * @summary Test SchemaFactory can parse the specified attribute value with a specified namespace. + */ +public class Bug6449797 { + + @Test + public void test() throws SAXException { + // this shouldn't fail + SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(getClass().getResource("Bug6449797.xsd")); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6449797.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6449797.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6457662.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6457662.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.StringReader; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6457662 + * @summary Test a Validator checks sequence maxOccurs correctly when it validates document repeatedly. + */ +public class Bug6457662 { + + public static final String xml = "" + "" + "CheetahTech" + + "CheetahView" + "" + ""; + /** Schema */ + public static final String schema = "" + + "" + + "" + "" + "" + + "" + "" + "" + + "" + "" + + "" + "" + + ""; + /** Schema factory */ + private static final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + + @Test + public void test() { + try { + final Schema sc = factory.newSchema(writeSchema()); + final Validator validator = sc.newValidator(); + validator.validate(new StreamSource(new StringReader(xml))); + validator.validate(new StreamSource(new StringReader(xml))); + validator.validate(new StreamSource(new StringReader(xml))); + validator.validate(new StreamSource(new StringReader(xml))); + } catch (Throwable ex) { + Assert.fail("Exception: " + ex.getMessage()); + } + } + + private File writeSchema() throws IOException { + final File rtn = File.createTempFile("scheam", "xsd"); + final OutputStream out = new FileOutputStream(rtn); + final OutputStreamWriter writer = new OutputStreamWriter(out, "UTF-8"); + writer.write(schema); + writer.close(); + out.close(); + return rtn; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,19 @@ + + + + + +
    + + Narayanan Jayaratchagan +
    +
    + +
    + + Daniel Steinberg +
    +
    +
    diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +/* + * @bug 6467424 + * @summary Test Validator augments the default delement value if feature element-default is on. + */ +public class Bug6467424Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + // System.setSecurityManager(new SecurityManager()); + try { + SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + File schemaLocation = new File(getClass().getResource("Bug6467424.xsd").getFile()); + Schema schema = factory.newSchema(schemaLocation); + Validator validator = schema.newValidator(); + + DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); + domFactory.setNamespaceAware(true); // never forget this + DocumentBuilder builder = domFactory.newDocumentBuilder(); + Document doc = builder.parse(new File(getClass().getResource("Bug6467424.xml").getFile())); + + DOMSource source = new DOMSource(doc); + DOMResult result = new DOMResult(); + + validator.validate(source, result); + Document augmented = (Document) result.getNode(); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + + Transformer transformer = tFactory.newTransformer(); + + DOMSource domSource = new DOMSource(augmented); + StringWriter sw = new StringWriter(); + // StreamResult streamResult = new StreamResult(System.out); + StreamResult streamResult = new StreamResult(sw); + transformer.transform(domSource, streamResult); + String s = sw.toString(); + if (s.indexOf("Schema Validation") == -1) { + Assert.fail("Failed: result is expected to be augmented"); + } + } + + catch (TransformerConfigurationException e) { + // e.printStackTrace(); + System.out.println(e.getMessage()); + } catch (TransformerException e) { + System.out.println(e.getMessage()); + } catch (SAXException e) { + System.out.println(e.getMessage()); + } catch (ParserConfigurationException e) { + System.out.println(e.getMessage()); + } catch (IOException e) { + System.out.println(e.getMessage()); + } + } + + /** + * this test is to make sure the element-default feature works for + * validation using DOM parser reference: parser feature: + * http://xerces.apache.org/xerces2-j/feature.html#validation + */ + @Test + public void testDOMValidation() throws Exception { + try { + DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); + // domFactory.setFeature("http://xml.org/sax/features/validation", + // true); + domFactory.setNamespaceAware(true); // never forget this + domFactory.setValidating(true); + + domFactory.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI); + domFactory.setAttribute(SCHEMA_SOURCE, Bug6467424Test.class.getResource("Bug6467424.xsd").toExternalForm()); + + domFactory.setFeature("http://apache.org/xml/features/validation/schema", true); + domFactory.setFeature("http://apache.org/xml/features/validation/schema/element-default", true); + DocumentBuilder builder = domFactory.newDocumentBuilder(); + Document doc = builder.parse(new File(getClass().getResource("Bug6467424.xml").getFile())); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + + Transformer transformer = tFactory.newTransformer(); + DOMSource domSource = new DOMSource(doc); + StringWriter sw = new StringWriter(); + // StreamResult streamResult = new StreamResult(System.out); + StreamResult streamResult = new StreamResult(sw); + transformer.transform(domSource, streamResult); + String s = sw.toString(); + if (s.indexOf("Schema Validation") == -1) { + Assert.fail("Failed: result is expected to be augmented"); + } + + } + + catch (TransformerConfigurationException e) { + System.out.println(e.getMessage()); + } catch (TransformerException e) { + System.out.println(e.getMessage()); + } catch (SAXException e) { + System.out.println(e.getMessage()); + } catch (ParserConfigurationException e) { + System.out.println(e.getMessage()); + } catch (IOException e) { + System.out.println(e.getMessage()); + } + } + + @Test + public void testDOMValidation1() throws Exception { + try { + DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); + // domFactory.setFeature("http://xml.org/sax/features/validation", + // true); + domFactory.setNamespaceAware(true); // never forget this + domFactory.setValidating(true); + + domFactory.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI); + domFactory.setAttribute(SCHEMA_SOURCE, Bug6467424Test.class.getResource("Bug6467424.xsd").toExternalForm()); + + domFactory.setFeature("http://apache.org/xml/features/validation/schema", true); + domFactory.setFeature("http://apache.org/xml/features/validation/schema/element-default", false); + DocumentBuilder builder = domFactory.newDocumentBuilder(); + Document doc = builder.parse(new File(getClass().getResource("Bug6467424.xml").getFile())); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + + Transformer transformer = tFactory.newTransformer(); + DOMSource domSource = new DOMSource(doc); + StringWriter sw = new StringWriter(); + // StreamResult streamResult = new StreamResult(System.out); + StreamResult streamResult = new StreamResult(sw); + transformer.transform(domSource, streamResult); + String s = sw.toString(); + if (s.indexOf("Schema Validation") > 0) { + Assert.fail("Failed: result is not expected to be augmented"); + } + + } + + catch (TransformerConfigurationException e) { + System.out.println(e.getMessage()); + } catch (TransformerException e) { + System.out.println(e.getMessage()); + } catch (SAXException e) { + System.out.println(e.getMessage()); + } catch (ParserConfigurationException e) { + System.out.println(e.getMessage()); + } catch (IOException e) { + System.out.println(e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6483188.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6483188.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.net.URL; + +import javax.xml.XMLConstants; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXParseException; + +/* + * @bug 6483188 + * @summary Test Schema Validator can handle element with having large maxOccurs, but doesn't accept sequence with having large maxOccurs in FEATURE_SECURE_PROCESSING mode. + */ +public class Bug6483188 { + static boolean _isSecureMode = false; + static { + if (System.getSecurityManager() != null) { + _isSecureMode = true; + System.out.println("Security Manager is present"); + } else { + System.out.println("Security Manager is NOT present"); + } + } + + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + + @Test + public void testLargeElementNoSecurity() { + if (_isSecureMode) + return; // jaxp secure feature can not be turned off when security + // manager is present + try { + sf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.FALSE); + URL url = getClass().getResource("test-element.xsd"); + Schema s = sf.newSchema(url); + Validator v = s.newValidator(); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + @Test + public void testLargeElementWithSecurity() { + try { + sf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); + URL url = getClass().getResource("test-element.xsd"); + Schema s = sf.newSchema(url); + Validator v = s.newValidator(); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + + @Test + public void testLargeSequenceWithSecurity() { + try { + sf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); + URL url = getClass().getResource("test-sequence.xsd"); + Schema s = sf.newSchema(url); + Validator v = s.newValidator(); + Assert.fail("Schema was accepted even with secure processing enabled."); + } catch (SAXParseException e) { + // falls through - exception expected + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import org.testng.annotations.Test; +import org.w3c.dom.Document; + +/* + * @bug 6493687 + * @summary Test validator.validate(new DOMSource(node)) without any exception. + */ +public class Bug6493687 { + + @Test + public void test() throws Exception { + System.out.println("Got here"); + Document doc = new XMLDocBuilder("Bug6493687.xml", "UTF-8", "Bug6493687.xsd").getDocument(); + System.out.println("Got here2"); + System.out.println(doc); + System.out.println(doc.getDocumentElement().getNodeName()); + System.out.println("Got here3"); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6509668.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6509668.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.TypeInfoProvider; +import javax.xml.validation.ValidatorHandler; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.TypeInfo; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6509668 + * @summary Test TypeInfoProvider.getElementTypeInfo() for union type when startElement and endElement. + */ +public class Bug6509668 { + + public static final String XSD = "\n" + "\n" + + " \n" + " \n" + " \n" + + " \n" + "\n"; + + public static final String XML = "\n" + "abc\n"; + + private ValidatorHandler createValidatorHandler(String xsd) throws SAXException { + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(xsd.getBytes())); + StreamSource xsdSource = new StreamSource(reader); + + Schema schema = schemaFactory.newSchema(xsdSource); + return schema.newValidatorHandler(); + } + + private XMLReader createXMLReader() throws ParserConfigurationException, SAXException { + SAXParserFactory parserFactory = SAXParserFactory.newInstance(); + if (!parserFactory.isNamespaceAware()) { + parserFactory.setNamespaceAware(true); + } + + return parserFactory.newSAXParser().getXMLReader(); + } + + private void parse(XMLReader xmlReader, String xml) throws SAXException, IOException { + InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(xml.getBytes())); + InputSource inSource = new InputSource(reader); + + xmlReader.parse(inSource); + } + + @Test + public void testGetElementTypeInfo() throws ParserConfigurationException, SAXException, IOException { + XMLReader xmlReader; + xmlReader = createXMLReader(); + + final ValidatorHandler validatorHandler; + validatorHandler = createValidatorHandler(XSD); + + xmlReader.setContentHandler(validatorHandler); + + DefaultHandler handler = new DefaultHandler() { + public void startElement(String uri, String localName, String qName, Attributes attr) throws SAXException { + TypeInfoProvider infoProvider = null; + synchronized (validatorHandler) { + infoProvider = validatorHandler.getTypeInfoProvider(); + } + if (infoProvider == null) { + throw new SAXException("Can't obtain TypeInfoProvider object."); + } + + try { + TypeInfo typeInfo = infoProvider.getElementTypeInfo(); + Assert.assertEquals(typeInfo.getTypeName(), "intOrString"); + } catch (IllegalStateException e) { + System.out.println(e); + throw new SAXException("Unexpected IllegalStateException was thrown."); + } + } + + public void endElement(String uri, String localName, String qName) throws SAXException { + TypeInfoProvider infoProvider = null; + synchronized (validatorHandler) { + infoProvider = validatorHandler.getTypeInfoProvider(); + } + if (infoProvider == null) { + throw new SAXException("Can't obtain TypeInfoProvider object."); + } + + try { + TypeInfo typeInfo = infoProvider.getElementTypeInfo(); + Assert.assertEquals(typeInfo.getTypeName(), "string"); + } catch (IllegalStateException e) { + System.out.println(e); + throw new SAXException("Unexpected IllegalStateException was thrown."); + } + } + }; + validatorHandler.setContentHandler(handler); + + parse(xmlReader, XML); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +/* + * @bug 6526547 + * @summary Test document parsed without setting NamespaceAware can be validated with a Schema. + */ +public class Bug6526547 { + + @Test + public void test() { + try { + // parse an XML document into a DOM tree + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder parser = dbf.newDocumentBuilder(); + Assert.assertFalse(parser.isNamespaceAware()); + Document document = parser.parse(getClass().getResourceAsStream("Bug6526547.xml")); + + // create a SchemaFactory capable of understanding WXS schemas + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + + // load a WXS schema, represented by a Schema instance + Source schemaFile = new StreamSource(getClass().getResourceAsStream("Bug6526547.xsd")); + Schema schema = factory.newSchema(schemaFile); + + // create a Validator instance, which can be used to validate an + // instance document + Validator validator = schema.newValidator(); + + // validate the DOM tree + try { + validator.validate(new DOMSource(document)); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("Document is reported as invalid but it is not!"); + } + } catch (Exception e) { + Assert.fail("Unable to configure validator"); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6531160.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6531160.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.StringReader; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXParseException; + +/* + * @bug 6531160 + * @summary Test document generated by newDocument() can be validated with a Schema. + */ +public class Bug6531160 { + + private static final String XSD = "\n" + " \n" + + ""; + + @Test + public void testDOMLevel1Validation() throws Exception { + SchemaFactory fact = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = fact.newSchema(new StreamSource(new StringReader(XSD))); + DocumentBuilderFactory docfact = DocumentBuilderFactory.newInstance(); + docfact.setNamespaceAware(true); + + Document doc = docfact.newDocumentBuilder().newDocument(); + doc.appendChild(doc.createElement("root")); + + try { + schema.newValidator().validate(new DOMSource(doc)); + } catch (SAXParseException e) { + Assert.fail("Validation failed: " + e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,6 @@ + + + + commentZZZZZZZZZZZZZZZZZZ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.IOException; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +/* + * @bug 6695843 + * @summary Test Validator should report accurate element type if there is a violation on a complexType with simpleContent that extends a base complexType. + */ +public class Bug6695843Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void testValidateComplexTypeWithSimpleContent() throws IOException, ParserConfigurationException, SAXException { + try { + DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance(); + dFactory.setNamespaceAware(true); + + DocumentBuilder dBuilder = dFactory.newDocumentBuilder(); + Document document = dBuilder.parse(getClass().getResourceAsStream("Bug6695843.xsd")); + DOMSource domSource = new DOMSource(document); + + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = schemaFactory.newSchema(domSource); + + String xmlFileName = "Bug6695843.xml"; + Document document1 = dBuilder.parse(getClass().getResourceAsStream(xmlFileName)); + DOMSource domSource1 = new DOMSource(document1); + + Validator validator = schema.newValidator(); + validator.validate(domSource1); + } catch (Exception e) { + String msg = e.getMessage(); + System.out.println(e.getMessage()); + if (msg.indexOf("maxLength '20' for type 'null'") > 0) { + Assert.fail("vague error message"); + } + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_1.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_1.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_10.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_10.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_11.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_11.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_12.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_12.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_13.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_13.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_14.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_14.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_15.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_15.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_16.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_16.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_17.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_17.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_18.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_18.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_19.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_19.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_2.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_20.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_20.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_21.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_21.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_22.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_22.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_23.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_23.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_24.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_24.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_25.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_25.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_3.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_3.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_4.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_4.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_5.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_5.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_6.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_6.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_7.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_7.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_8.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_8.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_9.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_9.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ + + + + b972115d-829e-43ff-aebb-c7157ef25c71 + 01AP + A9901017 + A0500823 + 221 + + + 89 + 01AP + 2008 + A + 68 + KJ091 + 5000 + + + 97 + + + + + LL091 + 68700 + + + 98 + + + + + HH098 + 8000 + + + 96 + + + + + PO091 + 7500 + + + 92 + + + + + 098 + 14000 + + + + + 21 + EF01 + 26800 + + + 22 + G + 15000 + + + 20 + HH + 9810 + + + 20 + DEE + 51590 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.util.concurrent.BrokenBarrierException; +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @bug 6773084 + * @summary Test Schema object is thread safe. + */ +public class Bug6773084Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + private static final int NTHREADS = 25; + private static final ExecutorService EXEC = Executors.newCachedThreadPool(); + + private static final CyclicBarrier BARRIER = new CyclicBarrier(NTHREADS); + + public static final String IN_FOLDER = Bug6773084Test.class.getResource("Bug6773084In").getPath(); + public static final String XSD_PATH = Bug6773084Test.class.getResource("Bug6773084.xsd").getPath(); + + private static Schema schema; + + @BeforeClass + public void setup(){ + policy.PolicyUtil.changePolicy(getClass().getResource("6773084.policy").getFile()); + } + + @Test + public void test() throws Exception { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Source schemaFile = new StreamSource(XSD_PATH); + try { + schema = factory.newSchema(schemaFile); + } catch (SAXException e) { + e.printStackTrace(); + System.exit(-1); + } + + File incoming = new File(IN_FOLDER); + File[] files = incoming.listFiles(new FileFilter() { + public boolean accept(File file) { + return file.isFile() && file.getName().endsWith(".xml"); + } + }); + + for (int i = 0; i < files.length; i++) { + EXEC.execute(new XMLValiddator(files[i], i)); + } + EXEC.shutdown(); + + } + + private static class XMLValiddator implements Runnable { + + private File file; + private int index; + + public XMLValiddator(File file, int index) { + this.file = file; + this.index = index; + } + + public void run() { + + try { + System.out.printf("Waiting for barrier: %s%n", index); + BARRIER.await(); + System.out.println("Validating...."); + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + + DocumentBuilder builder = factory.newDocumentBuilder(); + Document document = builder.parse(file); + + Validator validator = schema.newValidator(); + validator.setErrorHandler(new ErrorHandlerImpl()); + validator.validate(new DOMSource(document)); + + } catch (IOException e) { + e.printStackTrace(); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("Test failed."); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } catch (BrokenBarrierException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + } + } + + private static class ErrorHandlerImpl implements ErrorHandler { + + public void warning(SAXParseException exception) throws SAXException { + System.out + .printf("**Parsing Warning. Line: %s URI: %s Message: %s%n", exception.getLineNumber(), exception.getSystemId(), exception.getMessage()); + } + + public void error(SAXParseException exception) throws SAXException { + String msg = String.format("**Parsing Error. Line: %s URI: %s Message: %s%n", exception.getLineNumber(), exception.getSystemId(), + exception.getMessage()); + System.out.println(msg); + throw new SAXException(msg); + } + + public void fatalError(SAXParseException exception) throws SAXException { + String msg = String.format("**Parsing Fatal Error. Line: %s URI: %s Message: %s%n", exception.getLineNumber(), exception.getSystemId(), + exception.getMessage()); + System.out.println(msg); + throw new SAXException(msg); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6859210.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6859210.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @bug 6859210 + * @summary Test Schema Validator can parse xml when maxOccurs is large. + */ +public class Bug6859210 { + + boolean errorFound; + + DocumentBuilder documentBuilder; + + private void printMethodName() { + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + System.out.println(stack[2].getMethodName()); + } + + public Bug6859210() throws Exception { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new File(getClass().getResource("CREMAS01.xsd").getFile())); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setSchema(schema); + + documentBuilder = dbf.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException e) throws SAXException { + System.out.println("Error: " + e.getMessage()); + errorFound = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("Fatal error: " + e.getMessage()); + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("Warning: " + e.getMessage()); + } + }); + } + + @Test + public void testGeneratedSample() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("CREMAS01.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (errorFound) { + Assert.fail("Unexpected validation error reported"); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6925531Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6925531Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.security.AccessController; +import java.security.AllPermission; +import java.security.Permission; +import java.security.Permissions; +import java.security.PrivilegedAction; + +import javax.xml.XMLConstants; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; + +/* + * @bug 6925531 + * @summary Test Validator can validate SAXSource when SecurityManager is set or FEATURE_SECURE_PROCESSING is on. + */ +public class Bug6925531Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + String xsd = "\n" + "\n" + " \n" + + "\n"; + + String xml = "\n" + "\n" + " abc\n" + "\n"; + + StreamSource xsdSource; + SAXSource xmlSource; + + public void init() { + InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(xsd.getBytes())); + xsdSource = new StreamSource(reader); + reader = new InputStreamReader(new ByteArrayInputStream(xml.getBytes())); + InputSource inSource = new InputSource(reader); + xmlSource = new SAXSource(inSource); + } + + /** + * when security manager is present, secure feature is on automatically + */ + @Test + public void test_SM() { + init(); + Permissions granted = new java.security.Permissions(); + granted.add(new AllPermission()); + + System.setSecurityManager(new MySM(granted)); + + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + Schema schema = null; + try { + schema = schemaFactory.newSchema(xsdSource); + } catch (SAXException e) { + Assert.fail(e.toString()); + } + + Validator validator = schema.newValidator(); + + try { + validator.validate(xmlSource, null); + } catch (SAXException e) { + Assert.fail(e.toString()); + } catch (IOException e) { + Assert.fail(e.toString()); + } finally { + System.setSecurityManager(null); + } + + System.out.println("OK"); + } + + /** + * set secure feature on SchemaFactory + */ + @Test + public void test_SF() { + init(); + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + System.setSecurityManager(null); + return null; // nothing to return + } + }); + + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + try { + schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + } catch (SAXNotRecognizedException ex) { + System.out.println(ex.getMessage()); + } catch (SAXNotSupportedException ex) { + System.out.println(ex.getMessage()); + } + + Schema schema = null; + try { + schema = schemaFactory.newSchema(xsdSource); + } catch (SAXException e) { + Assert.fail(e.toString()); + } + + Validator validator = schema.newValidator(); + + try { + validator.validate(xmlSource, null); + } catch (SAXException e) { + Assert.fail(e.toString()); + } catch (IOException e) { + Assert.fail(e.toString()); + } + System.out.println("OK"); + } + + /** + * set secure feature on the Validator + */ + @Test + public void test_Val() { + init(); + System.setSecurityManager(null); + SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + + Schema schema = null; + try { + schema = schemaFactory.newSchema(xsdSource); + } catch (SAXException e) { + Assert.fail(e.toString()); + } + + Validator validator = schema.newValidator(); + try { + validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + } catch (SAXNotRecognizedException ex) { + System.out.println(ex.getMessage()); + } catch (SAXNotSupportedException ex) { + System.out.println(ex.getMessage()); + } + + try { + validator.validate(xmlSource, null); + } catch (SAXException e) { + Assert.fail(e.toString()); + } catch (IOException e) { + Assert.fail(e.toString()); + } + System.out.println("OK"); + } + + class MySM extends SecurityManager { + Permissions granted; + + public MySM(Permissions perms) { + granted = perms; + } + + /** + * The central point in checking permissions. Overridden from + * java.lang.SecurityManager + * + * @param perm The permission requested. + */ + @Override + public void checkPermission(Permission perm) { + if (granted.implies(perm)) { + return; + } + super.checkPermission(perm); + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6946312.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6946312.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,4 @@ + +text + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6946312Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6946312Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.Attributes; +import org.xml.sax.ContentHandler; +import org.xml.sax.InputSource; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +/* + * @bug 6946312 + * @summary Test XML parser shall callback to ContentHandler when receiving characters data. + */ +public class Bug6946312Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + String xmlSchema = "\n" + "\n" + "\n" + + "\n" + "\n" + "\n" + "\n" + "\n" + + ""; + + boolean charEvent = false; + + @Test + public void test() throws SAXException, ParserConfigurationException, IOException { + Schema schema = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema").newSchema(new StreamSource(new StringReader(xmlSchema))); + + SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); + saxParserFactory.setNamespaceAware(true); + saxParserFactory.setSchema(schema); + // saxParserFactory.setFeature("http://java.sun.com/xml/schema/features/report-ignored-element-content-whitespace", + // true); + + SAXParser saxParser = saxParserFactory.newSAXParser(); + + XMLReader xmlReader = saxParser.getXMLReader(); + + xmlReader.setContentHandler(new MyContentHandler()); + + // InputStream input = + // ClassLoader.getSystemClassLoader().getResourceAsStream("test/test.xml"); + + InputStream input = getClass().getResourceAsStream("Bug6946312.xml"); + System.out.println("Parse InputStream:"); + xmlReader.parse(new InputSource(input)); + if (!charEvent) { + Assert.fail("missing character event"); + } + } + + public class MyContentHandler implements ContentHandler { + public void characters(char[] ch, int start, int length) { + charEvent = true; + System.out.println("Characters called: " + new String(ch, start, length)); + } + + public void endDocument() throws SAXException { + } + + public void endElement(String arg0, String arg1, String arg2) throws SAXException { + } + + public void endPrefixMapping(String arg0) throws SAXException { + } + + public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { + System.out.println("ignorableWhitespace called: " + new String(ch, start, length)); + } + + public void processingInstruction(String arg0, String arg1) throws SAXException { + } + + public void setDocumentLocator(Locator arg0) { + } + + public void skippedEntity(String arg0) throws SAXException { + } + + public void startDocument() throws SAXException { + } + + public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException { + } + + public void startPrefixMapping(String arg0, String arg1) throws SAXException { + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,4 @@ + + + 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738_Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738_Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.IOException; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; + +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @bug 6954738 + * @summary Test Validator can process a XML document containing an element with 8000 characters. + */ +public class Bug6954738_Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + //if StackOverflowError is thrown, it shall escape from both the ErrorHandler and catch block + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + + Schema schema = schemaFactory.newSchema(new StreamSource(Bug6954738_Test.class.getResourceAsStream("Bug6954738.xsd"))); + Validator validator = schema.newValidator(); + validator.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException exception) throws SAXException { + exception.printStackTrace(); + } + + public void fatalError(SAXParseException exception) throws SAXException { + exception.printStackTrace(); + } + + public void warning(SAXParseException exception) throws SAXException { + exception.printStackTrace(); + } + }); + validator.validate(new StreamSource(Bug6954738_Test.class.getResourceAsStream("Bug6954738.xml"))); + + } catch (SAXException e) { + System.out.println(e.getMessage()); + + } catch (IOException e) { + e.printStackTrace(); + System.out.println(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6708840Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6708840Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; +import java.io.FileWriter; + +import javax.xml.XMLConstants; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamReader; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.stax.StAXSource; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6708840 + * @summary Test Validator can process StAXSource. + */ +public class CR6708840Test { + + @Test + public final void testStream() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schemaGrammar = schemaFactory.newSchema(new File(getClass().getResource("gMonths.xsd").getFile())); + + Validator schemaValidator = schemaGrammar.newValidator(); + Source xmlSource = new javax.xml.transform.stream.StreamSource(new File(CR6708840Test.class.getResource("gMonths.xml").toURI())); + schemaValidator.validate(xmlSource); + + } catch (NullPointerException ne) { + Assert.fail("NullPointerException when result is not specified."); + } catch (Exception e) { + Assert.fail(e.getMessage()); + e.printStackTrace(); + } + } + + /** + * refer to http://forums.java.net/jive/thread.jspa?threadID=41626&tstart=0 + */ + @Test + public final void testStAX() { + try { + XMLInputFactory xmlif = XMLInputFactory.newInstance(); + + // XMLStreamReader staxReader = + // xmlif.createXMLStreamReader((Source)new + // StreamSource(getClass().getResource("Forum31576.xml").getFile())); + XMLStreamReader staxReader = xmlif.createXMLStreamReader(this.getClass().getResourceAsStream("gMonths.xml")); + + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schemaGrammar = schemaFactory.newSchema(new File(getClass().getResource("gMonths.xsd").getFile())); + + Validator schemaValidator = schemaGrammar.newValidator(); + + Source staxSrc = new StAXSource(staxReader); + schemaValidator.validate(staxSrc); + + while (staxReader.hasNext()) { + int eventType = staxReader.next(); + System.out.println("Event of type: " + eventType); + } + } catch (NullPointerException ne) { + Assert.fail("NullPointerException when result is not specified."); + } catch (Exception e) { + Assert.fail(e.getMessage()); + e.printStackTrace(); + } + } + + /** + * workaround before the fix: provide a result + */ + @Test + public final void testStAXWResult() { + try { + XMLInputFactory xmlif = XMLInputFactory.newInstance(); + + // XMLStreamReader staxReader = + // xmlif.createXMLStreamReader((Source)new + // StreamSource(getClass().getResource("Forum31576.xml").getFile())); + XMLStreamReader staxReader = xmlif.createXMLStreamReader(this.getClass().getResourceAsStream("gMonths.xml")); + + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schemaGrammar = schemaFactory.newSchema(new File(getClass().getResource("gMonths.xsd").getFile())); + + Validator schemaValidator = schemaGrammar.newValidator(); + + Source staxSrc = new StAXSource(staxReader); + File resultFile = new File("gMonths.result.xml"); + if (resultFile.exists()) { + resultFile.delete(); + } + + Result xmlResult = new javax.xml.transform.stax.StAXResult(XMLOutputFactory.newInstance().createXMLStreamWriter(new FileWriter(resultFile))); + schemaValidator.validate(staxSrc, xmlResult); + + while (staxReader.hasNext()) { + int eventType = staxReader.next(); + System.out.println("Event of type: " + eventType); + } + } catch (Exception e) { + Assert.fail(e.getMessage()); + e.printStackTrace(); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.IOException; +import java.io.InputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.annotations.Test; +import org.testng.Assert; +import org.w3c.dom.Document; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @bug 6740048 + * @summary Test DocumentBuilder can be reused when the DocumentBuilderFactory sets schema. + */ +public class CR6740048 { + private static final String TAG_INFO = "containerInfo"; + private static final String SCHEMA_LANGUAGE_URL = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + private static final String SCHEMA_SOURCE_URL = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + private static final String XML_SCHEMA_URL = "http://www.w3.org/2001/XMLSchema"; + + @Test + public final void testReusingDocumentBuilder() { + + try { + //ClassLoader loader = CR6740048.class.getClassLoader(); + + // Object xsd = loader.getResourceAsStream("CR6740048.xsd"); + InputStream xsd = this.getClass().getResourceAsStream("CR6740048.xsd"); + // create document builder + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); + docBuilderFactory.setNamespaceAware(true); + + if (xsd != null) { + docBuilderFactory.setValidating(true); + docBuilderFactory.setAttribute(SCHEMA_LANGUAGE_URL, XML_SCHEMA_URL); + docBuilderFactory.setAttribute(SCHEMA_SOURCE_URL, xsd); + } + + final DocumentBuilder documentBuilder = docBuilderFactory.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + + public void error(SAXParseException exception) throws SAXException { + throw exception; + } + + public void fatalError(SAXParseException exception) throws SAXException { + throw exception; + } + + public void warning(SAXParseException exception) throws SAXException { + throw exception; + } + }); + + // TODO set the system properties in order to match the ones from + // the server environment + /** + * Properties props = new Properties(); + * props.load(loader.getResourceAsStream("sysprops.properties")); + * System.setProperties(props); + */ + + // now parse the document + // InputStream is = loader.getResourceAsStream("CR6740048.xml"); + InputStream is = this.getClass().getResourceAsStream("CR6740048.xml"); + try { + Document doc = documentBuilder.parse(is); + } catch (Exception se) { + + se.printStackTrace(); + Assert.fail(se.getMessage()); + + } finally { + is.close(); + } + + // now use the parser object as second time + // is = loader.getResourceAsStream("CR6740048.xml"); + is = this.getClass().getResourceAsStream("CR6740048.xml"); + try { + Document doc = documentBuilder.parse(is); + } catch (Exception se) { + + se.printStackTrace(); + Assert.fail(se.getMessage()); + + } finally { + is.close(); + } + + System.err.println("Parse successful"); + + is.close(); + } catch (ParserConfigurationException pce) { + pce.printStackTrace(); + } catch (IOException ioe) { + ioe.printStackTrace(); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ + +falseresource80.stoppedJ2EEtruetruefalse + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CREMAS01.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CREMAS01.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,1138 @@ + + + + + + + + EDI_DC40 + + + + + 1 + + + + CREMAS01 + + CREMAS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CREMAS01.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CREMAS01.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3541 @@ + + + + + + + + + + + + Segment for general vendor data + + + + + + + Function + + + + + + + + + + + + Account number of the vendor or creditor + + + + + + + + + + + + Title + + + + + + + + + + + + Train station + + + + + + + + + + + + International location number (part 1) + + + + + + + + + + + + International location number (part 2) + + + + + + + + + + + + Authorization group + + + + + + + + + + + + Industry key + + + + + + + + + + + + Check digit for the international location number + + + + + + + + + + + + Number of data communication line + + + + + + + + + + + + Indicator 'report to Central Bank' for data medium exchange + + + + + + + + + + + + Instruction key for data medium exchange + + + + + + + + + + + + Date on which the record was created + + + + + + + + + + + + Name of person who created object + + + + + + + + + + + + POR subscriber number + + + + + + + + + + + + Group key + + + + + + + + + + + + Vendor account group + + + + + + + + + + + + Customer number + + + + + + + + + + + + Country of company + + + + + + + + + + + + Account number of the vendor or creditor + + + + + + + + + + + + Central deletion flag for master record + + + + + + + + + + + + Last name of employee + + + + + + + + + + + + Last name of employee + + + + + + + + + + + + Last name of employee + + + + + + + + + + + + Last name of employee + + + + + + + + + + + + City + + + + + + + + + + + + District + + + + + + + + + + + + Post office box + + + + + + + + + + + + Postal code + + + + + + + + + + + + Postal code + + + + + + + + + + + + Region (State, Province, County) + + + + + + + + + + + + Character field length = 10 + + + + + + + + + + + + Central posting block + + + + + + + + + + + + Centrally imposed purchasing block + + + + + + + + + + + + Language keys + + + + + + + + + + + + Tax number 1 + + + + + + + + + + + + Tax number 2 + + + + + + + + + + + + Indicator: Business partner subject to equalization tax ? + + + + + + + + + + + + Indicator: Business partner subject to tax on sales/purch. ? + + + + + + + + + + + + Street and house number + + + + + + + + + + + + Telebox number + + + + + + + + + + + + First telephone number + + + + + + + + + + + + Second telephone number + + + + + + + + + + + + Fax number + + + + + + + + + + + + Teletex number + + + + + + + + + + + + Telex number + + + + + + + + + + + + Indicator: Is the account a one-time account? + + + + + + + + + + + + Indicator: Alternative payee in document allowed ? + + + + + + + + + + + + Company ID of trading partner + + + + + + + + + + + + Account number of the master record with fiscal address + + + + + + + + + + + + VAT registration number + + + + + + + + + + + + Indicator: Business partner a sole proprietor ? + + + + + + + + + + + + Functions that will be blocked + + + + + + + + + + + + Address + + + + + + + + + + + + Search string for matchcode usage + + + + + + + + + + + + Search string for using matchcodes + + + + + + + + + + + + Search string for matchcode usage + + + + + + + + + + + + Place of birth of the person subject to withholding tax + + + + + + + + + + + + Date of birth + + + + + + + + + + + + Key for the sex of the person subject to withholding tax + + + + + + + + + + + + Credit information number + + + + + + + + + + + + Last review (external) + + + + + + + + + + + + Vendor's QM system + + + + + + + + + + + + Reference account group for one-time account (vendor) + + + + + + + + + + + + PO box city + + + + + + + + + + + + Plant + + + + + + + + + + + + Indicator: vendor sub-range relevant + + + + + + + + + + + + Indicator: plant level relevant + + + + + + + + + + + + Factory calendar key + + + + + + + + + + + + Status of data transfer into subsequent release + + + + + + + + + + + + Jurisdiction for tax calculation - tax jurisdiction code + + + + + + + + + + + + + + + + + + + + Segment for bank details of vendor SMD + + + + + + + Function + + + + + + + + + + + + Account number of the vendor or creditor + + + + + + + + + + + + Bank country key + + + + + + + + + + + + Bank key + + + + + + + + + + + + Bank account number + + + + + + + + + + + + Bank control key + + + + + + + + + + + + Partner bank type + + + + + + + + + + + + Indicator: Is there collection authorization ? + + + + + + + + + + + + Name of the bank + + + + + + + + + + + + Region (no longer used as of release 3.0D!!!) + + + + + + + + + + + + Street (no longer used as of release 3.0D!!!) + + + + + + + + + + + + Location + + + + + + + + + + + + SWIFT code for international payments + + + + + + + + + + + + Bank group (bank network) + + + + + + + + + + + + Checkbox + + + + + + + + + + + + Bank number + + + + + + + + + + + + Post office bank current account number + + + + + + + + + + + + Reference specifications for bank details + + + + + + + + + + + + Bank branch + + + + + + + + + + + + Region (State, Province, County) + + + + + + + + + + + + Street and house number + + + + + + + + + + + + City + + + + + + + + + + + + + + + Reminder data for vendor SMD + + + + + + + Function + + + + + + + + + + + + Account number of the vendor or creditor + + + + + + + + + + + + Company code + + + + + + + + + + + + Dunning area + + + + + + + + + + + + Dunning procedure + + + + + + + + + + + + Dunning block + + + + + + + + + + + + Last dunned on + + + + + + + + + + + + Character field of length 1 + + + + + + + + + + + + Account number of the dunning recipient + + + + + + + + + + + + Date of the legal dunning proceedings + + + + + + + + + + + + Accounting clerk + + + + + + + + + + + + + + + + + TABNAM + + + + + + + MANDT + + + + + + + + + + + + DOCNUM + + + + + + + + + + + + DOCREL + + + + + + + + + + + + STATUS + + + + + + + + + + + + DIRECT + + + + + + + + Outbound + + + + + + + Inbound + + + + + + + + + + OUTMOD + + + + + + + + + + + + EXPRSS + + + + + + + + + + + + TEST + + + + + + + + + + + + IDOCTYP + + + + + + + CIMTYP + + + + + + + + + + + + MESTYP + + + + + + + MESCOD + + + + + + + + + + + + MESFCT + + + + + + + + + + + + STD + + + + + + + + + + + + STDVRS + + + + + + + + + + + + STDMES + + + + + + + + + + + + SNDPOR + + + + + + + + + + + + SNDPRT + + + + + + + + + + + + SNDPFC + + + + + + + + + + + + SNDPRN + + + + + + + + + + + + SNDSAD + + + + + + + + + + + + SNDLAD + + + + + + + + + + + + RCVPOR + + + + + + + + + + + + RCVPRT + + + + + + + + + + + + RCVPFC + + + + + + + + + + + + RCVPRN + + + + + + + + + + + + RCVSAD + + + + + + + + + + + + RCVLAD + + + + + + + + + + + + CREDAT + + + + + + + + + + + + CRETIM + + + + + + + + + + + + REFINT + + + + + + + + + + + + REFGRP + + + + + + + + + + + + REFMES + + + + + + + + + + + + ARCKEY + + + + + + + + + + + + SERIAL + + + + + + + + + + + + + + + Segment for EU tax numbers vendors + + + + + + + Function + + + + + + + + + + + + Account number of the vendor or creditor + + + + + + + + + + + + Country key + + + + + + + + + + + + VAT registration number + + + + + + + + + + + + + + + Segment for vendor sub-range identification SMD + + + + + + + Function + + + + + + + + + + + + Language keys + + + + + + + + + + + + Account number of the vendor or creditor + + + + + + + + + + + + Vendor sub-range + + + + + + + + + + + + Description + + + + + + + + + + + + + + + Segment purchasing data for vendor MMS SMD + + + + + + + Function + + + + + + + + + + + + Account number of the vendor or creditor + + + + + + + + + + + + Purchasing organization + + + + + + + + + + + + Vendor sub-range + + + + + + + + + + + + Plant + + + + + + + + + + + + Date on which the record was created + + + + + + + + + + + + Name of person who created object + + + + + + + + + + + + Purchasing block at purchasing organization level + + + + + + + + + + + + Deletion indicator + + + + + + + + + + + + ABC indicator + + + + + + + + + + + + Purchase order currency + + + + + + + + + + + + Responsible salesperson at vendor's office + + + + + + + + + + + + Vendor's telephone number + + + + + + + + + + + + Minimum order value + + + + + + + + + + + + Terms of payment key + + + + + + + + + + + + Incoterms (part 1) + + + + + + + + + + + + Incoterms (part 2) + + + + + + + + + + + + Indicator: GR-based invoice verification + + + + + + + + + + + + Indicator: acknowledgment required + + + + + + + + + + + + Group for calculation schema (vendor) + + + + + + + + + + + + Automatic generation of purchase order allowed + + + + + + + + + + + + Mode of transport (when goods cross border) + + + + + + + + + + + + Customs office + + + + + + + + + + + + Pricing date control + + + + + + + + + + + + Purchasing group + + + + + + + + + + + + Indicator: vendor subject to subseq. settlement accounting + + + + + + + + + + + + Comparison/agreement of business volumes necessary + + + + + + + + + + + + Evaluated receipt settlement (ERS) + + + + + + + + + + + + Planned delivery time in days + + + + + + + + + + + + Planning calendar + + + + + + + + + + + + Planning cycle + + + + + + + + + + + + Delivery cycle + + + + + + + + + + + + Purchase order entry: vendor + + + + + + + + + + + + Price marking, vendor + + + + + + + + + + + + Rack-jobbing: vendor + + + + + + + + + + + + MRP controller + + + + + + + + + + + + + + + Segment for company code data for vendors SMD + + + + + + + Function + + + + + + + + + + + + Account number of the vendor or creditor + + + + + + + + + + + + Company code + + + + + + + + + + + + Date on which the record was created + + + + + + + + + + + + Name of person who created object + + + + + + + + + + + + Posting block for company code + + + + + + + + + + + + Deletion flag for master record (company code level) + + + + + + + + + + + + Key for sorting according to allocation numbers + + + + + + + + + + + + Reconciliation account in general ledger + + + + + + + + + + + + Authorization group + + + + + + + + + + + + Interest calculation indicator + + + + + + + + + + + + List of the payment methods to be considered + + + + + + + + + + + + Indicator: Clearing between customer and vendor? + + + + + + + + + + + + Block key for payment + + + + + + + + + + + + Terms of payment key + + + + + + + + + + + + Our account number at the customer or vendor + + + + + + + + + + + + User at vendor + + + + + + + + + + + + Memo + + + + + + + + + + + + Planning group + + + + + + + + + + + + Accounting clerk + + + + + + + + + + + + Head office account number + + + + + + + + + + + + Account number of the alternative payee + + + + + + + + + + + + Key date of the last interest calculation + + + + + + + + + + + + Interest calculation frequency in months + + + + + + + + + + + + Date of the last interest calculation run + + + + + + + + + + + + Indicator: local processing? + + + + + + + + + + + + Bill of exchange limit (in local currency) + + + + + + + + + + + + Probable time until check is paid + + + + + + + + + + + + Check flag for double invoices or credit memos + + + + + + + + + + + + Tolerance group for the business partner + + + + + + + + + + + + Short key for a house bank + + + + + + + + + + + + Indicator: Pay all items separately ? + + + + + + + + + + + + Certificate number of the withholding tax exemption + + + + + + + + + + + + Validity date for withholding tax exemption certificate + + + + + + + + + + + + Withholding tax code + + + + + + + + + + + + Subsidy indicator for determining the reduction rates + + + + + + + + + + + + Minority indicators + + + + + + + + + + + + Previous master record number + + + + + + + + + + + + Key for payment grouping + + + + + + + + + + + + Key for dunning notice grouping + + + + + + + + + + + + Payment method supplement + + + + + + + + + + + + Vendor recipient type + + + + + + + + + + + + Authority for exemption from withholding tax + + + + + + + + + + + + Withholding tax country key + + + + + + + + + + + + Indicator: send payment advices by EDI + + + + + + + + + + + + Release approval group + + + + + + + + + + + + Accounting clerk's fax number at the customer/vendor + + + + + + + + + + + + + + + + Segment for purchasing organization data vendor SMD + + + + + + + Function + + + + + + + + + + + + Vendor's account number + + + + + + + + + + + + Purchasing organization + + + + + + + + + + + + Date on which the record was created + + + + + + + + + + + + Name of person who created object + + + + + + + + + + + + Purchasing block at purchasing organization level + + + + + + + + + + + + Delete flag for vendor at purchasing level + + + + + + + + + + + + ABC indicator + + + + + + + + + + + + Purchase order currency + + + + + + + + + + + + Responsible salesperson at vendor's office + + + + + + + + + + + + Vendor's telephone number + + + + + + + + + + + + Minimum order value + + + + + + + + + + + + Terms of payment key + + + + + + + + + + + + Incoterms (part 1) + + + + + + + + + + + + Incoterms (part 2) + + + + + + + + + + + + Indicator: GR-based invoice verification + + + + + + + + + + + + Indicator: acknowledgment required + + + + + + + + + + + + Group for calculation schema (vendor) + + + + + + + + + + + + Automatic generation of purchase order allowed + + + + + + + + + + + + Mode of transport (when goods cross border) + + + + + + + + + + + + Customs office + + + + + + + + + + + + Pricing date control + + + + + + + + + + + + Purchasing group + + + + + + + + + + + + Indicator: vendor subject to subseq. settlement accounting + + + + + + + + + + + + Comparison/agreement of business volumes necessary + + + + + + + + + + + + Evaluated receipt settlement (ERS) + + + + + + + + + + + + Planned delivery time in days + + + + + + + + + + + + Planning calendar + + + + + + + + + + + + Planning cycle + + + + + + + + + + + + Delivery cycle + + + + + + + + + + + + Purchase order entry: vendor + + + + + + + + + + + + Price marking, vendor + + + + + + + + + + + + Rack-jobbing: vendor + + + + + + + + + + + + Indicator: index compilation for subseq. settlement active + + + + + + + + + + + + + + + + + Segment for vendor sub-range MMS SMD + + + + + + + Function + + + + + + + + + + + + Account number of the vendor or creditor + + + + + + + + + + + + Vendor sub-range + + + + + + + + + + + + Name of person who created object + + + + + + + + + + + + Date on which the record was created + + + + + + + + + + + + Language keys + + + + + + + + + + + + Description + + + + + + + + + + + + + + + + Vendor master data distribution ALE + + + + + + + + + + + + Segment for addresses of vendors MMS SMD + + + + + + + Function + + + + + + + + + + + + Account number of the vendor or creditor + + + + + + + + + + + + Purchasing organization + + + + + + + + + + + + Vendor sub-range + + + + + + + + + + + + Plant + + + + + + + + + + + + Partner function ID (e.g. SH for ship-to party) + + + + + + + + + + + + Partner counter + + + + + + + + + + + + Name of person who created object + + + + + + + + + + + + Date on which the record was created + + + + + + + + + + + + Reference to other vendor + + + + + + + + + + + + Default partner + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ErrorHandlerImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ErrorHandlerImpl.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +public class ErrorHandlerImpl implements ErrorHandler { + /** Creates a new instance of ErrorHandlerImpl */ + public ErrorHandlerImpl() { + } + + public void error(SAXParseException sAXParseException) throws SAXException { + throw new SAXException(sAXParseException); + } + + public void fatalError(SAXParseException sAXParseException) throws SAXException { + throw new SAXException(sAXParseException); + } + + public void warning(SAXParseException sAXParseException) throws SAXException { + throw new SAXException(sAXParseException); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; +import java.io.InputStream; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.annotations.Test; +import org.testng.Assert; +import org.xml.sax.InputSource; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @summary Test comination of fields in , for https://issues.apache.org/jira/browse/XERCESJ-682. + */ +public class Issue682Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + File testFile = new File(getClass().getResource("Issue682.xsd").getFile()); + + @Test + public void test() { + try { + Schema schema = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema").newSchema(new StreamSource(testFile)); + SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); + saxParserFactory.setNamespaceAware(true); + saxParserFactory.setSchema(schema); + // saxParserFactory.setFeature("http://java.sun.com/xml/schema/features/report-ignored-element-content-whitespace", + // true); + SAXParser saxParser = saxParserFactory.newSAXParser(); + XMLReader xmlReader = saxParser.getXMLReader(); + xmlReader.setContentHandler(new DefaultHandler()); + // InputStream input = + // ClassLoader.getSystemClassLoader().getResourceAsStream("test/test.xml"); + InputStream input = getClass().getResourceAsStream("Issue682.xml"); + System.out.println("Parse InputStream:"); + xmlReader.parse(new InputSource(input)); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail(ex.toString()); + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @summary Test maxOccurs validation. + */ +public class IssueTracker30 { + + boolean errorFound; + + @Test + public void testMaxOccursErrorNoOptimization() throws Exception { + + // Parsing this document should result in an error + try { + if (!testMaxOccurs("IssueTracker30_occurs-error.xml", "IssueTracker30_occurs.xsd")) + Assert.fail("Expected validation error not reported"); + } catch (SAXException ex) { + Assert.fail(ex.getMessage(), ex); + } + } + + @Test + public void testMaxOccursOKNoOptimization() throws Exception { + + // Parsing this document should *not* result in an error + try { + if (testMaxOccurs("IssueTracker30_occurs-ok.xml", "IssueTracker30_occurs.xsd")) + Assert.fail("Unexpected validation error reported"); + } catch (SAXException ex) { + Assert.fail(ex.getMessage(), ex); + } + } + + @Test + public void testMaxOccursErrorOptimization() throws Exception { + + // Parsing this document should result in an error + try { + if (!testMaxOccurs("IssueTracker30_occurs-optimize-error.xml", "IssueTracker30_occurs-optimize.xsd")) + Assert.fail("Expected validation error not reported"); + } catch (SAXException ex) { + Assert.fail(ex.getMessage(), ex); + } + } + + @Test + public void testMaxOccursOKOptimization() throws Exception { + + // Parsing this document should *not* result in an error + try { + if (testMaxOccurs("IssueTracker30_occurs-optimize-ok.xml", "IssueTracker30_occurs-optimize.xsd")) + Assert.fail("Unexpected validation error reported"); + } catch (SAXException ex) { + Assert.fail(ex.getMessage(), ex); + } + } + + + private boolean testMaxOccurs(String xmlFileName, String xsdFileName) throws Exception { + File xmlFile = new File(getClass().getResource(xmlFileName).getFile()); + + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new File(getClass().getResource(xsdFileName).getFile())); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setSchema(schema); + + DocumentBuilder documentBuilder = dbf.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException e) throws SAXException { + System.out.println("Error: " + e.getMessage()); + errorFound = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("Fatal error: " + e.getMessage()); + throw e; + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("Warning: " + e.getMessage()); + } + }); + + errorFound = false; + documentBuilder.parse(xmlFile); + return errorFound; + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-error.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-error.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,18 @@ + + + + Hege Refsnes + Cecilie + + + Tove Refsnes + Hege + Stale + Jim + Borge + + + Stale Refsnes + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-ok.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-ok.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + Hege Refsnes + Cecilie + + + Tove Refsnes + Hege + Stale + Jim + + + Stale Refsnes + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize-error.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize-error.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + Hege + Stale + Jim + Borge + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize-ok.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize-ok.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,9 @@ + + + + Hege + Stale + Jim + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue43Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue43Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.FileInputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.XMLConstants; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamSource; + +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +/* + * @bug 6631318 + * @summary Test creating schema from a DOM fragment with namespace. + */ +public class JaxpIssue43Test { + + @Test + public void test() throws Exception { + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Source[] sources = getSchemaSources(); + Schema schema = sf.newSchema(sources); + Validator validator = schema.newValidator(); + } + + private Source[] getSchemaSources() throws Exception { + List list = new ArrayList(); + String file = getClass().getResource("hello_literal.wsdl").getFile(); + Source source = new StreamSource(new FileInputStream(file), file); + + Transformer trans = TransformerFactory.newInstance().newTransformer(); + DOMResult result = new DOMResult(); + trans.transform(source, result); + + // Look for element in wsdl + Element e = ((Document) result.getNode()).getDocumentElement(); + NodeList typesList = e.getElementsByTagNameNS("http://schemas.xmlsoap.org/wsdl/", "types"); + NodeList schemaList = ((Element) typesList.item(0)).getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema", "schema"); + Element elem = (Element) schemaList.item(0); + list.add(new DOMSource(elem, file + "#schema0")); + + // trans.transform(new DOMSource(elem), new StreamResult(System.out)); + + return list.toArray(new Source[list.size()]); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue49.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue49.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.FileInputStream; + +import javax.xml.XMLConstants; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Node; + +/* + * @bug 6684227 + * @summary Test property current-element-node works. + */ +public class JaxpIssue49 { + + private Schema schema; + private Validator validator; + + @Test + public void testValidatorTest() throws Exception { + try { + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + String file = getClass().getResource("types.xsd").getFile(); + Source[] sources = new Source[] { new StreamSource(new FileInputStream(file), file) }; + Schema schema = sf.newSchema(sources); + validator = schema.newValidator(); + validate(); + } catch (Exception e) { + Node node = (Node) validator.getProperty("http://apache.org/xml/properties/dom/current-element-node"); + if (node != null) { + System.out.println("Node: " + node.getLocalName()); + } else + Assert.fail("No node returned"); + } + } + + public void validate() throws Exception { + validator.reset(); + Source source = new StreamSource(getClass().getResourceAsStream("JaxpIssue49.xml")); + // If you comment the following line, it works + source = toDOMSource(source); + validator.validate(source); + } + + DOMSource toDOMSource(Source source) throws Exception { + if (source instanceof DOMSource) { + return (DOMSource) source; + } + Transformer trans = TransformerFactory.newInstance().newTransformer(); + DOMResult result = new DOMResult(); + trans.transform(source, result); + trans.transform(new DOMSource(result.getNode()), new StreamResult(System.out)); + return new DOMSource(result.getNode()); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue49.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue49.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + ToyotaCamry1998white + + + + ToyotaCorolla1999red + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/LargeMaxOccursTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/LargeMaxOccursTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test Validator shall report error for maxOccurs > 5000 when FEATURE_SECURE_PROCESSING is on, except the schema can be applied for constant-space algorithm. + */ +public class LargeMaxOccursTest { + + @Test + public void testParticlesR005() { + try { + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + String xsdFile = "particlesR005.xsd"; + Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI())); + Validator validator = schema.newValidator(); + } catch (Exception ex) { + return; // expected + } + Assert.fail("Parser configuration error expected since maxOccurs > 5000 " + "and constant-space optimization does not apply"); + } + + @Test + public void testParticlesIe003() { + try { + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + String xsdFile = "particlesIe003.xsd"; + Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI())); + Validator validator = schema.newValidator(); + } catch (Exception ex) { + return; // expected + } + Assert.fail("Parser configuration error expected since maxOccurs > 5000 " + "and constant-space optimization does not apply"); + } + + @Test + public void testmgG014() { + try { + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + String xsdFile = "mgG014.xsd"; + Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI())); + Validator validator = schema.newValidator(); + } catch (Exception ex) { + return; // expected + } + Assert.fail("Parser configuration error expected since maxOccurs > 5000 " + "and constant-space optimization does not apply"); + } + + @Test + public void testmgJ014() { + try { + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + String xsdFile = "mgJ014.xsd"; + Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI())); + Validator validator = schema.newValidator(); + } catch (Exception ex) { + return; // expected + } + Assert.fail("Parser configuration error expected since maxOccurs > 5000 " + "and constant-space optimization does not apply"); + } + + // particlesOptimize.xsd missing. + @Test + public void testParticlesOptimize() { + try { + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + String xsdFile = "particlesOptimize.xsd"; + Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI())); + Validator validator = schema.newValidator(); + } catch (Exception ex) { + Assert.fail("Parser configuration error not expected since maxOccurs " + "> 5000 but constant-space optimization applies"); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/MultiOccursTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/MultiOccursTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @summary Test Schema Validator can parse multiple or unbounded occurs. + */ +public class MultiOccursTest { + + boolean errorFound; + + DocumentBuilder documentBuilder; + + private void printMethodName() { + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + System.out.println(stack[2].getMethodName()); + } + + public MultiOccursTest() throws Exception { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new File(getClass().getResource("multi-occurs.xsd").getFile())); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setSchema(schema); + + documentBuilder = dbf.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException e) throws SAXException { + System.out.println("Error: " + e.getMessage()); + errorFound = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("Fatal error: " + e.getMessage()); + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("Warning: " + e.getMessage()); + } + }); + } + + @Test + public void testMultiOccursMaxMinOk() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("multi-occurs-ok.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (errorFound) { + Assert.fail("Unexpected validation error reported"); + } + } + + @Test + public void testMultiOccursMaxMinErrorMin() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("multi-occurs-error-min.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + + @Test + public void testMultiOccursMaxMinErrorMax() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("multi-occurs-error-max.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + + @Test + public void testMultiOccursMaxMinErrorMinMax() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("multi-occurs-error-min-max.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/MultiOccursUnboundedTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/MultiOccursUnboundedTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @summary Test Schema Validator can parse multiple or unbounded occurs. + */ +public class MultiOccursUnboundedTest { + + boolean errorFound; + + DocumentBuilder documentBuilder; + + private void printMethodName() { + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + System.out.println(stack[2].getMethodName()); + } + + public MultiOccursUnboundedTest() throws Exception { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new File(getClass().getResource("multi-occurs-unbounded.xsd").getFile())); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setSchema(schema); + + documentBuilder = dbf.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException e) throws SAXException { + System.out.println("Error: " + e.getMessage()); + errorFound = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("Fatal error: " + e.getMessage()); + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("Warning: " + e.getMessage()); + } + }); + } + + @Test + public void testMultiOccursMaxMinOk() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("multi-occurs-unbounded-ok.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (errorFound) { + Assert.fail("Unexpected validation error reported"); + } + } + + @Test + public void testMultiOccursMaxMinErrorMin() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("multi-occurs-unbounded-error-min.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @summary Test Schema Validator can parse multiple or unbounded occurs. + */ +public class OccursTest { + + boolean errorFound; + + DocumentBuilder documentBuilder; + + private void printMethodName() { + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + System.out.println(stack[2].getMethodName()); + } + + public OccursTest() throws Exception { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new File(getClass().getResource("occurs.xsd").getFile())); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setSchema(schema); + + documentBuilder = dbf.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException e) throws SAXException { + System.out.println("Error: " + e.getMessage()); + errorFound = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("Fatal error: " + e.getMessage()); + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("Warning: " + e.getMessage()); + } + }); + } + + @Test + public void testOccursMaxMinOk() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-ok.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (errorFound) { + Assert.fail("Unexpected validation error reported"); + } + } + + @Test + public void testOccursMaxMinErrorMin() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-error-min.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + + @Test + public void testOccursMaxMinErrorMax() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-error-max.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + + @Test + public void testOccursMaxMinErrorMinMax() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-error-min-max.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursUnboundedTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursUnboundedTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @summary Test Schema Validator can parse multiple or unbounded occurs. + */ +public class OccursUnboundedTest { + + boolean errorFound; + + DocumentBuilder documentBuilder; + + private void printMethodName() { + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + System.out.println(stack[2].getMethodName()); + } + + public OccursUnboundedTest() throws Exception { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new File(getClass().getResource("occurs-unbounded.xsd").getFile())); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setSchema(schema); + + documentBuilder = dbf.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException e) throws SAXException { + System.out.println("Error: " + e.getMessage()); + errorFound = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("Fatal error: " + e.getMessage()); + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("Warning: " + e.getMessage()); + } + }); + } + + @Test + public void testOccursUnboundedMaxMinOk() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-unbounded-ok.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (errorFound) { + Assert.fail("Unexpected validation error reported"); + } + } + + @Test + public void testOccursUnboundedMaxMinErrorMin() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-unbounded-error-min.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursWildcardTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursWildcardTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @summary Test Schema Validator can parse multiple or unbounded occurs. + */ +public class OccursWildcardTest { + + boolean errorFound; + + DocumentBuilder documentBuilder; + + private void printMethodName() { + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + System.out.println(stack[2].getMethodName()); + } + + public OccursWildcardTest() throws Exception { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new File(getClass().getResource("occurs-wildcard.xsd").getFile())); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setSchema(schema); + + documentBuilder = dbf.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException e) throws SAXException { + System.out.println("Error: " + e.getMessage()); + errorFound = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("Fatal error: " + e.getMessage()); + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("Warning: " + e.getMessage()); + } + }); + } + + @Test + public void testOccursMaxMinOk() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-ok.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (errorFound) { + Assert.fail("Unexpected validation error reported"); + } + } + + @Test + public void testOccursMaxMinErrorMin() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-error-min.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + + @Test + public void testOccursMaxMinErrorMax() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-error-max.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + + @Test + public void testOccursMaxMinErrorMinMax() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-error-min-max.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursWildcardUnbounded.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursWildcardUnbounded.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @summary Test Schema Validator can parse multiple or unbounded occurs. + */ +public class OccursWildcardUnbounded { + + boolean errorFound; + + DocumentBuilder documentBuilder; + + private void printMethodName() { + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + System.out.println(stack[2].getMethodName()); + } + + public OccursWildcardUnbounded() throws Exception { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new File(getClass().getResource("occurs-wildcard-unbounded.xsd").getFile())); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setSchema(schema); + + documentBuilder = dbf.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException e) throws SAXException { + System.out.println("Error: " + e.getMessage()); + errorFound = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("Fatal error: " + e.getMessage()); + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("Warning: " + e.getMessage()); + } + }); + } + + @Test + public void testOccursUnboundedMaxMinOk() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-unbounded-ok.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (errorFound) { + Assert.fail("Unexpected validation error reported"); + } + } + + @Test + public void testOccursUnboundedMaxMinErrorMin() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("occurs-unbounded-error-min.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (!errorFound) { + Assert.fail("Expected validation error not reported"); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesId005Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesId005Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @summary Test Schema Validator can parse multiple or unbounded occurs. + */ +public class ParticlesId005Test { + + boolean errorFound; + + DocumentBuilder documentBuilder; + + private void printMethodName() { + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + System.out.println(stack[2].getMethodName()); + } + + public ParticlesId005Test() throws Exception { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new File(getClass().getResource("particlesId005.xsd").getFile())); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setSchema(schema); + + documentBuilder = dbf.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException e) throws SAXException { + System.out.println("Error: " + e.getMessage()); + errorFound = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("Fatal error: " + e.getMessage()); + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("Warning: " + e.getMessage()); + } + }); + } + + @Test + public void testNoOptimizationWithChoice() throws Exception { + printMethodName(); + + File xmlFile = new File(getClass().getResource("particlesId005.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (errorFound) { + Assert.fail("Unexpected validation error reported"); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesIg004Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesIg004Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @summary Test particlesIg004.xsd. + */ +public class ParticlesIg004Test { + + @Test + public void testParticleslg004() { + try { + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + String xsdFile = "particlesIg004.xsd"; + Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI())); + Validator validator = schema.newValidator(); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail(ex.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesQ013Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesQ013Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/* + * @summary Test Schema Validator can parse multiple or unbounded occurs. + */ +public class ParticlesQ013Test { + + boolean errorFound; + + DocumentBuilder documentBuilder; + + private void printMethodName() { + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + System.out.println(stack[2].getMethodName()); + } + + public ParticlesQ013Test() throws Exception { + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new File(getClass().getResource("particlesQ013.xsd").getFile())); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setSchema(schema); + + documentBuilder = dbf.newDocumentBuilder(); + documentBuilder.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException e) throws SAXException { + System.out.println("Error: " + e.getMessage()); + errorFound = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("Fatal error: " + e.getMessage()); + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("Warning: " + e.getMessage()); + } + }); + } + + @Test + public void testNoOptimizationWithChoice() throws Exception { + printMethodName(); + File xmlFile = new File(getClass().getResource("particlesQ013.xml").getFile()); + try { + errorFound = false; + documentBuilder.parse(xmlFile); + } catch (SAXException ex) { + Assert.fail(ex.getMessage()); + } + if (errorFound) { + Assert.fail("Unexpected validation error reported"); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/TCKGroupA008Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/TCKGroupA008Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @summary Test groupA008.xsd. + */ +public class TCKGroupA008Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + // System.setSecurityManager(new SecurityManager()); + try { + SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); + File schemaLocation = new File(getClass().getResource("groupA008.xsd").getFile()); + Schema schema = factory.newSchema(schemaLocation); + Validator validator = schema.newValidator(); + } catch (SAXException e) { + System.out.println(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ValidatorTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ValidatorTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; + +import javax.xml.XMLConstants; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.stax.StAXResult; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; + +/* + * @summary Test Validator.validate(Source, Result). + */ +public class ValidatorTest { + + @Test + public void testValidateStAX() { + + File resultFile = null; + try { + resultFile = new File("stax.result"); + if (resultFile.exists()) { + resultFile.delete(); + } + + Result xmlResult = new javax.xml.transform.stax.StAXResult(XMLOutputFactory.newInstance().createXMLStreamWriter(new FileWriter(resultFile))); + Source xmlSource = new javax.xml.transform.stax.StAXSource(getXMLEventReader("toys.xml")); + validate("toys.xsd", xmlSource, xmlResult); + + ((StAXResult) xmlResult).getXMLStreamWriter().close(); + Assert.assertTrue(resultFile.exists(), "result file is not created"); + + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail("Exception : " + ex.getMessage()); + } finally { + if (resultFile != null && resultFile.exists()) { + resultFile.delete(); + } + } + } + + @Test + public void testValidateStream() { + + File resultFile = null; + try { + resultFile = new File("stax.result"); + if (resultFile.exists()) { + resultFile.delete(); + } + + // Validate this instance document against the + // Instance document supplied + Result xmlResult = new javax.xml.transform.stream.StreamResult(resultFile); + Source xmlSource = new javax.xml.transform.stream.StreamSource(new File(ValidatorTest.class.getResource("toys.xml").toURI())); + + validate("toys.xsd", xmlSource, xmlResult); + Assert.assertTrue(resultFile.exists(), "result file is not created"); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail("Exception : " + ex.getMessage()); + } finally { + if (resultFile != null && resultFile.exists()) { + resultFile.delete(); + } + } + } + + @Test + public void testValidateGMonth() { + + // test valid gMonths + File resultFile = null; + try { + resultFile = new File("gMonths.result.xml"); + if (resultFile.exists()) { + resultFile.delete(); + } + + // Validate this instance document against the + // Instance document supplied + Result xmlResult = new javax.xml.transform.stream.StreamResult(resultFile); + Source xmlSource = new javax.xml.transform.stream.StreamSource(new File(ValidatorTest.class.getResource("gMonths.xml").toURI())); + + validate("gMonths.xsd", xmlSource, xmlResult); + + Assert.assertTrue(resultFile.exists(), "result file is not created"); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail("Exception : " + ex.getMessage()); + } finally { + if (resultFile != null && resultFile.exists()) { + resultFile.delete(); + } + } + + // test invalid gMonths + File invalidResultFile = null; + try { + invalidResultFile = new File("gMonths-invalid.result.xml"); + if (invalidResultFile.exists()) { + invalidResultFile.delete(); + } + + // Validate this instance document against the + // Instance document supplied + Result xmlResult = new javax.xml.transform.stream.StreamResult(resultFile); + Source xmlSource = new javax.xml.transform.stream.StreamSource(new File(ValidatorTest.class.getResource("gMonths-invalid.xml").toURI())); + + validate("gMonths.xsd", xmlSource, xmlResult); + + // should have failed with an Exception due to invalid gMonths + Assert.fail("invalid gMonths were accepted as valid in " + ValidatorTest.class.getResource("gMonths-invalid.xml").toURI()); + } catch (Exception ex) { + // expected failure + System.out.println("Expected failure: " + ex.toString()); + } finally { + if (invalidResultFile != null && invalidResultFile.exists()) { + invalidResultFile.delete(); + } + } + } + + private void validate(final String xsdFile, final Source src, final Result result) throws Exception { + try { + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = sf.newSchema(new File(ValidatorTest.class.getResource(xsdFile).toURI())); + + // Get a Validator which can be used to validate instance document + // against this grammar. + Validator validator = schema.newValidator(); + ErrorHandler eh = new ErrorHandlerImpl(); + validator.setErrorHandler(eh); + + // Validate this instance document against the + // Instance document supplied + validator.validate(src, result); + } catch (Exception ex) { + throw ex; + } + } + + private XMLEventReader getXMLEventReader(final String filename) { + + XMLInputFactory xmlif = null; + XMLEventReader xmlr = null; + try { + xmlif = XMLInputFactory.newInstance(); + xmlif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE); + xmlif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE); + xmlif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); + xmlif.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE); + + // FileInputStream fis = new FileInputStream(filename); + FileInputStream fis = new FileInputStream(new File(ValidatorTest.class.getResource(filename).toURI())); + xmlr = xmlif.createXMLEventReader(filename, fis); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail("Exception : " + ex.getMessage()); + } + return xmlr; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/XMLDocBuilder.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/XMLDocBuilder.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.xml.sax.EntityResolver; +import org.xml.sax.ErrorHandler; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +public class XMLDocBuilder { + + private DocumentBuilderFactory factory = null; + private DocumentBuilder builder = null; + private Document doc = null; + private Reader reader = null; + private Reader schema = null; + private String encoding = null; + private String entityPath = null; + + public XMLDocBuilder(String file, String encoding, String schema) { + this.encoding = encoding; + reader = getReaderFromSystemResource(file, encoding); + this.schema = getReaderFromSystemResource(schema, encoding); + } + + public Document getDocument() { + if (reader == null) + return null; + + try { + factory = DocumentBuilderFactory.newInstance(); + + builder = factory.newDocumentBuilder(); + builder.setErrorHandler(new myErrorHandler()); + builder.setEntityResolver(new myEntityResolver()); + + InputSource source = new InputSource(reader); + source.setEncoding(encoding); + + try { + doc = builder.parse(source); + new XMLSchemaValidator(doc, schema).validate(); + + } catch (SAXException e) { + System.err.println(getClass() + " SAXException: " + e.getMessage()); + return null; + } catch (IOException e) { + System.err.println(getClass() + " IOException: " + e.getMessage()); + return null; + } catch (OutOfMemoryError e) { + e.printStackTrace(); + System.err.println(e.getCause().getLocalizedMessage()); + return null; + } + + } catch (ParserConfigurationException e) { + System.err.println(getClass() + " ParserConfigurationException: " + e.getMessage()); + return null; + } + return doc; + } + + public Reader getReaderFromSystemResource(String file, String encoding) { + + try { + return new InputStreamReader(getClass().getResourceAsStream(file), encoding); + } catch (UnsupportedEncodingException e) { + System.err.println(getClass() + " UnsupportedEncodingException: " + e.getMessage()); + } catch (IOException e) { + System.err.println(getClass() + " IOException: " + e.getMessage()); + } + return null; + } + + public void setEntityPath(String entityPath) { + this.entityPath = entityPath; + } + + private class myErrorHandler implements ErrorHandler { + + public void warning(SAXParseException e) { + showErrorMessage(e); + } + + public void error(SAXParseException e) { + showErrorMessage(e); + } + + public void fatalError(SAXParseException e) { + showErrorMessage(e); + } + + private void showErrorMessage(SAXParseException e) { + System.err.println(getClass() + " SAXParseException" + e.getMessage()); + System.err.println("Line: " + e.getLineNumber() + " Column: " + e.getColumnNumber()); + } + } + + private class myEntityResolver implements EntityResolver { + public InputSource resolveEntity(String publicId, String systemId) { + if (entityPath == null) + return null; + + systemId = entityPath + systemId.subSequence(systemId.lastIndexOf("/"), systemId.length()); + + return new InputSource(systemId); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/XMLSchemaValidator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/XMLSchemaValidator.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation; + +import java.io.IOException; +import java.io.Reader; + +import javax.xml.XMLConstants; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.w3c.dom.Node; +import org.xml.sax.SAXException; + +public class XMLSchemaValidator { + + private SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + private Node node = null; + private Reader schema = null; + + public XMLSchemaValidator(Node doc, Reader schema) { + this.node = doc; + this.schema = schema; + } + + public synchronized void validate() throws SAXException, IOException { + + if (node == null || schema == null) + return; + + Source schemaFile = new StreamSource(schema); + Schema schema = factory.newSchema(schemaFile); + Validator validator = schema.newValidator(); + validator.validate(new DOMSource(node)); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths-invalid.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths-invalid.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,32 @@ + + + + + --01-- + --01--Z + --01---08:00 + foo + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,31 @@ + + + + + --01 + --01Z + --01-08:00 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,37 @@ + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008ea.red --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008ea.red Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,7 @@ + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008eb.red --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008eb.red Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,7 @@ + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/hello_literal.wsdl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/hello_literal.wsdl Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idI009.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idI009.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIimp.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIimp.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIxpns.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIxpns.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIxpns1.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIxpns1.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/mgG014.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/mgG014.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/mgJ014.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/mgJ014.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-max.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-max.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,34 @@ + + + + Hege Refsnes + + Jim + Hege + Stale + Sheldon + Penny + John + + + Hege Refsnes + + Jim + Hege + Stale + + + Hege Refsnes + + Jim + Hege + Stale + + Jim + Hege + Stale + Sheldon + Penny + John + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-min-max.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-min-max.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,25 @@ + + + + Hege Refsnes + + Jim + Hege + Stale + + + + Hege Refsnes Jr. + + Jim + Hege + Stale + + Jim + Hege + Stale + Sheldon + Penny + John + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-min.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-min.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,13 @@ + + + + Hege Refsnes + + + + Hege Refsnes + John + Doe + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-ok.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-ok.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,38 @@ + + + + Hege Refsnes + Cecilie + + + Hege Refsnes + Peter + Cecilie + Hege + + + Tove Refsnes + Peter + Pan + Hege + Stale + Jim + + + Tove Refsnes + Hege + Stale + Jim + Sheldon + + + Stale Refsnes + Peter + Pan + Jim + Hege + Stale + Sheldon + Penny + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded-error-min.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded-error-min.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + + Hege Refsnes + + + + + Hege Refsnes + + John + + + + Hege Refsnes + + John + Doe + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded-ok.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded-ok.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,24 @@ + + + + Hege Refsnes + Peter + Pan + Cecilie + Hege + Jim + + + Stale Refsnes + Peter + Pan + Jim + Morris + Jim + Hege + Stale + Sheldon + Penny + Billy + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-max.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-max.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,13 @@ + + + + Hege Refsnes + + Jim + Hege + Stale + Sheldon + Penny + John + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-min-max.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-min-max.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + Hege Refsnes + + + + Hege Refsnes Jr. + + Jim + Hege + Stale + Sheldon + Penny + John + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-min.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-min.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,7 @@ + + + + Hege Refsnes + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-ok.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-ok.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,33 @@ + + + + Hege Refsnes + Cecilie + + + Hege Refsnes + Cecilie + Hege + + + Tove Refsnes + Hege + Stale + Jim + + + Tove Refsnes + Hege + Stale + Jim + Sheldon + + + Stale Refsnes + Jim + Hege + Stale + Sheldon + Penny + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded-error-min.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded-error-min.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,9 @@ + + + + Hege Refsnes + + Hege + Stale + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded-ok.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded-ok.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,37 @@ + + + + Tove Refsnes + Hege + Stale + Jim + + + Tove Refsnes + Hege + Stale + Jim + Sheldon + + + Stale Refsnes + Jim + Hege + Stale + Sheldon + Penny + + + Stale Refsnes + Jim + Hege + Stale + Sheldon + Penny + Jim + Hege + Stale + Sheldon + Penny + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-wildcard-unbounded.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-wildcard-unbounded.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-wildcard.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-wildcard.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesId005.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesId005.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,6 @@ + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesId005.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesId005.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesIe003.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesIe003.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesIg004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesIg004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesOptimize.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesOptimize.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesQ013.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesQ013.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesQ013.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesQ013.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesR005.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesR005.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2_stub.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2_stub.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,5 @@ + + + Stub document diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2_stub.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2_stub.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,7 @@ + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2a.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2a.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/byte_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/byte_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/byte_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/byte_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/int_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/int_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/int_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/int_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/integer_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/integer_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/integer_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/integer_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/long_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/long_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/long_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/long_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/negativeInteger_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/negativeInteger_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/negativeInteger_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/negativeInteger_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonNegativeInteger_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonNegativeInteger_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonNegativeInteger_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonNegativeInteger_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonPositiveInteger_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonPositiveInteger_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonPositiveInteger_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonPositiveInteger_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/positiveInteger_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/positiveInteger_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/positiveInteger_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/positiveInteger_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/short_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/short_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/short_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/short_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedByte_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedByte_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedByte_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedByte_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedInt_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedInt_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedInt_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedInt_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedLong_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedLong_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedLong_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedLong_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedShort_fractionDigits004.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedShort_fractionDigits004.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedShort_fractionDigits007.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedShort_fractionDigits007.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6943252 + * @summary Test Schema doesn't allow to use value more than allowed by base type. + */ +public class Bug6943252Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + + String dir = Bug6943252Test.class.getResource("Bug6943252In").getPath(); + File inputs = new File(dir); + File[] files = inputs.listFiles(); + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + for (int i = 0; i < files.length; i++) { + try { + Schema schema = schemaFactory.newSchema(new StreamSource(files[i])); + Assert.fail(files[i].getName() + "should fail"); + } catch (SAXException e) { + // expected + System.out.println(files[i].getName() + ":"); + System.out.println(e.getMessage()); + } + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963124.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963124.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963124Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963124Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6963124 + * @summary Test Schema doesn't allow maxOccurs > 1 for reference to all model group. + */ +public class Bug6963124Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + + Schema schema = schemaFactory.newSchema(new StreamSource(Bug6963124Test.class.getResourceAsStream("Bug6963124.xsd"))); + Assert.fail("JCK negative test"); + } catch (SAXException e) { + // e.printStackTrace(); + System.out + .println("The XML Schema spec [1] states that if the {term} property of a particle is a model group with {compositor} all then {maxOccurs} of that particle must equal 1."); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,14 @@ + + + 1 + true + false + x + y + 1 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import java.io.File; +import java.io.IOException; + +import javax.xml.XMLConstants; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6963468 + * @summary Test Validation allows element a is a union type and element b specifies a as its substitution group and b type is or is derived from one of the member types of the union. + */ +public class Bug6963468Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + + Schema schema = schemaFactory.newSchema(new StreamSource(Bug6963468Test.class.getResourceAsStream("Bug6963468.xsd"))); + + Validator validator = schema.newValidator(); + validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + validator.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException exception) throws SAXException { + exception.printStackTrace(); + } + + public void fatalError(SAXParseException exception) throws SAXException { + exception.printStackTrace(); + } + + public void warning(SAXParseException exception) throws SAXException { + exception.printStackTrace(); + } + }); + + validator.validate(new StreamSource(Bug6963468Test.class.getResourceAsStream("Bug6963468.xml"))); + + } catch (SAXException e) { + System.out.println(e.getMessage()); + // fail(e.getMessage()); + + } catch (IOException e) { + e.printStackTrace(); + System.out.println(e.getMessage()); + // fail(e.getMessage()); + } + } + + @Test + public void testInstance() throws ParserConfigurationException, SAXException, IOException { + System.out.println(Bug6963468Test.class.getResource("Bug6963468.xsd").getPath()); + File schemaFile = new File(Bug6963468Test.class.getResource("Bug6963468.xsd").getPath()); + SAXParser parser = createParser(schemaFile); + + try { + parser.parse(Bug6963468Test.class.getResource("Bug6963468.xml").getPath(), new DefaultHandler()); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("Fatal Error: " + strException(e)); + } + + } + + protected SAXParser createParser(File schema) throws ParserConfigurationException, SAXException { + + // create and initialize the parser + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); + spf.setValidating(true); + SAXParser parser = spf.newSAXParser(); + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); + + // set schemaLocation if possible + try { + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schema); + } catch (SAXNotRecognizedException e) { + System.out.println("Warning: Property 'http://java.sun.com/xml/jaxp/properties/schemaSource' is not recognized."); + } catch (SAXNotSupportedException e) { + System.out.println("Warning: Property 'http://java.sun.com/xml/jaxp/properties/schemaSource' is not supported."); + } + + return parser; + } + + protected static String strException(Exception ex) { + StringBuffer sb = new StringBuffer(); + + while (ex != null) { + if (ex instanceof SAXParseException) { + SAXParseException e = (SAXParseException) ex; + sb.append("" + e.getSystemId() + "(" + e.getLineNumber() + "," + e.getColumnNumber() + "): " + e.getMessage()); + ex = e.getException(); + } else { + sb.append(ex); + ex = null; + } + } + return sb.toString(); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6964720.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6964720.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6964720Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6964720Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6964720 + * @summary Test Schema doesn't allow the inexpressible union of two attribute wildcards. + */ +public class Bug6964720Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = schemaFactory.newSchema(new StreamSource(Bug6964720Test.class.getResourceAsStream("Bug6964720.xsd"))); + Assert.fail("should produce an error message"); + } catch (SAXException e) { + System.out.println(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/RegexTest_1258.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/RegexTest_1258.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD10.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD10.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD11.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD11.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD12.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD12.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reE9.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reE9.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6967214 + * @summary Test Schema doesn't allow unpaired parenthesises in regex. + */ +public class Bug6967214Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + try { + File dir = new File(Bug6967214Test.class.getResource("Bug6967214").getPath()); + File files[] = dir.listFiles(); + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + for (int i = 0; i < files.length; i++) { + try { + System.out.println(files[i].getName()); + Schema schema = schemaFactory.newSchema(new StreamSource(files[i])); + Assert.fail("should report error"); + } catch (org.xml.sax.SAXParseException spe) { + continue; + } + } + } catch (SAXException e) { + e.printStackTrace(); + + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6970890 + * @summary Test Schema allows [-] in regex. + */ +public class Bug6970890Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test_RegexTest_1319() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = schemaFactory.newSchema(new StreamSource(Bug6970890Test.class.getResourceAsStream("Bug6970890.xsd"))); + + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("The - character is a valid character range at the beginning or end of a positive character group"); + } + } + + @Test + public void test_reH16() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = schemaFactory.newSchema(new StreamSource(Bug6970890Test.class.getResourceAsStream("Bug6970890_1.xsd"))); + + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("The - character is a valid character range at the beginning or end of a positive character group"); + + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890_1.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890_1.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,210 @@ + + + + + +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +٠ +١ +٢ +٣ +٤ +٥ +٦ +٧ +٨ +٩ +۰ +۱ +۲ +۳ +۴ +۵ +۶ +۷ +۸ +۹ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 𝟎 + 𝟿 + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import java.io.IOException; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6971190 + * @summary Test Validation accepts UTF lexical presentation. + */ +public class Bug6971190Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + + Schema schema = schemaFactory.newSchema(new StreamSource(Bug6971190Test.class.getResourceAsStream("Bug6971190.xsd"))); + Validator validator = schema.newValidator(); + /** + * validator.setErrorHandler(new ErrorHandler() { public void + * error(SAXParseException exception) throws SAXException { + * exception.printStackTrace(); } + * + * public void fatalError(SAXParseException exception) throws + * SAXException { exception.printStackTrace(); } + * + * public void warning(SAXParseException exception) throws + * SAXException { exception.printStackTrace(); } }); + */ + validator.validate(new StreamSource(Bug6971190Test.class.getResourceAsStream("Bug6971190.xml"))); + + } catch (SAXException e) { + System.out.println(e.getMessage()); + Assert.fail(e.getMessage()); + + } catch (IOException e) { + e.printStackTrace(); + System.out.println(e.getMessage()); + Assert.fail(e.getMessage()); + } + } + + // test \W negative tests with positibve \w + @Test + public void testNegative() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + + Schema schema = schemaFactory.newSchema(new StreamSource(Bug6971190Test.class.getResourceAsStream("Bug6971190_v.xsd"))); + Validator validator = schema.newValidator(); + + validator.validate(new StreamSource(Bug6971190Test.class.getResourceAsStream("Bug6971190_v.xml"))); + + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + + } catch (IOException e) { + e.printStackTrace(); + System.out.println(e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190_v.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190_v.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,44 @@ + + + + + + ʰ + ʰ + + 𪘀 + + + + + + + + + + 𝟿 + + + + + + + + + + + + + + + + + 𝞨 + 𝟉 + Dž + Dž + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190_v.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190_v.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + test + + + + information + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import java.io.IOException; + +import javax.xml.XMLConstants; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6974551 + * @summary Test Validation for SAXParser can expose whitespace facet for xs:anySimpleType. + */ +public class Bug6974551Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + static String _xml = Bug6974551Test.class.getResource("Bug6974551.xml").getPath(); + static String _xsd = Bug6974551Test.class.getResource("Bug6974551.xsd").getPath(); + + @Test + public void testSAX() { + try { + Schema schema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(new StreamSource(_xsd)); + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); + spf.setValidating(true); + spf.setSchema(schema); + SAXParser parser = spf.newSAXParser(); + MyErrorHandler errorHandler = new MyErrorHandler(); + parser.parse(_xml, errorHandler); + if (!errorHandler.errorOccured) { + Assert.fail("should report error"); + } + } catch (Exception e) { + System.out.println(e.getMessage()); + } + } + + @Test + public void testValidationAPI() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + + Schema schema = schemaFactory.newSchema(new StreamSource(_xsd)); + Validator validator = schema.newValidator(); + validator.validate(new StreamSource(_xml)); + + Assert.fail("should report error"); + } catch (SAXException e) { + // expected, pass + System.out.println(e.getMessage()); + } catch (IOException e) { + Assert.fail(e.getMessage()); + System.out.println(e.getMessage()); + } + } + + class MyErrorHandler extends DefaultHandler { + + public boolean errorOccured = false; + + public void error(SAXParseException e) throws SAXException { + + System.err.println("Error: " + "[[" + e.getPublicId() + "]" + "[" + e.getSystemId() + "]]" + "[[" + e.getLineNumber() + "]" + "[" + + e.getColumnNumber() + "]] " + e); + + errorOccured = true; + } + + public void fatalError(SAXParseException e) throws SAXException { + + System.err.println("Fatal Error: " + e); + + errorOccured = true; + } + + public void warning(SAXParseException e) throws SAXException { + + System.err.println("Warning: " + e); + + errorOccured = true; + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF025.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF025.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF037.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF037.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF041.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF041.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF045.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF045.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF049.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF049.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import java.io.File; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6975265 + * @summary Test Schema doesn't allow some Element Information Items contain other element information item. + */ +public class Bug6975265Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + try { + File dir = new File(Bug6975265Test.class.getResource("Bug6975265").getPath()); + File files[] = dir.listFiles(); + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + for (int i = 0; i < files.length; i++) { + try { + System.out.println(files[i].getName()); + Schema schema = schemaFactory.newSchema(new StreamSource(files[i])); + Assert.fail("should report error"); + } catch (org.xml.sax.SAXParseException spe) { + System.out.println(spe.getMessage()); + continue; + } + } + } catch (SAXException e) { + e.printStackTrace(); + + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA2.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,11 @@ + + + + + + a + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA2.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA2.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA3.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA3.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,11 @@ + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA3.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA3.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA4.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA4.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,11 @@ + + + + + + #xD; + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA4.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA4.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA5.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA5.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,11 @@ + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA5.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA5.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA6.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA6.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,11 @@ + + + + + + #xA; + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA6.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA6.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6977201 + * @summary Test Validator interprets regex "" correctly. + */ +public class Bug6977201Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + + @Test + public void test() { + validate(Bug6977201Test.class.getResource("Bug6977201/reA2.xsd").getPath(), Bug6977201Test.class.getResource("Bug6977201/reA2.xml").getPath()); + validate(Bug6977201Test.class.getResource("Bug6977201/reA3.xsd").getPath(), Bug6977201Test.class.getResource("Bug6977201/reA3.xml").getPath()); + validate(Bug6977201Test.class.getResource("Bug6977201/reA4.xsd").getPath(), Bug6977201Test.class.getResource("Bug6977201/reA4.xml").getPath()); + validate(Bug6977201Test.class.getResource("Bug6977201/reA5.xsd").getPath(), Bug6977201Test.class.getResource("Bug6977201/reA5.xml").getPath()); + validate(Bug6977201Test.class.getResource("Bug6977201/reA6.xsd").getPath(), Bug6977201Test.class.getResource("Bug6977201/reA6.xml").getPath()); + } + + // JCK negative test + public void validate(String xsd, String xml) { + try { + Schema schema = schemaFactory.newSchema(new StreamSource(xsd)); + Validator validator = schema.newValidator(); + validator.validate(new StreamSource(xml)); + Assert.fail("should report error"); + } catch (Exception e) { + System.out.println(e.getMessage()); + // e.printStackTrace(); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,5 @@ + + 1 + x + y + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import java.io.File; +import java.io.IOException; + +import javax.xml.XMLConstants; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6989956 + * @summary Test Validation can process correctly that maxOccurs in Choice less than maxOccurs in Elements contained in the Choice. + */ +public class Bug6989956Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + + Schema schema = schemaFactory.newSchema(new StreamSource(Bug6989956Test.class.getResourceAsStream("Bug6989956.xsd"))); + + Validator validator = schema.newValidator(); + validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + validator.setErrorHandler(new ErrorHandler() { + public void error(SAXParseException exception) throws SAXException { + exception.printStackTrace(); + } + + public void fatalError(SAXParseException exception) throws SAXException { + exception.printStackTrace(); + } + + public void warning(SAXParseException exception) throws SAXException { + exception.printStackTrace(); + } + }); + + validator.validate(new StreamSource(Bug6989956Test.class.getResourceAsStream("Bug6989956.xml"))); + + } catch (SAXException e) { + System.out.println(e.getMessage()); + // fail(e.getMessage()); + + } catch (IOException e) { + e.printStackTrace(); + System.out.println(e.getMessage()); + // fail(e.getMessage()); + } + } + + @Test + public void testInstance() throws ParserConfigurationException, SAXException, IOException { + System.out.println(Bug6989956Test.class.getResource("Bug6989956.xsd").getPath()); + File schemaFile = new File(Bug6989956Test.class.getResource("Bug6989956.xsd").getPath()); + SAXParser parser = createParser(schemaFile); + + try { + parser.parse(Bug6989956Test.class.getResource("Bug6989956.xml").getPath(), new DefaultHandler()); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("Fatal Error: " + strException(e)); + } + + } + + protected SAXParser createParser(File schema) throws ParserConfigurationException, SAXException { + + // create and initialize the parser + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); + spf.setValidating(true); + SAXParser parser = spf.newSAXParser(); + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); + + // set schemaLocation if possible + try { + parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schema); + } catch (SAXNotRecognizedException e) { + System.out.println("Warning: Property 'http://java.sun.com/xml/jaxp/properties/schemaSource' is not recognized."); + } catch (SAXNotSupportedException e) { + System.out.println("Warning: Property 'http://java.sun.com/xml/jaxp/properties/schemaSource' is not supported."); + } + + return parser; + } + + protected static String strException(Exception ex) { + StringBuffer sb = new StringBuffer(); + + while (ex != null) { + if (ex instanceof SAXParseException) { + SAXParseException e = (SAXParseException) ex; + sb.append("" + e.getSystemId() + "(" + e.getLineNumber() + "," + e.getColumnNumber() + "): " + e.getMessage()); + ex = e.getException(); + } else { + sb.append(ex); + ex = null; + } + } + return sb.toString(); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug7014246.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug7014246.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug7014246Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug7014246Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.validation.tck; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 7014246 + * @summary Test Schema doesn't allow maxInclusive of derived time type greater than the base. + */ +public class Bug7014246Test { + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test() { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = schemaFactory.newSchema(new StreamSource(Bug7014246Test.class.getResourceAsStream("Bug7014246.xsd"))); + Assert.fail("STATUS:Failed.The negative testcase unexpectedly passed."); + } catch (SAXException e) { + e.printStackTrace(); + + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test-element.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test-element.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test-sequence.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test-sequence.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,6 @@ + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/toys.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/toys.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,38 @@ + + + + + + Lego-Model01 + 65.99 + + + Lego-Model2 + 69.99 + + + Lego-Model3 + 14.99 + + + Barbie-Pink + 12.99 + + + Barbie-Blue + 13.99 + + + Barbie-White + 13.99 + + + Barbie-Plain + 13.99 + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/toys.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/toys.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/types.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/types.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4991857.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4991857.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.xpath; + +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; + + +/* + * @bug 4991857 + * @summary XPath.evaluate(...) throws XPathExpressionException when context is null and expression refers to the context. + */ +public class Bug4991857 { + + Document d = null; + + XPathFactory xpathFactory = XPathFactory.newInstance(); + + @Test + public void testXPath09() throws Exception { + try { + XPath xpath = xpathFactory.newXPath(); + Assert.assertNotNull(xpath); + + Double result = (Double) xpath.evaluate("1+2", d, XPathConstants.NUMBER); + } catch (XPathExpressionException _) { + Assert.fail("Unexpected XPathExpressionException thrown"); + } + } + + @Test + public void testXPath10() throws Exception { + try { + XPath xpath = xpathFactory.newXPath(); + Assert.assertNotNull(xpath); + + xpath.evaluate(".", d, XPathConstants.STRING); + Assert.fail("XPathExpressionException not thrown"); + } catch (XPathExpressionException e) { + // Expected exception as context node is null + } + } + + @Test + public void testXPath11() throws Exception { + try { + Document d = null; + + XPathFactory xpathFactory = XPathFactory.newInstance(); + Assert.assertNotNull(xpathFactory); + + XPath xpath = xpathFactory.newXPath(); + Assert.assertNotNull(xpath); + + String quantity = (String) xpath.evaluate("/widgets/widget[@name='a']/@quantity", d, XPathConstants.STRING); + Assert.fail("XPathExpressionException not thrown"); + } catch (XPathExpressionException e) { + // Expected exception as context node is null + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4991939.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4991939.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.xpath; + +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 4991939 + * @summary XPath.evaluate(...) throws IllegalArgumentException if returnType is not one of the types defined in XPathConstants. + */ +public class Bug4991939 { + + @Test + public void testXPath13() throws Exception { + QName qname = new QName(XMLConstants.XML_NS_URI, ""); + + XPathFactory xpathFactory = XPathFactory.newInstance(); + Assert.assertNotNull(xpathFactory); + + XPath xpath = xpathFactory.newXPath(); + Assert.assertNotNull(xpath); + + try { + xpath.evaluate("1+1", (Object) null, qname); + Assert.fail("failed , expected IAE not thrown"); + } catch (IllegalArgumentException e) { + ; // as expected + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992788.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992788.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.xpath; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; +import javax.xml.xpath.XPathFactoryConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; + +/* + * @bug 4992788 + * @summary Test XPath.evaluate(expression,source,returnType) throws NPE if source is null. + */ +public class Bug4992788 { + + private static String expression = "/widgets/widget[@name='a']/@quantity"; + + // test for XPath.evaluate(java.lang.String expression, InputSource source) + // - default returnType is String + // source is null , should throw NPE + @Test + public void testXPath23() throws Exception { + try { + createXPath().evaluate(expression, (InputSource) null); + Assert.fail(); + } catch (NullPointerException e) { + ; // as expected + } + } + + // test for XPath.evaluate(java.lang.String expression, InputSource source, + // QName returnType) + // source is null , should throw NPE + @Test + public void testXPath28() throws Exception { + try { + createXPath().evaluate(expression, (InputSource) null, XPathConstants.STRING); + Assert.fail(); + } catch (NullPointerException e) { + ; // as expected + } + } + + private XPath createXPath() throws XPathFactoryConfigurationException { + XPathFactory xpathFactory = XPathFactory.newInstance(); + Assert.assertNotNull(xpathFactory); + XPath xpath = xpathFactory.newXPath(); + Assert.assertNotNull(xpath); + return xpath; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992793.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992793.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.xpath; + +import java.io.StringReader; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; +import javax.xml.xpath.XPathFactoryConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; + +/* + * @bug 4992793 + * @summary Test XPath.evaluate(expression,source,returnType) throws NPE if expression is null. + */ +public class Bug4992793 { + + + // test for XPath.evaluate(java.lang.String expression, InputSource source) + // - default returnType is String + // source is null , should throw NPE + @Test + public void testXPath24() throws Exception { + try { + createXPath().evaluate(null, new InputSource(new StringReader(""))); + Assert.fail(); + } catch (NullPointerException e) { + ; // as expected + } + } + + // test for XPath.evaluate(java.lang.String expression, InputSource source, + // QName returnType) + // source is null , should throw NPE + @Test + public void testXPath29() throws Exception { + try { + createXPath().evaluate(null, new InputSource(new StringReader("")), XPathConstants.STRING); + Assert.fail(); + } catch (NullPointerException e) { + ; // as expected + } + } + + private XPath createXPath() throws XPathFactoryConfigurationException { + XPathFactory xpathFactory = XPathFactory.newInstance(); + Assert.assertNotNull(xpathFactory); + XPath xpath = xpathFactory.newXPath(); + Assert.assertNotNull(xpath); + return xpath; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992805.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992805.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.xpath; + +import java.io.StringReader; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathFactory; +import javax.xml.xpath.XPathFactoryConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; + +/* + * @bug 4992805 + * @summary Test XPath.evaluate(expression,source,returnType) throws NPE if returnType is null. + */ +public class Bug4992805 { + + private static String expression = "/widgets/widget[@name='a']/@quantity"; + + // test for XPath.evaluate(java.lang.String expression, InputSource source, + // QName returnType) + // source is null , should throw NPE + @Test + public void testXPath30() throws Exception { + try { + createXPath().evaluate(expression, new InputSource(new StringReader("")), null); + Assert.fail(); + } catch (NullPointerException e) { + ; // as expected + } + } + + private XPath createXPath() throws XPathFactoryConfigurationException { + XPathFactory xpathFactory = XPathFactory.newInstance(); + Assert.assertNotNull(xpathFactory); + XPath xpath = xpathFactory.newXPath(); + Assert.assertNotNull(xpath); + return xpath; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/ClassLoaderTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/ClassLoaderTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.xpath; + +import javax.xml.xpath.XPathFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6354969 + * @summary Test XPathFactory newInstance() with ContextClassLoader. + */ +public class ClassLoaderTest { + + @Test + public void testClassLoader() { + MyClassLoader cl = new MyClassLoader(); + Thread.currentThread().setContextClassLoader(cl); + XPathFactory xPathFactory = XPathFactory.newInstance(); + + if (!cl.isCalled()) { + Assert.fail("Context class loader should be used."); + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/MyClassLoader.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/MyClassLoader.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package javax.xml.xpath; + +import java.io.IOException; +import java.net.URL; +import java.util.Enumeration; + +public class MyClassLoader extends ClassLoader { + boolean isCalled = false; + + public URL getResource(String name) { + isCalled = true; + return super.getResource(name); + } + + public Enumeration getResources(String name) throws IOException { + isCalled = true; + return super.getResources(name); + } + + public void reset() { + isCalled = false; + } + + public boolean isCalled() { + return isCalled; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/SecureProcessingTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/SecureProcessingTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.xpath; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Iterator; +import java.util.List; + +import javax.xml.XMLConstants; +import javax.xml.namespace.NamespaceContext; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +/* + * @summary Test when FEATURE_SECURE_PROCESSING is true, calling an external function will cause XPathFunctionException. + */ +public class SecureProcessingTest { + static boolean _isSecureMode = false; + static { + if (System.getSecurityManager() != null) { + _isSecureMode = true; + System.out.println("Security Manager is present"); + } else { + System.out.println("Security Manager is NOT present"); + } + } + + @Test + public final void testSecureProcessing() { + + final String XPATH_EXPRESSION = "ext:helloWorld()"; + + // the xml source + InputStream xmlStream = this.getClass().getResourceAsStream("SecureProcessingTest.xml"); + + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = null; + Document document = null; + + try { + documentBuilder = documentBuilderFactory.newDocumentBuilder(); + document = documentBuilder.parse(xmlStream); + } catch (ParserConfigurationException parserConfigurationException) { + parserConfigurationException.printStackTrace(); + Assert.fail(parserConfigurationException.toString()); + } catch (SAXException saxException) { + saxException.printStackTrace(); + Assert.fail(saxException.toString()); + } catch (IOException ioException) { + ioException.printStackTrace(); + Assert.fail(ioException.toString()); + } + + // the XPath + XPathFactory xPathFactory = null; + XPath xPath = null; + String xPathResult = null; + + // SECURE_PROCESSING == false + // evaluate an expression with a user defined function with a non-secure + // XPath + // expect success + if (!_isSecureMode) { // jaxp secure feature can not be turned off when + // security manager is present + try { + xPathFactory = xPathFactory.newInstance(); + xPathFactory.setXPathFunctionResolver(new MyXPathFunctionResolver()); + xPathFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false); + + xPath = xPathFactory.newXPath(); + xPath.setNamespaceContext(new MyNamespaceContext()); + + xPathResult = xPath.evaluate(XPATH_EXPRESSION, document); + } catch (XPathFactoryConfigurationException xPathFactoryConfigurationException) { + xPathFactoryConfigurationException.printStackTrace(); + Assert.fail(xPathFactoryConfigurationException.toString()); + } catch (XPathExpressionException xPathExpressionException) { + xPathExpressionException.printStackTrace(); + Assert.fail(xPathExpressionException.toString()); + } + + // expected success + System.out.println("XPath result (SECURE_PROCESSING == false) = \"" + xPathResult + "\""); + } + // now try with SECURE_PROCESSING == true + // evaluate an expression with a user defined function with a secure + // XPath + // expect Exception + boolean securityException = false; + try { + xPathFactory = xPathFactory.newInstance(); + xPathFactory.setXPathFunctionResolver(new MyXPathFunctionResolver()); + xPathFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + + xPath = xPathFactory.newXPath(); + xPath.setNamespaceContext(new MyNamespaceContext()); + + xPathResult = xPath.evaluate(XPATH_EXPRESSION, document); + } catch (XPathFactoryConfigurationException xPathFactoryConfigurationException) { + xPathFactoryConfigurationException.printStackTrace(); + Assert.fail(xPathFactoryConfigurationException.toString()); + } catch (XPathFunctionException xPathFunctionException) { + // expected security exception + securityException = true; + xPathFunctionException.printStackTrace(System.out); + } catch (XPathExpressionException xPathExpressionException) { + xPathExpressionException.printStackTrace(); + Assert.fail(xPathExpressionException.toString()); + } + + // expected Exception + if (!securityException) { + Assert.fail("XPath result (SECURE_PROCESSING == true) = \"" + xPathResult + "\""); + } + } + + public class MyXPathFunctionResolver implements XPathFunctionResolver { + + public XPathFunction resolveFunction(QName functionName, int arity) { + + // not a real ewsolver, always return a default XPathFunction + return new MyXPathFunction(); + } + } + + public class MyXPathFunction implements XPathFunction { + + public Object evaluate(List list) throws XPathFunctionException { + + return "Hello World"; + } + } + + public class MyNamespaceContext implements NamespaceContext { + + public String getNamespaceURI(String prefix) { + if (prefix == null) { + throw new IllegalArgumentException("The prefix cannot be null."); + } + + if (prefix.equals("ext")) { + return "http://ext.com"; + } else { + return null; + } + } + + public String getPrefix(String namespace) { + + if (namespace == null) { + throw new IllegalArgumentException("The namespace uri cannot be null."); + } + + if (namespace.equals("http://ext.com")) { + return "ext"; + } else { + return null; + } + } + + public Iterator getPrefixes(String namespace) { + return null; + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/SecureProcessingTest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/SecureProcessingTest.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/XPathTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/XPathTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.xpath; + +import javax.xml.namespace.NamespaceContext; + +import org.testng.annotations.Test; + +/* + * @bug 6376058 + * @summary Test XPath.getNamespaceContext() is supported. + */ +public class XPathTest { + + @Test + public void testNamespaceContext() { + + XPathFactory xPathFactory = XPathFactory.newInstance(); + XPath xPath = xPathFactory.newXPath(); + + NamespaceContext namespaceContext = xPath.getNamespaceContext(); + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4915524.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4915524.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; + +/* + * @bug 4915524 + * @summary Test Document.adoptNode() shall not throw Exception when the source document object is created from different implementation. + */ + +public class Bug4915524 { + + String data = "" + "" + " " + "]>" + ""; + + DocumentBuilder docBuilder = null; + + /* + * This method tries to adopt a node from Defered document to non-defered + * document. + */ + @Test + public void testAdoptNode() { + try { + DocumentBuilderFactory docBF = DocumentBuilderFactory.newInstance(); + docBuilder = docBF.newDocumentBuilder(); + + Document doc1 = parse(data); + Document doc2 = docBuilder.newDocument(); + + Node element = doc2.adoptNode(doc1.getDocumentElement()); + + System.out.println("OK."); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Excpetion while adopting node: " + e.getMessage()); + } + + } + + private Document parse(String xmlData) throws Exception { + StringReader in = new StringReader(xmlData); + InputSource source = new InputSource(in); + return docBuilder.parse(source); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4915748.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4915748.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.CDATASection; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; +import org.w3c.dom.Document; + +/* + * @bug 4915748 + * @summary Test DOMErrorHandler is called in case CDATA section is split by termination marker ']]>'. + */ +public class Bug4915748 { + + @Test + public void testMain() throws Exception { + + final boolean[] hadError = new boolean[1]; + + DocumentBuilderFactory docBF = DocumentBuilderFactory.newInstance(); + DocumentBuilder docBuilder = docBF.newDocumentBuilder(); + + Document doc = docBuilder.getDOMImplementation().createDocument("namespaceURI", "ns:root", null); + + CDATASection cdata = doc.createCDATASection("text1]]>text2"); + doc.getDocumentElement().appendChild(cdata); + + DOMConfiguration config = doc.getDomConfig(); + DOMErrorHandler erroHandler = new DOMErrorHandler() { + public boolean handleError(DOMError error) { + System.out.println(error.getMessage()); + Assert.assertEquals(error.getType(), "cdata-sections-splitted"); + Assert.assertFalse(hadError[0], "two errors were reported"); + hadError[0] = true; + return false; + } + }; + config.setParameter("error-handler", erroHandler); + doc.normalizeDocument(); + Assert.assertTrue(hadError[0]); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966082.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966082.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; + +/* + * @bug 4966082 + * @summary Test Element.getSchemaTypeInfo() returns an instance of TypeInfo instead of null when the document's schema is an XML DTD. + */ +public class Bug4966082 { + + @Test + public void testOne() { + try { + Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(Bug4966082.class.getResource("Bug4966082.xml").toExternalForm()); + if (document.getDocumentElement().getSchemaTypeInfo() == null) { + Assert.fail("getSchemaTypeInfo returns null"); + } + } catch (Exception ex) { + Assert.fail("Unexpected error" + ex); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966082.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966082.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,5 @@ + + +]> +xxx diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966138.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966138.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.TypeInfo; + +/* + * @bug 4966138 + * @summary Test Element's TypeInfo.getTypeName() returns a name instead of null in case the element is declared using anonymous simple type. + */ +public class Bug4966138 { + + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test1() throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(true); + dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI); + dbf.setAttribute(SCHEMA_SOURCE, Bug4966138.class.getResource("test.xsd").toExternalForm()); + + Document document = dbf.newDocumentBuilder().parse(Bug4966138.class.getResource("test.xml").toExternalForm()); + + TypeInfo type = document.getDocumentElement().getSchemaTypeInfo(); + + String typeName = type.getTypeName(); + System.out.println(typeName); + Assert.assertNotNull(typeName); + Assert.assertTrue(typeName.length() != 0, "returned typeName shouldn't be empty"); + + String typeNs = type.getTypeNamespace(); + System.out.println(typeNs); + Assert.assertNotNull(typeNs); + Assert.assertTrue(typeNs.length() != 0, "returned typeNamespace shouldn't be empty"); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.TypeInfo; + +/* + * @bug 4966142 + * @summary Test TypeInfo.isDerivedFrom(...) works instead of throws UnsupportedOperationException when the TypeInfo instance refers to a simple type. + */ +public class Bug4966142 { + + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test1() throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(true); + dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI); + dbf.setAttribute(SCHEMA_SOURCE, Bug4966142.class.getResource("Bug4966142.xsd").toExternalForm()); + + Document document = dbf.newDocumentBuilder().parse(Bug4966142.class.getResource("Bug4966142.xml").toExternalForm()); + + TypeInfo type = document.getDocumentElement().getSchemaTypeInfo(); + + Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_UNION)); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + +the test diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.TypeInfo; + +/* + * @bug 4966143 + * @summary Test isDerivedFrom(...) returns true only if the parameter is DERIVATION_EXTENSION, + * in case TypeInfo instance refers to a complex type derived from another complex type by extension. + */ +public class Bug4966143 { + + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + @Test + public void test1() throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(true); + dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI); + dbf.setAttribute(SCHEMA_SOURCE, Bug4966143.class.getResource("Bug4966143.xsd").toExternalForm()); + + Document document = dbf.newDocumentBuilder().parse(Bug4966143.class.getResource("Bug4966143.xml").toExternalForm()); + + TypeInfo type = document.getDocumentElement().getSchemaTypeInfo(); + + Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_UNION)); + Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_LIST)); + Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_RESTRICTION)); + Assert.assertTrue(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_EXTENSION)); + Assert.assertTrue(type.isDerivedFrom("testNS", "Test", 0)); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6339023.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6339023.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.DOMStringList; +import org.w3c.dom.ls.DOMImplementationLS; +import org.w3c.dom.ls.LSParser; +import org.w3c.dom.ls.LSSerializer; + +/* + * @bug 6339023 + * @summary Test normalize-characters. + */ +public class Bug6339023 { + + /* + * This test checks DOMConfiguration for DOM Level3 Load and Save + * implementation. + */ + @Test + public void testLSSerializer() { + try { + DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + DOMImplementation impln = parser.getDOMImplementation(); + DOMImplementationLS lsImpln = (DOMImplementationLS) impln.getFeature("LS", "3.0"); + LSSerializer serializer = lsImpln.createLSSerializer(); + DOMConfiguration domConfig = serializer.getDomConfig(); + System.out.println("DOMConfig: " + domConfig.toString()); + Assert.assertTrue(domConfig.getParameter("normalize-characters") == null); + System.out.println("value: " + domConfig.getParameter("normalize-characters")); + + DOMStringList list = domConfig.getParameterNames(); + for (int i = 0; i < list.getLength(); i++) { + System.out.println("Param Name: " + list.item(i)); + Assert.assertFalse(list.item(i).equals("normalize-characters")); + } + + Assert.assertFalse(domConfig.canSetParameter("normalize-characters", Boolean.FALSE)); + Assert.assertFalse(domConfig.canSetParameter("normalize-characters", Boolean.TRUE)); + + try { + domConfig.setParameter("normalize-characters", Boolean.TRUE); + Assert.fail("Exception expected as 'normalize-characters' is not supported"); + } catch (Exception e) { + } + + try { + domConfig.setParameter("normalize-characters", Boolean.FALSE); + Assert.fail("Exception expected as 'normalize-characters' is not supported"); + } catch (Exception e) { + } + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception: " + e.getMessage()); + } + } + + /* + * This test checks DOMConfiguration for DOM Level3 Core implementation. + */ + @Test + public void testLSParser() { + try { + DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + DOMImplementation impln = parser.getDOMImplementation(); + DOMImplementationLS lsImpln = (DOMImplementationLS) impln.getFeature("Core", "3.0"); + LSParser lsparser = lsImpln.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, "http://www.w3.org/2001/XMLSchema"); + DOMConfiguration domConfig = lsparser.getDomConfig(); + System.out.println("DOMConfig: " + domConfig.toString()); + Assert.assertTrue(domConfig.getParameter("normalize-characters").toString().equalsIgnoreCase("false")); + System.out.println("value: " + domConfig.getParameter("normalize-characters")); + + DOMStringList list = domConfig.getParameterNames(); + boolean flag = false; + for (int i = 0; i < list.getLength(); i++) { + System.out.println("Param Name: " + list.item(i)); + if (list.item(i).equals("normalize-characters")) { + flag = true; + break; + } + } + Assert.assertTrue(flag, "'normalize-characters' doesnot exist in the list returned by domConfig.getParameterNames()"); + + Assert.assertTrue(domConfig.canSetParameter("normalize-characters", Boolean.FALSE)); + Assert.assertFalse(domConfig.canSetParameter("normalize-characters", Boolean.TRUE)); + + try { + domConfig.setParameter("normalize-characters", Boolean.TRUE); + Assert.fail("Exception expected as 'normalize-characters' is not supported"); + } catch (Exception e) { + } + + try { + domConfig.setParameter("normalize-characters", Boolean.FALSE); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception expected as 'normalize-characters' is not supported"); + } + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception: " + e.getMessage()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6355326.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6355326.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.StringBufferInputStream; +import java.io.UnsupportedEncodingException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.ls.DOMImplementationLS; +import org.w3c.dom.ls.LSInput; +import org.w3c.dom.ls.LSParser; +import org.xml.sax.SAXException; + +/* + * @bug 6355326 + * @summary Test DOM implementation encoding. + */ +public class Bug6355326 { + + DOMImplementationLS implLS = null; + String encodingXML = ""; + + @BeforeMethod + protected void setUp() { + Document doc = null; + DocumentBuilder parser = null; + String xml1 = ""; + try { + parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } + StringBufferInputStream is = new StringBufferInputStream(xml1); + try { + doc = parser.parse(is); + } catch (SAXException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + DOMImplementation impl = doc.getImplementation(); + implLS = (DOMImplementationLS) impl.getFeature("LS", "3.0"); + } + + @Test + public void testExternalEncoding() { + + try { + LSInput src = null; + LSParser dp = null; + + src = createLSInputEncoding(); + dp = createLSParser(); + + src.setEncoding("UTF-16"); + Document doc = dp.parse(src); + Assert.assertTrue("encodingXML".equals(doc.getDocumentElement().getNodeName()), "XML document is not parsed correctly"); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + private LSInput createLSInputEncoding() { + LSInput src = implLS.createLSInput(); + Assert.assertFalse(src == null, "Could not create LSInput from DOMImplementationLS"); + + try { + src.setByteStream(new ByteArrayInputStream(encodingXML.getBytes("UTF-16"))); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + return src; + } + + private LSParser createLSParser() { + LSParser p = implLS.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, "http://www.w3.org/2001/XMLSchema"); + Assert.assertFalse(p == null, "Could not create Synchronous LSParser from DOMImplementationLS"); + return p; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6367542.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6367542.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.bootstrap.DOMImplementationRegistry; + +/* + * @bug 6367542 + * @summary Test DOMImplementationRegistry.getDOMImplementation("XML") returns a DOMImplementation instance. + */ +public class Bug6367542 { + + @Test + public void testDOMImplementationRegistry() { + try { + DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance(); + DOMImplementation domImpl = registry.getDOMImplementation("XML"); + Assert.assertTrue(domImpl != null, "Non null implementation is expected for getDOMImplementation('XML')"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6520131.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6520131.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Text; + +/* + * @bug 6520131 + * @summary Test DOMErrorHandler reports an error for invalid character. + */ +public class Bug6520131 { + + @Test + public void test() { + String string = new String("\u0001"); + + try { + // create document + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = dbf.newDocumentBuilder(); + Document document = documentBuilder.newDocument(); + + DOMConfiguration domConfig = document.getDomConfig(); + domConfig.setParameter("well-formed", Boolean.TRUE); + domConfig.setParameter("error-handler", new DOMErrorHandler() { + public boolean handleError(DOMError e) { + throw new RuntimeException(e.getMessage()); + } + }); + + // add text element + Element textElement = document.createElementNS("", "Text"); + Text text = document.createTextNode(string); + textElement.appendChild(text); + document.appendChild(textElement); + + // normalize document + document.normalizeDocument(); + + Assert.fail("Invalid character exception not thrown"); + } catch (ParserConfigurationException e) { + Assert.fail("Unable to configure parser"); + } catch (RuntimeException e) { + // This exception is expected! + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6521260.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6521260.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import java.io.ByteArrayInputStream; +import java.io.IOException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.xml.sax.SAXException; + +/* + * @bug 6521260 + * @summary Test setAttributeNS doesn't result in an unsorted internal list of attributes. + */ +public class Bug6521260 { + + @Test + public void test() throws ParserConfigurationException, SAXException, IOException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + DocumentBuilder builder = factory.newDocumentBuilder(); + + String docStr = ""; + + ByteArrayInputStream bais = new ByteArrayInputStream(docStr.getBytes()); + + Document doc = builder.parse(bais); + + Element root = doc.getDocumentElement(); + + String systemId = root.getAttribute("systemId"); + + // Change the prefix on the "time" attribute so that the list would + // become unsorted + // before my fix to + // xml-xerces/java/src/com/sun/org/apache/xerces/internal/dom/ElementImpl.java + root.setAttributeNS("http://xmlresolver.org/ns/catalog", "xc:time", "100"); + + String systemId2 = root.getAttribute("systemId"); + + Assert.assertEquals(systemId, systemId2); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6582545.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6582545.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,20 @@ + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6582545Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6582545Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import java.io.File; +import java.io.IOException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6582545 + * @summary Test the value is correct when iterating attributes. + */ +public class Bug6582545Test { + private DocumentBuilder xmlParser = null; + private Document document = null; + private String FWS1 = "FWS1"; + private String KEY_ARROW_UP = "KEY_ARROW_UP"; + private String VALUE_ARROW_UP = "root%LRM%Tmp_CPIOM-C1%VLIN_For_ECP%ECP_IN_Port_1%IOM-A7_Msg_cd30%FDS_1_ECP_to_FWS-1%A31_ECP_ARROW_UP"; + + @Test + public void testAttributeCaching() { + + File xmlFile = new File(getClass().getResource("Bug6582545.xml").getFile()); + + try { + DocumentBuilderFactory aDocumentBuilderFactory = DocumentBuilderFactory.newInstance(); + xmlParser = aDocumentBuilderFactory.newDocumentBuilder(); + + // works fine with JDK 1.4.2, 1.5 + // does not work with JDK 1.6 + document = xmlParser.parse(xmlFile); + printNode(FWS1); + } catch (SAXException saxException) { + saxException.printStackTrace(); + } catch (ParserConfigurationException parserConfigurationException) { + parserConfigurationException.printStackTrace(); + } catch (IOException ioException) { + ioException.printStackTrace(); + } catch (IllegalArgumentException illegalArgumentException) { + illegalArgumentException.printStackTrace(); + } + } + + private void printNode(String aNode) { + boolean error = true; + NodeList nodeList; + NamedNodeMap attributes; + + nodeList = document.getElementsByTagName(aNode); + attributes = nodeList.item(0).getAttributes(); + + String name; + String value; + // Print all nodes + for (int k = 0; k < attributes.getLength(); k++) { + name = attributes.item(k).getNodeName(); + value = attributes.item(k).getNodeValue(); + System.out.println(name + "=" + value); + } + + // Test specifique a node + String javaSpecificationVersion = System.getProperty("java.specification.version"); + for (int k = 0; k < attributes.getLength(); k++) { + name = attributes.item(k).getNodeName(); + value = attributes.item(k).getNodeValue(); + if (KEY_ARROW_UP.equals(name)) { + if (VALUE_ARROW_UP.equals(value)) { + // Parser OK + System.out.println("Parser in Java " + javaSpecificationVersion + " returned correct value."); + error = false; + } else { + // Parser NOK + System.out.println("Parser in Java " + javaSpecificationVersion + " returned wrong value"); + } + System.out.println("for node = " + KEY_ARROW_UP); + System.out.println("expecting value =" + VALUE_ARROW_UP); + System.out.println("value from parser=" + value); + } + } + + Assert.assertTrue(!error); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6879614.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6879614.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,722 @@ + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    + + + + + + +
    +
     
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if (this.disabled==0) this.className='' + + + if (this.disabled==0) this.className='Hov' + + + if (this.disabled==0) this.className='Hov' + + + if (this.disabled==0) this.className='' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +  + + + +  + + + + + + + + + + + + + + + + + + + + +  + + + +  + + +
    + + + +  + + + +  + + + + + + +  + + + +  + + +
    +
    + + + + + + + + + + + + + +
    + + + _Save + + + _Save + + + javascript: + + top.. + + save() + + +   + + + _Cancel + + + _Cancel + + + javascript: + + top.. + + cancel() + + +   + + + _Help + + + _Help + + + javascript: + +top.. + + help() + + +
    +
    + + + + + + + + + + _Delete + + + _Delete + + + javascript: + +top.. + +deleteSelectedGroup() + + +   + + + _Edit + + + _Edit + + + javascript: + + top.. + + editSelectedGroup() + + + + + + + _Close + + + _Close + + + javascript: + + top.. + + cancel() + +   + + + _Help + + + _Help + + + javascript: + + top.. + + help() + + + + + + + + + + + + + + + + + + +
    + + + _Save + + + _Save + + + javascript: + + top.. + + save() + + +   + + + _Save and Add Another + + + _Save and Add Another + + + javascript: + + top.. + + save(true) + + +   + + + _Cancel + + + _Cancel + + + javascript: + + top.. + + cancel() + + +   + + + _Help + + + _Help + + + javascript: + +top.. + + help() + + +
    +
    + + + + + + + + + + + + + + + + +
    + + + + + javascript: + + top. + . + + ok() + + +   + + + _Cancel + + + _Cancel + + + javascript: + + top.. + + cancel() + + +   + + + _Help + + + _Help + + + javascript:openhelp(' + + + + /help//p5.html#aefay'); + + + + /help//p5.html#aefaz'); + + + + /help//p6.html#aefba'); + + + + /help//p9.html#gbmoc'); + + + + /help//p36.html#gbfgy'); + + + + /help//p6.html#aefbb'); + + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    + + + _Close + + + javascript:goBack() + + + + +  + + + + _Help + + +javascript:openhelp(' + + ') + + + +
    +
    + + + + + + + + + + + + +
    + +
      + + + + + + +
    + * +   + + _Indicates required information + +
    +
     
    +
    + +
    + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6879614Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6879614Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import java.io.File; +import java.io.IOException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.annotations.Test; +import org.xml.sax.SAXException; + +/* + * @bug 6879614 + * @summary Test DocumentBuilder can parse the certain xml. + */ +public class Bug6879614Test { + + @Test + public void testAttributeCaching() { + File xmlFile = new File(getClass().getResource("Bug6879614.xml").getFile()); + DocumentBuilderFactory _documentBuilderFactory = DocumentBuilderFactory.newInstance(); + _documentBuilderFactory.setValidating(false); + _documentBuilderFactory.setIgnoringComments(true); + _documentBuilderFactory.setIgnoringElementContentWhitespace(true); + _documentBuilderFactory.setCoalescing(true); + _documentBuilderFactory.setExpandEntityReferences(true); + _documentBuilderFactory.setNamespaceAware(true); + DocumentBuilder _documentBuilder = null; + try { + _documentBuilder = _documentBuilderFactory.newDocumentBuilder(); + } catch (ParserConfigurationException pce) { + pce.printStackTrace(); + } + + Document xmlDoc = null; + try { + xmlDoc = _documentBuilder.parse(xmlFile); + if (xmlDoc == null) { + System.out.println("Hello!!!, there is a problem here"); + } else { + System.out.println("Good, the parsing went through fine."); + } + } catch (SAXException se) { + se.printStackTrace(); + } catch (IOException ioe) { + ioe.printStackTrace(); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/CR6333993Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/CR6333993Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import java.io.ByteArrayInputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/* + * @bug 6333993 + * @summary Test NodeList.item(valid index) returns value after NodeList.item(NodeList.getLength()). + */ +public class CR6333993Test { + + @Test + public void testNodeList() { + int n = 5; + while (0 != (n--)) + ; + System.out.println("n=" + n); + try { + String testXML = "" + " " + " " + " " + " " + "\n"; + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + // dbf.setNamespaceAware(true); + DocumentBuilder builder = dbf.newDocumentBuilder(); + ByteArrayInputStream bis = new ByteArrayInputStream(testXML.getBytes()); + Document testDoc = builder.parse(bis); + XPathFactory xpathFactory = XPathFactory.newInstance(); + XPath xpath = xpathFactory.newXPath(); + XPathExpression expr = xpath.compile("/root/node"); + NodeList testNodes = (NodeList) expr.evaluate(testDoc, XPathConstants.NODESET); + // Node list appears to work correctly + System.out.println("testNodes.getLength() = " + testNodes.getLength()); + System.out.println("testNodes[0] = " + testNodes.item(0)); + System.out.println("testNodes[0] = " + testNodes.item(0)); + System.out.println("testNodes.getLength() = " + testNodes.getLength()); + // Access past the end of the NodeList correctly returns null + System.out.println("testNodes[testNodes.getLength()] = " + testNodes.item(testNodes.getLength())); + // BUG! First access of valid node after accessing past the end + // incorrectly returns null + if (testNodes.item(0) == null) { + System.out.println("testNodes[0] = null"); + Assert.fail("First access of valid node after accessing past the end incorrectly returns null"); + } + // Subsequent access of valid node correctly returns the node + System.out.println("testNodes[0] = " + testNodes.item(0)); + } catch (Exception ex) { + ex.printStackTrace(); + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/CR6517707Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/CR6517707Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/* + * @bug 6517707 + * @summary Test Node.setNodeValue(value) shall throw DOMException.NO_MODIFICATION_ALLOWED_ERR if the node is read-only. + */ +public class CR6517707Test { + + @Test + public void testCanonicalForm001() { + String data = "" + "" + "" + + "" + "]>" + "" + ""; + + Document document = null; + try { + DocumentBuilderFactory docBF = DocumentBuilderFactory.newInstance(); + docBF.setNamespaceAware(true); + DocBuilderWrapper docBuilder = new DocBuilderWrapper(docBF.newDocumentBuilder()); + document = docBuilder.parse(data); + } catch (ParserConfigurationException e) { + // return Status.failed(e.toString()); + } catch (IOException e) { + // return Status.failed(e.toString()); + } catch (SAXException e) { + // return Status.failed(e.toString()); + } + + Entity anEntity = (Entity) document.getDoctype().getEntities().item(0); + boolean success = false; + try { + anEntity.setNodeValue("someValue"); // on jdk 6, not even throwing + // exception + + System.out.println("Should throw DOMException: NO_MODIFICATION_ALLOWED_ERR "); + } catch (DOMException e) { + if (e.code == DOMException.NO_MODIFICATION_ALLOWED_ERR) { + System.out.println(e.getMessage()); + success = true; + } else { + System.out.println("should throw DOMException.NO_MODIFICATION_ALLOWED_ERR (7). The error returned is " + e.code); + } + } + if (!success) { + Assert.fail("should throw DOMException.NO_MODIFICATION_ALLOWED_ERR (7)."); + } + } + + class DocBuilderWrapper { + + private DocumentBuilder docBuilder; + private final String ENCODING = "UTF-8"; + + public DocBuilderWrapper() throws ParserConfigurationException { + this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + } + + public DocBuilderWrapper(DocumentBuilder docBuilder) { + setDocumentBuilder(docBuilder); + } + + public DocumentBuilder getDocumentBuilder() { + return docBuilder; + } + + public void setDocumentBuilder(DocumentBuilder docBuilder) { + if (docBuilder == null) { + new IllegalArgumentException("DocumentBuilder cannot be null"); + } + + this.docBuilder = docBuilder; + } + + public Document parse(String xmlData) throws IOException, SAXException { + if (xmlData == null) { + new IllegalArgumentException("String cannot be null"); + } + + ByteArrayInputStream bis = new ByteArrayInputStream(xmlData.getBytes(ENCODING)); + InputStreamReader isr = new InputStreamReader(bis, ENCODING); + InputSource source = new InputSource(isr); + return docBuilder.parse(source); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/CR6517717Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/CR6517717Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import java.io.IOException; +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/* + * @bug 6517717 + * @summary Test Node.setPrefix(prefix) shall throw DOMException.NO_MODIFICATION_ALLOWED_ERR if the node is read-only. + */ +public class CR6517717Test { + + @Test + public void testCanonicalForm001() { + String data = "" + "" + "" + + "" + "]>" + "" + ""; + + Document document = null; + try { + DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + document = docBuilder.parse(new InputSource(new StringReader(data))); + } catch (ParserConfigurationException e) { + System.out.println(e.toString()); + } catch (IOException e) { + System.out.println(e.toString()); + } catch (SAXException e) { + System.out.println(e.toString()); + } + + Entity anEntity = (Entity) document.getDoctype().getEntities().item(0); + boolean success = false; + try { + anEntity.setPrefix("test1"); + System.out.println("Should throw DOMException: NO_MODIFICATION_ALLOWED_ERR "); + } catch (DOMException e) { + if (e.code == DOMException.NO_MODIFICATION_ALLOWED_ERR) { + System.out.println("OK"); + success = true; + } else { + System.out.println("should throw DOMException.NO_MODIFICATION_ALLOWED_ERR (7). The error returned is (" + e.code + ")" + e.getMessage()); + } + } + if (!success) { + Assert.fail("should throw DOMException.NO_MODIFICATION_ALLOWED_ERR (7)."); + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/CR6909336Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/CR6909336Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; +import javax.xml.transform.dom.DOMResult; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.bootstrap.DOMImplementationRegistry; + +/* + * @bug 6909336 + * @summary Test DOM writer can write more that 20 nested elements. + */ +public class CR6909336Test { + + @Test + public void test() { + try { + Document doc = DOMImplementationRegistry.newInstance().getDOMImplementation("XML 3.0").createDocument("", "root", null); + XMLStreamWriter xsw = XMLOutputFactory.newInstance().createXMLStreamWriter(new DOMResult(doc.getDocumentElement())); + for (int i = 0; i < 30; ++i) { + xsw.writeStartElement("nested"); + } + } catch (RuntimeException ex) { + System.out.println("RuntimeException ex" + ex.getMessage()); + if (ex.getMessage().equals("20")) { + Assert.fail("XMLDOMWriter cannot write more that 20 nested elements"); + } + } catch (XMLStreamException ex) { + System.out.println("XMLStreamException ex" + ex.getMessage()); + } catch (ClassNotFoundException ex) { + System.out.println("ClassNotFoundException ex" + ex.getMessage()); + } catch (InstantiationException ex) { + System.out.println("InstantiationException ex" + ex.getMessage()); + } catch (IllegalAccessException ex) { + System.out.println("IllegalAccessException ex" + ex.getMessage()); + + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/DOMConfigurationTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/DOMConfigurationTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,1609 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.w3c.dom; + +import java.io.IOException; +import java.io.StringReader; +import java.net.URISyntaxException; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.FactoryConfigurationError; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.ls.DOMImplementationLS; +import org.w3c.dom.ls.LSInput; +import org.w3c.dom.ls.LSParser; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/* + * @summary Test DOMConfiguration for supported properties. + */ +public class DOMConfigurationTest { + + static class TestHandler implements DOMErrorHandler { + private String warning; + private String error; + private String fatalError; + + public String getError() { + return error; + } + + public String getFatalError() { + return fatalError; + } + + public String getWarning() { + return warning; + } + + public boolean handleError(DOMError error) { + if (error.getSeverity() == DOMError.SEVERITY_ERROR) { + this.error = "" + error.getMessage(); + return false; + } + if (error.getSeverity() == DOMError.SEVERITY_FATAL_ERROR) { + this.fatalError = "" + error.getMessage(); + return false; + } + this.warning = "" + error.getMessage(); + return true; // warning + } + } + + static class TestFailureHandler implements DOMErrorHandler { + public boolean handleError(DOMError error) { + if (error.getSeverity() == DOMError.SEVERITY_ERROR) { + Assert.fail("Error: " + error.getMessage()); + } + if (error.getSeverity() == DOMError.SEVERITY_FATAL_ERROR) { + Assert.fail("Fatal error: " + error.getMessage()); + } + return true; // warning + } + } + + void setHandler(Document doc) { + doc.getDomConfig().setParameter("error-handler", new TestFailureHandler()); + } + + static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + + static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + static final String XMLNS = "http://www.w3.org/2000/xmlns/"; + + static Document loadDocument(String schemaURL, String instanceText) { + Document document = null; + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(true); + if (schemaURL != null) { + dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI); + dbf.setAttribute(SCHEMA_SOURCE, schemaURL); + } + DocumentBuilder parser = dbf.newDocumentBuilder(); + + InputSource inSource = new InputSource(new StringReader(instanceText)); + inSource.setSystemId("doc.xml"); + document = parser.parse(inSource); + } catch (ParserConfigurationException e) { + Assert.fail(e.toString()); + } catch (IOException e) { + Assert.fail(e.toString()); + } catch (SAXException e) { + Assert.fail(e.toString()); + } + + return document; + } + + static final String test_xml = "\n" + " 1 \n"; + + static final String test1_xml = "\n" + "\n" + " \n" + "]>\n" + + "\n"; + + static final String test2_xml = "\n" + "\n" + + " \n" + " \n" + "]>\n" + "\n"; + + static final String test3_xml = "\n" + "\n" + " \n" + + "]>\n" + "\n"; + + static String test1_xsd_url; + static { + try { + test1_xsd_url = DOMConfigurationTest.class.getResource("DOMConfigurationTest.xsd").toURI().toString(); + } catch (URISyntaxException uriSyntaxException) { + Assert.fail(uriSyntaxException.toString()); + } + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the doc contains two subsequent processing + * instrictions,
    + * name: canonical-form
    + * value: true.
    + * Expected results: the subsequent processing instrictions are + * separated with a single line break + */ + @Test + public void testCanonicalForm001() { + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + DOMConfiguration config = doc.getDomConfig(); + + Element root = doc.getDocumentElement(); + ProcessingInstruction pi1 = doc.createProcessingInstruction("target1", "data1"); + ProcessingInstruction pi2 = doc.createProcessingInstruction("target2", "data2"); + + root.appendChild(pi1); + root.appendChild(pi2); + + if (!config.canSetParameter("canonical-form", Boolean.TRUE)) { + System.out.println("OK, setting 'canonical-form' to true is not supported"); + return; + } + + config.setParameter("canonical-form", Boolean.TRUE); + setHandler(doc); + doc.normalizeDocument(); + + Node child1 = root.getFirstChild(); + Node child2 = child1.getNextSibling(); + + if (child2.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) { + Assert.fail("the second child is expected to be a" + "single line break, returned: " + child2); + } + + // return Status.passed("OK"); + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the parameters "namespaces", + * "namespace-declarations", "well-formed", "element-content-whitespace" are + * set to false if possible; the parameters "entities", + * "normalize-characters", "cdata-sections" are set to true if possible,
    + * name: canonical-form
    + * value: true.
    + * Expected results: the parameters "namespaces", + * "namespace-declarations", "well-formed", "element-content-whitespace" are + * set to true; the parameters "entities", "normalize-characters", + * "cdata-sections" are set to false + */ + @Test + public void testCanonicalForm002() { + Object[][] params = { { "namespaces", Boolean.TRUE }, { "namespace-declarations", Boolean.TRUE }, { "well-formed", Boolean.TRUE }, + { "element-content-whitespace", Boolean.TRUE }, + + { "entities", Boolean.FALSE }, { "normalize-characters", Boolean.FALSE }, { "cdata-sections", Boolean.FALSE }, }; + + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + DOMConfiguration config = doc.getDomConfig(); + + if (!config.canSetParameter("canonical-form", Boolean.TRUE)) { + System.out.println("OK, setting 'canonical-form' to true is not supported"); + return; + } + + for (int i = params.length; --i >= 0;) { + Boolean reset = params[i][1].equals(Boolean.TRUE) ? Boolean.FALSE : Boolean.TRUE; + if (config.canSetParameter(params[i][0].toString(), reset)) { + config.setParameter(params[i][0].toString(), reset); + } + } + + config.setParameter("canonical-form", Boolean.TRUE); + + StringBuffer result = new StringBuffer(); + + for (int i = params.length; --i >= 0;) { + Object param = config.getParameter(params[i][0].toString()); + if (!params[i][1].equals(param)) { + result.append("; the parameter \'" + params[i][0] + "\' is set to " + param + ", expected: " + params[i][1]); + } + } + + if (result.length() > 0) { + Assert.fail(result.toString().substring(2)); + } + + return; // Status.passed("OK"); + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the doc's root element contains superfluous + * namespace declarations,
    + * name: canonical-form
    + * value: true.
    + * Expected results: the superfluous namespace declarations are + * removed + */ + @Test + public void testCanonicalForm003() { + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + DOMConfiguration config = doc.getDomConfig(); + + Element root = doc.getDocumentElement(); + String XMLNS = "http://www.w3.org/2000/xmlns/"; + root.setAttributeNS(XMLNS, "xmlns:extra1", "ExtraNS1"); + root.setAttributeNS(XMLNS, "xmlns:extra2", "ExtraNS2"); + + if (!config.canSetParameter("canonical-form", Boolean.TRUE)) { + System.out.println("OK, setting 'canonical-form' to true is not supported"); + return; + } + config.setParameter("canonical-form", Boolean.TRUE); + setHandler(doc); + doc.normalizeDocument(); + + String xmlns2 = root.getAttributeNS(XMLNS, "extra1"); + if (xmlns2 == null || xmlns2.length() != 0) { + Assert.fail("superfluous namespace declarations is not removed: xmlns:extra2 = " + xmlns2); + } + + return; // Status.passed("OK"); + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: setting the "canonical-form" to true is supported,
    + * name: canonical-form
    + * value: true.
    + * Expected results: one of the following parameters is changed: + * "namespaces", "namespace-declarations", "well-formed", + * "element-content-whitespace", "entities", "normalize-characters", + * "cdata-sections" then "canonical-form" becomes false + */ + @Test + public void testCanonicalForm004() { + Object[][] params = { { "namespaces", Boolean.TRUE }, { "namespace-declarations", Boolean.TRUE }, { "well-formed", Boolean.TRUE }, + { "element-content-whitespace", Boolean.TRUE }, + + { "entities", Boolean.FALSE }, { "normalize-characters", Boolean.FALSE }, { "cdata-sections", Boolean.FALSE }, }; + + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + DOMConfiguration config = doc.getDomConfig(); + + if (!config.canSetParameter("canonical-form", Boolean.TRUE)) { + System.out.println("OK, setting 'canonical-form' to true is not supported"); + return; + } + + StringBuffer result = new StringBuffer(); + + for (int i = params.length; --i >= 0;) { + config.setParameter("canonical-form", Boolean.TRUE); + Boolean changedValue = (params[i][1].equals(Boolean.TRUE)) ? Boolean.FALSE : Boolean.TRUE; + if (config.canSetParameter(params[i][0].toString(), changedValue)) { + config.setParameter(params[i][0].toString(), changedValue); + Object param = config.getParameter("canonical-form"); + if (!Boolean.FALSE.equals(param)) { + result.append("; setting the parameter '" + params[i][0] + "' to " + changedValue + " does not change 'canonical-form' to false"); + } + } + } + + if (result.length() > 0) { + Assert.fail(result.toString().substring(2)); + } + + return; // Status.passed("OK"); + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the root element has one CDATASection followed by + * one Text node,
    + * name: cdata-sections
    + * value: true.
    + * Expected results: the CDATASection is left intact + */ + @Test + public void testCdataSections001() { + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + String cdataText = "CDATA CDATA CDATA"; + String textText = "text text text"; + + CDATASection cdata = doc.createCDATASection(cdataText); + Text text = doc.createTextNode(textText); + + DOMConfiguration config = doc.getDomConfig(); + config.setParameter("cdata-sections", Boolean.TRUE); + + Element root = doc.getDocumentElement(); + root.appendChild(cdata); + root.appendChild(text); + + setHandler(doc); + doc.normalizeDocument(); + + Node returned = root.getFirstChild(); + + if (returned.getNodeType() != Node.CDATA_SECTION_NODE) { + Assert.fail("reurned: " + returned + ", expected: CDATASection"); + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the root element has one CDATASection followed by + * one Text node,
    + * name: cdata-sections
    + * value: false.
    + * Expected results: the root element has one Text node with text of + * the CDATASection and the Text node + */ + @Test + public void testCdataSections002() { + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + String cdataText = "CDATA CDATA CDATA"; + String textText = "text text text"; + + CDATASection cdata = doc.createCDATASection(cdataText); + Text text = doc.createTextNode(textText); + + DOMConfiguration config = doc.getDomConfig(); + config.setParameter("cdata-sections", Boolean.FALSE); + + Element root = doc.getDocumentElement(); + root.appendChild(cdata); + root.appendChild(text); + + setHandler(doc); + doc.normalizeDocument(); + + Node returned = root.getFirstChild(); + + if (returned.getNodeType() != Node.TEXT_NODE) { + Assert.fail("reurned: " + returned + ", expected: TEXT_NODE"); + } + + String returnedText = returned.getNodeValue(); + if (!(cdataText + textText).equals(returnedText)) { + Assert.fail("reurned: " + returnedText + ", expected: \"" + cdataText + textText + "\""); + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the root element has one Text node with not fully + * normalized characters, the 'check-character-normalization' parameter set + * to true,
    + * name: error-handler
    + * value: DOMErrorHandler.
    + * Expected results: LSParser calls the specified error handler + */ + @Test + public void testCheckCharNorm001() { + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + DOMImplementationLS lsImpl = (DOMImplementationLS) domImpl.getFeature("LS", "3.0"); + + if (lsImpl == null) { + System.out.println("OK, the DOM implementation does not support the LS 3.0"); + return; + } + + LSParser lsParser = lsImpl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null); + + DOMConfiguration config = lsParser.getDomConfig(); + + if (!config.canSetParameter("check-character-normalization", Boolean.TRUE)) { + System.out.println("OK, setting 'check-character-normalization' to true is not supported"); + return; + } + + config.setParameter("check-character-normalization", Boolean.TRUE); + + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + + LSInput lsInput = lsImpl.createLSInput(); + lsInput.setStringData("\u0073\u0075\u0063\u0327\u006F\u006E"); + Document doc = lsParser.parse(lsInput); + + if (null == testHandler.getError()) { + Assert.fail("no error is reported, expected 'check-character-normalization-failure'"); + + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the root element contains a fully-normalized text,
    + * name: check-character-normalization
    + * value: false.
    + * Expected results: LSParser reports no errors + */ + @Test + public void testCheckCharNorm002() { + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + DOMImplementationLS lsImpl = (DOMImplementationLS) domImpl.getFeature("LS", "3.0"); + + if (lsImpl == null) { + System.out.println("OK, the DOM implementation does not support the LS 3.0"); + return; + } + + LSParser lsParser = lsImpl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null); + + DOMConfiguration config = lsParser.getDomConfig(); + + if (!config.canSetParameter("check-character-normalization", Boolean.FALSE)) { + Assert.fail("setting 'check-character-normalization' to false is not supported"); + } + + config.setParameter("check-character-normalization", Boolean.FALSE); + + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + + LSInput lsInput = lsImpl.createLSInput(); + lsInput.setStringData("fully-normalized"); + Document doc = lsParser.parse(lsInput); + + if (null != testHandler.getError()) { + Assert.fail("no error is expected, but reported: " + testHandler.getError()); + + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the root element has two Comment nodes,
    + * name: comments
    + * value: true.
    + * Expected results: the Comment nodes belong to the root element + */ + @Test + public void testComments001() { + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + Comment comment1 = doc.createComment("comment1"); + Comment comment2 = doc.createComment("comment2"); + + DOMConfiguration config = doc.getDomConfig(); + config.setParameter("comments", Boolean.TRUE); + + Element root = doc.getDocumentElement(); + root.appendChild(comment1); + root.appendChild(comment2); + + setHandler(doc); + doc.normalizeDocument(); + + if (comment1.getParentNode() != root) { + Assert.fail("comment1 is attached to " + comment1.getParentNode() + ", but expected to be a child of root"); + } + + if (comment2.getParentNode() != root) { + Assert.fail("comment1 is attached to " + comment2.getParentNode() + ", but expected to be a child of root"); + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the root element has two Comment nodes,
    + * name: comments
    + * value: false.
    + * Expected results: the root element has no children + */ + @Test + public void testComments002() { + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + Comment comment1 = doc.createComment("comment1"); + Comment comment2 = doc.createComment("comment2"); + + DOMConfiguration config = doc.getDomConfig(); + config.setParameter("comments", Boolean.FALSE); + + Element root = doc.getDocumentElement(); + root.appendChild(comment1); + root.appendChild(comment2); + + doc.normalizeDocument(); + + if (root.getFirstChild() != null) { + Assert.fail("root has a child " + root.getFirstChild() + ", but expected to has none"); + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the root element is declared as int and its value + * has subsequent characters #x9 (tab), #xA (line feed) and #xD (carriage + * return) , #x20 (space), '1', #x20 (space),
    + * name: datatype-normalization
    + * value: true.
    + * Expected results: after Document.normalizeDocument() is called the + * content of the root is '1' + */ + @Test + public void testDatatypeNormalization001() { + Document doc = null; + try { + doc = loadDocument(test1_xsd_url, test_xml); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + DOMConfiguration config = doc.getDomConfig(); + + if (!config.canSetParameter("schema-location", test1_xsd_url) || !config.canSetParameter("schema-type", XMLConstants.W3C_XML_SCHEMA_NS_URI)) { + System.out.println("cannot set the parameters 'schema-location' and 'schema-type'" + " to '" + test1_xsd_url + "' and '" + + XMLConstants.W3C_XML_SCHEMA_NS_URI + "' respectively"); + return; + } + config.setParameter("schema-type", XMLConstants.W3C_XML_SCHEMA_NS_URI); + config.setParameter("schema-location", test1_xsd_url); + + if (!config.canSetParameter("validate", Boolean.TRUE)) { + System.out.println("OK, setting 'validate' to true is not supported"); + return; + } + config.setParameter("validate", Boolean.TRUE); + + if (!config.canSetParameter("datatype-normalization", Boolean.TRUE)) { + System.out.println("OK, setting 'datatype-normalization' to true is not supported"); + return; + } + config.setParameter("datatype-normalization", Boolean.TRUE); + + Element root = doc.getDocumentElement(); + while (root.getFirstChild() != null) { + root.removeChild(root.getFirstChild()); + } + root.appendChild(doc.createTextNode("\t\r\n 1 ")); + + setHandler(doc); + doc.normalizeDocument(); + + Node child = root.getFirstChild(); + if (child == null || child.getNodeType() != Node.TEXT_NODE || !"1".equals(child.getNodeValue())) { + Assert.fail("child: " + child + ", expected: text node '1'"); + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the root element is declared as int and its value + * has subsequent characters #x9 (tab), #xA (line feed) and #xD (carriage + * return) , #x20 (space), '1', #x20 (space),
    + * name: datatype-normalization
    + * value: false.
    + * Expected results: after Document.normalizeDocument() is called the + * value is left unchanged + */ + @Test + public void testDatatypeNormalization002() { + Document doc = null; + try { + doc = loadDocument(test1_xsd_url, test_xml); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + DOMConfiguration config = doc.getDomConfig(); + + if (!config.canSetParameter("schema-location", test1_xsd_url) || !config.canSetParameter("schema-type", XMLConstants.W3C_XML_SCHEMA_NS_URI)) { + System.out.println("cannot set the parameters 'schema-location' and 'schema-type'" + " to '" + test1_xsd_url + "' and '" + + XMLConstants.W3C_XML_SCHEMA_NS_URI + "' respectively"); + return; + } + config.setParameter("schema-type", XMLConstants.W3C_XML_SCHEMA_NS_URI); + config.setParameter("schema-location", test1_xsd_url); + + if (config.canSetParameter("validate", Boolean.TRUE)) { + config.setParameter("validate", Boolean.TRUE); + } + + if (!config.canSetParameter("datatype-normalization", Boolean.FALSE)) { + Assert.fail("datatype-normalization' to false is not supported"); + } + config.setParameter("datatype-normalization", Boolean.FALSE); + + Element root = doc.getDocumentElement(); + while (root.getFirstChild() != null) { + root.removeChild(root.getFirstChild()); + } + String value = "\t\r\n 1 "; + root.appendChild(doc.createTextNode(value)); + + setHandler(doc); + doc.normalizeDocument(); + + Node child = root.getFirstChild(); + if (child == null || child.getNodeType() != Node.TEXT_NODE || !value.equals(child.getNodeValue())) { + Assert.fail("child: " + child + ", expected: '\\t\\r\\n 1 '"); + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the doc contains one entity and one entity + * reference,
    + * name: entities
    + * value: true.
    + * Expected results: the entity and the entity reference are left + * unchanged + */ + @Test + public void testEntities001() { + Document doc = null; + try { + doc = loadDocument(null, test1_xml); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + DOMConfiguration config = doc.getDomConfig(); + if (!config.canSetParameter("entities", Boolean.TRUE)) { + Assert.fail("setting 'entities' to true is not supported"); + } + + Element root = doc.getDocumentElement(); + root.appendChild(doc.createEntityReference("x")); + + config.setParameter("entities", Boolean.TRUE); + + setHandler(doc); + doc.normalizeDocument(); + Node child = root.getFirstChild(); + if (child == null) { + Assert.fail("root has no child"); + } + if (child.getNodeType() != Node.ENTITY_REFERENCE_NODE) { + Assert.fail("root's child is " + child + ", expected entity reference &x;"); + } + + if (doc.getDoctype() == null) { + Assert.fail("no doctype found"); + } + + if (doc.getDoctype().getEntities() == null) { + Assert.fail("no entitiy found"); + } + + if (doc.getDoctype().getEntities().getNamedItem("x") == null) { + Assert.fail("no entitiy with name 'x' found"); + } + + return; // Status.passed("OK"); + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the doc contains one entity and one entity + * reference,
    + * name: entities
    + * value: false.
    + * Expected results: the entity and the entity reference are removed + */ + @Test + public void testEntities002() { + Document doc = null; + try { + doc = loadDocument(null, test1_xml); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + DOMConfiguration config = doc.getDomConfig(); + if (!config.canSetParameter("entities", Boolean.FALSE)) { + Assert.fail("setting 'entities' to false is not supported"); + } + + Element root = doc.getDocumentElement(); + root.appendChild(doc.createEntityReference("x")); + + // TODO: remove debug + NamedNodeMap entities = doc.getDoctype().getEntities(); + Entity entityX = (Entity) entities.getNamedItem("x"); + System.err.println(); + System.err.println("Entity x: " + entityX.getTextContent()); + System.err.println(); + + config.setParameter("entities", Boolean.FALSE); + + setHandler(doc); + doc.normalizeDocument(); + Node child = root.getFirstChild(); + + // TODO: restore test, exclude for now to allow other tests to run + /* + * if (child == null) { fail("root has no child"); } if + * (child.getNodeType() != Node.TEXT_NODE || + * !"X".equals(child.getNodeValue())) { fail("root's child is " + child + * + ", expected text node with value 'X'"); } + * + * if (doc.getDoctype() == null) { fail("no doctype found"); } + * + * if (doc.getDoctype().getEntities() != null && + * doc.getDoctype().getEntities().getNamedItem("x") != null) { + * fail("entity with name 'x' is found, expected to be removed"); } + */ + + return; // Status.passed("OK"); + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the 'infoset' parameter is set to true,
    + * name: infoset
    + * value: false.
    + * Expected results: the parameters "validate-if-schema", "entities", + * "datatype-normalization", "cdata-sections", "namespace-declarations", + * "well-formed", "element-content-whitespace", "comments", "namespaces" are + * left unchanged + */ + @Test + public void testInfoset001() { + Object[][] params = { { "validate-if-schema", Boolean.FALSE }, { "entities", Boolean.FALSE }, { "datatype-normalization", Boolean.FALSE }, + { "cdata-sections", Boolean.FALSE }, + + { "namespace-declarations", Boolean.TRUE }, { "well-formed", Boolean.TRUE }, { "element-content-whitespace", Boolean.TRUE }, + { "comments", Boolean.TRUE }, { "namespaces", Boolean.TRUE }, }; + + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + DOMConfiguration config = doc.getDomConfig(); + + if (!config.canSetParameter("infoset", Boolean.TRUE)) { + Assert.fail("setting 'infoset' to true is not supported"); + } + + for (int i = params.length; --i >= 0;) { + Boolean reset = params[i][1].equals(Boolean.TRUE) ? Boolean.FALSE : Boolean.TRUE; + if (config.canSetParameter(params[i][0].toString(), reset)) { + config.setParameter(params[i][0].toString(), reset); + } + } + + config.setParameter("infoset", Boolean.TRUE); + config.setParameter("infoset", Boolean.FALSE); // has no effect + + StringBuffer result = new StringBuffer(); + + for (int i = params.length; --i >= 0;) { + Object param = config.getParameter(params[i][0].toString()); + if (!params[i][1].equals(param)) { + result.append("; the parameter \'" + params[i][0] + "\' is set to " + param + ", expected: " + params[i][1]); + } + } + + if (result.length() > 0) { + Assert.fail(result.toString().substring(2)); + } + + return; // Status.passed("OK"); + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: A document with one root element created. The + * prefix 'ns' is bound to 'namespaceURI'. The 'namespaces' parameter is set + * to true,
    + * name: namespace-declarations
    + * value: false.
    + * Expected results: Attribute xmlns:ns="namespaceURI" is not added + * to the root element + */ + @Test + public void testNamespaces001() { + DOMImplementation domImpl = null; + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + domImpl = dbf.newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + setHandler(doc); + Element root = doc.getDocumentElement(); + DOMConfiguration config = doc.getDomConfig(); + + StringBuffer result = new StringBuffer(); + if (config.canSetParameter("namespaces", Boolean.FALSE)) { + config.setParameter("namespaces", Boolean.FALSE); + + // namespaces = false + // namespace-declarations = true (default) + doc.normalizeDocument(); + String xmlnsNS = root.getAttributeNS(XMLNS, "ns"); + if (xmlnsNS.length() > 0) { + result.append("; the 'namespaces' parameter is set to false but" + "Namespace normalization is performed, attribute" + " xmlns:ns=\"" + xmlnsNS + + "\" is added"); + } + } + + doc = domImpl.createDocument("namespaceURI", "ns:root", null); + root = doc.getDocumentElement(); + config = doc.getDomConfig(); + + if (!config.canSetParameter("namespaces", Boolean.TRUE)) { + result.append("; setting 'namespaces' to true is not supported"); + } else { + + config.setParameter("namespaces", Boolean.TRUE); + + if (!config.canSetParameter("namespace-declarations", Boolean.FALSE)) { + result.append("; setting 'namespace-declarations' to false is not supported"); + } else { + config.setParameter("namespace-declarations", Boolean.FALSE); + + // namespaces = true + // namespace-declarations = false + doc.normalizeDocument(); + + String xmlnsNS = root.getAttributeNS(XMLNS, "ns"); + if (xmlnsNS.length() > 0) { + result.append("; namespaces = true, namespace-declarations = false, but" + " xmlns:ns=\"" + xmlnsNS + "\""); + } + } + + doc = domImpl.createDocument("namespaceURI", "ns:root", null); + setHandler(doc); + root = doc.getDocumentElement(); + config = doc.getDomConfig(); + + config.setParameter("namespaces", Boolean.TRUE); + + if (!config.canSetParameter("namespace-declarations", Boolean.TRUE)) { + result.append("; setting 'namespace-declarations' to true is not supported"); + } else { + config.setParameter("namespace-declarations", Boolean.TRUE); + + // namespaces = true + // namespace-declarations = true + doc.normalizeDocument(); + + String xmlnsNS = root.getAttributeNS(XMLNS, "ns"); + if (!"namespaceURI".equals(xmlnsNS)) { + result.append("; namespaces = true, namespace-declarations = true, but" + " xmlns:ns=\"" + xmlnsNS + "\""); + } + } + } + + if (result.length() > 0) { + Assert.fail(result.toString().substring(2)); + } + return; // Status.passed("OK"); + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: an attribute value is not fully normalized,
    + * name: normalize-characters
    + * value: false.
    + * Expected results: Node.normalize() leaves the value unchanged + */ + @Test + public void testNormalizeCharacters001() { + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument(null, null, null); + + Attr attr = doc.createAttribute("attr"); + String notNormalized = " \u0073\u0075\u0063\u0327\u006F\u006E "; + attr.setValue(notNormalized); + + DOMConfiguration config = doc.getDomConfig(); + + StringBuffer result = new StringBuffer(); + if (!config.canSetParameter("normalize-characters", Boolean.FALSE)) { + result.append("; setting 'normalize-characters' to false is not supported"); + } else { + + config.setParameter("normalize-characters", Boolean.FALSE); + + attr.normalize(); + + String value = attr.getValue(); + if (!notNormalized.equals(value)) { + result.append("; the value is normalized to '" + value + "', expected to stay unchanged"); + } + } + + if (config.canSetParameter("normalize-characters", Boolean.TRUE)) { + config.setParameter("normalize-characters", Boolean.TRUE); + + attr.setValue(notNormalized); + attr.normalize(); + + String value = attr.getValue(); + if (notNormalized.equals(value)) { + result.append("; the value is not normalized: '" + value + "', expected: '\u0073\u0075\u00E7\u006F\u006E'"); + } + } + + if (result.length() > 0) { + Assert.fail(result.toString().substring(2)); + } + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: The root element has invalid content. The + * 'validate' parameter is set to true. The 'schema-location' parameter is + * set to 'DOMConfigurationTest.xsd'.,
    + * name: schema-type
    + * value: http://www.w3.org/2001/XMLSchema.
    + * Expected results: An error is reported + */ + @Test + public void testValidate001() { + DOMImplementation domImpl = null; + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(true); + domImpl = dbf.newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("test", "ns:root", null); + + Element root = doc.getDocumentElement(); + root.appendChild(doc.createTextNode("xxx")); // invalid value + + DOMConfiguration config = doc.getDomConfig(); + + if (!config.canSetParameter("schema-location", test1_xsd_url) || !config.canSetParameter("schema-type", XMLConstants.W3C_XML_SCHEMA_NS_URI)) { + System.out.println("cannot set the parameters 'schema-location' and 'schema-type'" + " to '" + test1_xsd_url + "' and '" + + XMLConstants.W3C_XML_SCHEMA_NS_URI + "' respectively"); + return; + } + config.setParameter("schema-type", XMLConstants.W3C_XML_SCHEMA_NS_URI); + config.setParameter("schema-location", test1_xsd_url); + + String resultOK = "OK"; + StringBuffer result = new StringBuffer(); + if (!config.canSetParameter("validate", Boolean.TRUE)) { + resultOK = "OK, setting the parameter 'validate' to true is not supported"; + } else { + config.setParameter("validate", Boolean.TRUE); + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + doc.normalizeDocument(); + if (testHandler.getError() == null && null == testHandler.getFatalError()) { + result.append("; no error was reported when the 'validate' is set to true"); + } + } + + if (!config.canSetParameter("validate", Boolean.FALSE)) { + result.append("; cannot set the parameters 'validate' to false"); + } else { + config.setParameter("validate", Boolean.FALSE); + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + doc.normalizeDocument(); + if (testHandler.getError() != null || null != testHandler.getFatalError()) { + result.append("; unexpected error: " + testHandler.getFatalError() + "; " + testHandler.getError()); + } + } + + if (result.length() > 0) { + Assert.fail(result.toString().substring(2)); + } + return; // Status.passed(resultOK); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: The root contains a CDATASection with the + * termination marker ']]>',
    + * name: split-cdata-sections
    + * value: true.
    + * Expected results: A warning is reported when the section is + * splitted + */ + @Test + public void testSplitCDATA001() { + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + DOMConfiguration config = doc.getDomConfig(); + CDATASection cdata = doc.createCDATASection("text]" + "]>text"); + doc.getDocumentElement().appendChild(cdata); + + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + + if (!config.canSetParameter("split-cdata-sections", Boolean.TRUE)) { + Assert.fail("cannot set the parameters 'split-cdata-sections' to true"); + } + config.setParameter("split-cdata-sections", Boolean.TRUE); + + doc.normalizeDocument(); + if (null == testHandler.getWarning()) { + Assert.fail("no warning is reported"); + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: The root contains a CDATASection with the + * termination marker ']]>',
    + * name: split-cdata-sections
    + * value: false.
    + * Expected results: No warning is reported + */ + @Test + public void testSplitCDATA002() { + DOMImplementation domImpl = null; + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(true); + domImpl = dbf.newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("namespaceURI", "ns:root", null); + + DOMConfiguration config = doc.getDomConfig(); + CDATASection cdata = doc.createCDATASection("text]" + "]>text"); + doc.getDocumentElement().appendChild(cdata); + + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + + if (!config.canSetParameter("split-cdata-sections", Boolean.FALSE)) { + Assert.fail("cannot set the parameters 'split-cdata-sections' to false"); + } + config.setParameter("split-cdata-sections", Boolean.FALSE); + + doc.normalizeDocument(); + if (null == testHandler.getError()) { + Assert.fail("no error is reported"); + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: The root element has invalid content. The schema + * is specified by setting the 'schema-location' and the 'schema-type' + * parameters.,
    + * name: validate-if-schema
    + * value: false.
    + * Expected results: No error is reported + */ + @Test + public void testValidateIfSchema001() { + DOMImplementation domImpl = null; + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(true); + domImpl = dbf.newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("test", "ns:root", null); + + Element root = doc.getDocumentElement(); + root.appendChild(doc.createTextNode("xxx")); // invalid value + + DOMConfiguration config = doc.getDomConfig(); + + if (!config.canSetParameter("schema-location", test1_xsd_url) || !config.canSetParameter("schema-type", XMLConstants.W3C_XML_SCHEMA_NS_URI)) { + System.out.println("cannot set the parameters 'schema-location' and 'schema-type'" + " to 'DOMConfigurationTest.xsd' and '" + + XMLConstants.W3C_XML_SCHEMA_NS_URI + "' respectively"); + return; + } + config.setParameter("schema-type", XMLConstants.W3C_XML_SCHEMA_NS_URI); + config.setParameter("schema-location", test1_xsd_url); + + String resultOK = "OK"; + StringBuffer result = new StringBuffer(); + if (!config.canSetParameter("validate-if-schema", Boolean.FALSE)) { + result.append("; cannot set the parameters 'validate-if-schema' to false"); + } else { + config.setParameter("validate-if-schema", Boolean.FALSE); + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + doc.normalizeDocument(); + if (testHandler.getError() != null || null != testHandler.getFatalError()) { + result.append("; unexpected error: " + testHandler.getFatalError() + "; " + testHandler.getError()); + } + } + + if (!config.canSetParameter("validate-if-schema", Boolean.TRUE)) { + resultOK = "OK, setting the parameter 'validate-if-schema' to true is not supported"; + } else { + config.setParameter("validate-if-schema", Boolean.TRUE); + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + doc.normalizeDocument(); + if (testHandler.getError() == null && null == testHandler.getFatalError()) { + result.append("; no error was reported when the 'validate-if-schema' is set to true"); + } + } + + if (result.length() > 0) { + Assert.fail(result.toString().substring(2)); + } + return; // Status.passed(resultOK); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: The root element is not declared in the schema + * specified by setting the 'schema-location' and the 'schema-type' + * parameters.,
    + * name: validate-if-schema
    + * value: true.
    + * Expected results: No error is reported + */ + @Test + public void testValidateIfSchema002() { + DOMImplementation domImpl = null; + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(true); + domImpl = dbf.newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException pce) { + Assert.fail(pce.toString()); + } catch (FactoryConfigurationError fce) { + Assert.fail(fce.toString()); + } + + Document doc = domImpl.createDocument("test", "ns:undeclared_root", null); + + Element root = doc.getDocumentElement(); + root.appendChild(doc.createTextNode("xxx")); + + DOMConfiguration config = doc.getDomConfig(); + + if (!config.canSetParameter("schema-location", test1_xsd_url) || !config.canSetParameter("schema-type", XMLConstants.W3C_XML_SCHEMA_NS_URI)) { + System.out.println("cannot set the parameters 'schema-location' and 'schema-type'" + " to 'DOMConfigurationTest.xsd' and '" + + XMLConstants.W3C_XML_SCHEMA_NS_URI + "' respectively"); + return; + } + config.setParameter("schema-type", XMLConstants.W3C_XML_SCHEMA_NS_URI); + config.setParameter("schema-location", test1_xsd_url); + + if (!config.canSetParameter("validate-if-schema", Boolean.TRUE)) { + System.out.println("OK, setting the parameter 'validate-if-schema'" + " to true is not supported"); + return; + } + + config.setParameter("validate-if-schema", Boolean.TRUE); + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + doc.normalizeDocument(); + if (testHandler.getError() != null || null != testHandler.getFatalError()) { + Assert.fail("unexpected error: " + testHandler.getFatalError() + "; " + testHandler.getError()); + } + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the attribute has EntityReference to '<',
    + * name: well-formed
    + * value: true.
    + * Expected results: An error is reported + */ + @Test + public void testWellFormed001() { + Document doc = null; + try { + doc = loadDocument(null, test2_xml); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + DOMConfiguration config = doc.getDomConfig(); + if (!config.canSetParameter("well-formed", Boolean.TRUE)) { + Assert.fail("setting 'well-formed' to true is not supported"); + } + config.setParameter("well-formed", Boolean.TRUE); + + Element root = doc.getDocumentElement(); + + Attr attr = doc.createAttributeNS(null, "attr"); + + try { + attr.appendChild(doc.createEntityReference("<")); + } catch (DOMException domException) { + System.out.println("testWellFormed001: Expected DOMException for Attribute value = '<'" + domException.toString()); + return; // OK + } + + root.setAttributeNode(attr); + + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + + doc.normalizeDocument(); + + if (testHandler.getError() == null && null == testHandler.getFatalError()) { + Assert.fail("no error was reported when attribute has <"); + } + + return; // Status.passed("OK"); + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the attribute has EntityReference to '<',
    + * name: well-formed
    + * value: false.
    + * Expected results: No error is reported + */ + @Test + public void testWellFormed002() { + Document doc = null; + try { + doc = loadDocument(null, test2_xml); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + DOMConfiguration config = doc.getDomConfig(); + if (!config.canSetParameter("well-formed", Boolean.FALSE)) { + System.out.println("OK, setting 'well-formed' to false is not supported"); + return; + } + config.setParameter("well-formed", Boolean.FALSE); + + Element root = doc.getDocumentElement(); + + Attr attr = doc.createAttributeNS(null, "attr"); + attr.appendChild(doc.createEntityReference("x")); + + root.setAttributeNode(attr); + + TestHandler testHandler = new TestHandler(); + config.setParameter("error-handler", testHandler); + + doc.normalizeDocument(); + + if (testHandler.getError() != null || null != testHandler.getFatalError()) { + Assert.fail("unexpected error: " + testHandler.getFatalError() + "; " + testHandler.getError()); + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the document root element has a text node with + * four white space characters,
    + * name: element-content-whitespace
    + * value: true.
    + * Expected results: the text node is preserved + */ + @Test + public void testECWhitespace001() { + Document doc = null; + try { + doc = loadDocument(null, test3_xml); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + Element root = doc.getDocumentElement(); + Text text = doc.createTextNode("\t\n\r "); + root.appendChild(text); + + DOMConfiguration config = doc.getDomConfig(); + if (!config.canSetParameter("element-content-whitespace", Boolean.TRUE)) { + Assert.fail("setting 'element-content-whitespace' to true is not supported"); + } + config.setParameter("element-content-whitespace", Boolean.TRUE); + + if (!config.canSetParameter("validate", Boolean.TRUE)) { + System.out.println("OK, setting 'validate' to true is not supported"); + return; + } + config.setParameter("validate", Boolean.TRUE); + + setHandler(doc); + doc.normalizeDocument(); + + Node firstChild = root.getFirstChild(); + if (firstChild == null || firstChild.getNodeType() != Node.TEXT_NODE || !((Text) firstChild).isElementContentWhitespace()) { + Assert.fail("the first child is " + firstChild + ", expected a text node with the four whitespace characters"); + } + + return; // Status.passed("OK"); + + } + + /** + * Equivalence class partitioning with state and input values orientation + * for public void setParameter(String name, Object value) throws + * DOMException,
    + * pre-conditions: the document root element has a text node with + * four white space characters,
    + * name: element-content-whitespace
    + * value: false.
    + * Expected results: the text node is discarded + */ + @Test + public void testECWhitespace002() { + Document doc = null; + try { + doc = loadDocument(null, test3_xml); + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + Element root = doc.getDocumentElement(); + Text text = doc.createTextNode("\t\n\r "); + root.appendChild(text); + + DOMConfiguration config = doc.getDomConfig(); + if (!config.canSetParameter("element-content-whitespace", Boolean.FALSE)) { + System.out.println("OK, setting 'element-content-whitespace' to false is not supported"); + return; + } + config.setParameter("element-content-whitespace", Boolean.FALSE); + + if (!config.canSetParameter("validate", Boolean.TRUE)) { + System.out.println("OK, setting 'validate' to true is not supported"); + return; + } + config.setParameter("validate", Boolean.TRUE); + + setHandler(doc); + doc.normalizeDocument(); + + Node firstChild = root.getFirstChild(); + if (firstChild != null) { + Assert.fail("the first child is " + firstChild + ", but no child is expected"); + } + + return; // Status.passed("OK"); + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/DOMConfigurationTest.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/DOMConfigurationTest.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,6 @@ + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/TCKEncodingTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/TCKEncodingTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom; + +import java.io.IOException; +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/* + * @summary Test Document.getInputEncoding(). + */ +public class TCKEncodingTest { + + /** + * Assertion testing + * for public String getInputEncoding(), + * An attribute specifying the actual encoding of this document.. + */ + @Test + public void testGetInputEncoding001() { + String data = "" + "" + "]>" + ""; + + Document doc = null; + try { + DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + InputSource inSource = new InputSource(new StringReader(data)); + inSource.setEncoding("UTF-8"); + inSource.setSystemId("test.xml"); + doc = docBuilder.parse(inSource); + } catch (ParserConfigurationException e) { + Assert.fail(e.toString()); + } catch (IOException e) { + Assert.fail(e.toString()); + } catch (SAXException e) { + Assert.fail(e.toString()); + } + + String encoding = doc.getInputEncoding(); + if (encoding == null || !encoding.equals("UTF-8")) { + Assert.fail("expected encoding: UTF-8, returned: " + encoding); + } + + System.out.println("OK"); + } + + /** + * Assertion testing + * for public String getInputEncoding(), + * Encoding is not specified. getInputEncoding returns null.. + */ + @Test + public void testGetInputEncoding002() { + Document doc = null; + try { + DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + doc = db.newDocument(); + } catch (ParserConfigurationException e) { + Assert.fail(e.toString()); + } + + String encoding = doc.getInputEncoding(); + if (encoding != null) { + Assert.fail("expected encoding: null, returned: " + encoding); + } + + System.out.println("OK"); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/Bug4973153.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/Bug4973153.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom.ls; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.StringBufferInputStream; +import java.io.Writer; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.ls.DOMImplementationLS; +import org.w3c.dom.ls.LSInput; +import org.w3c.dom.ls.LSOutput; +import org.w3c.dom.ls.LSParser; +import org.w3c.dom.ls.LSSerializer; +import org.xml.sax.SAXException; + +/* + * @bug 4973153 + * @summary Test LSSerialiser.setEncoding() raises 'unsupported-encoding' error if encoding is invalid. + */ +public class Bug4973153 { + + DOMImplementationLS implLS = null; + public String xml1 = ""; + + @Test + public void testOne() { + LSParser db = createLSParser(); + if (db == null) { + System.out.println("Unable to create LSParser !"); + return; + } + LSSerializer dw = createLSSerializer(); + if (dw == null) { + System.out.println("Unable to create LSSerializer!"); + return; + } + + DOMErrorHandlerImpl eh = new DOMErrorHandlerImpl(); + dw.getDomConfig().setParameter("error-handler", eh); + Document doc = db.parse(getXml1Source()); + + Output out = new Output(); + out.setByteStream(new ByteArrayOutputStream()); + out.setEncoding("WrOnG_EnCoDiNg"); + try { + if (dw.write(doc, out)) { + System.out.println("Expected result value - false"); + return; + } + } catch (Exception ex) { + // This is bad. + } + if (!eh.WrongEncodingErrorReceived) { + Assert.fail("'unsupported-encoding' error was expected "); + return; + } + System.out.println("OKAY"); + return; + } + + @BeforeMethod + protected void setUp() { + Document doc = null; + DocumentBuilder parser = null; + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + parser = factory.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } + StringBufferInputStream is = new StringBufferInputStream(xml1); + try { + doc = parser.parse(is); + } catch (SAXException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + DOMImplementation impl = doc.getImplementation(); + implLS = (DOMImplementationLS) impl.getFeature("LS", "3.0"); + } + + @AfterMethod + protected void tearDown() { + implLS = null; + } + + public LSParser createLSParser() { + return implLS.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, "http://www.w3.org/2001/XMLSchema"); + } + + public LSSerializer createLSSerializer() { + return implLS.createLSSerializer(); + } + + public LSInput createLSInput() { + return implLS.createLSInput(); + } + + public LSInput getXml1Source() { + LSInput src = createLSInput(); + src.setStringData(xml1); + return src; + } +} + +class Output implements LSOutput { + OutputStream bs; + Writer cs; + String sId; + String enc; + + public Output() { + bs = null; + cs = null; + sId = null; + enc = "UTF-8"; + } + + public OutputStream getByteStream() { + return bs; + } + + public void setByteStream(OutputStream byteStream) { + bs = byteStream; + } + + public Writer getCharacterStream() { + return cs; + } + + public void setCharacterStream(Writer characterStream) { + cs = characterStream; + } + + public String getSystemId() { + return sId; + } + + public void setSystemId(String systemId) { + sId = systemId; + } + + public String getEncoding() { + return enc; + } + + public void setEncoding(String encoding) { + enc = encoding; + } +} + +class DOMErrorHandlerImpl implements DOMErrorHandler { + boolean NoOutputSpecifiedErrorReceived = false; + boolean WrongEncodingErrorReceived = false; + + public boolean handleError(DOMError error) { + if ("no-output-specified".equalsIgnoreCase(error.getType())) { + NoOutputSpecifiedErrorReceived = true; + } else if ("unsupported-encoding".equalsIgnoreCase(error.getType())) { + WrongEncodingErrorReceived = true; + } + return true; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/Bug6290947.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/Bug6290947.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom.ls; + +import java.io.StringBufferInputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.ls.DOMImplementationLS; +import org.w3c.dom.ls.LSInput; +import org.w3c.dom.ls.LSParser; +import org.w3c.dom.ls.LSSerializer; +import org.w3c.dom.ls.LSSerializerFilter; +import org.w3c.dom.traversal.NodeFilter; + +/* + * @bug 6290947 + * @summary Test LSSerializer writes the XML declaration when LSSerializerFilter is set that rejects all nodes and + * LSSerializer's configuration set parameter "xml-declaration" to "true". + */ +public class Bug6290947 { + + private static String XML_STRING = "test1"; + private static DOMImplementationLS implLS; + private final String XML_FILE_INTERNAL_DTD = "note_in_dtd.xml"; + + @Test + public void testStringSourceWithXmlDecl() { + String result = prepare(XML_STRING, true); + System.out.println("testStringSource: output: " + result); + Assert.assertTrue(result.indexOf("-1, "XML Declaration expected in output"); + } + + @Test + public void testStringSourceWithOutXmlDecl() { + String result = prepare(XML_STRING, false); + System.out.println("testStringSource: output: " + result); + Assert.assertTrue(result.indexOf("0, "XML Declaration and DTD are expected in output"); + } + + @Test + public void testXmlWithInternalDTD2() { + String result = prepare(XML_FILE_INTERNAL_DTD, false); + System.out.println("testStringSource: output: " + result); + Assert.assertTrue(result.indexOf("-1, "DTD is expected in output"); + } + + private String prepare(String source, boolean xmlDeclFlag) { + Document startDoc = null; + DocumentBuilder domParser = null; + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + domParser = factory.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + + final StringBufferInputStream is = new StringBufferInputStream(XML_STRING); + try { + startDoc = domParser.parse(is); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + + DOMImplementation impl = startDoc.getImplementation(); + implLS = (DOMImplementationLS) impl.getFeature("LS", "3.0"); + LSParser parser = implLS.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, "http://www.w3.org/2001/XMLSchema"); + + LSInput src = getXmlSource(source); + + LSSerializer writer = implLS.createLSSerializer(); + + DOMConfiguration conf = writer.getDomConfig(); + conf.setParameter("xml-declaration", Boolean.valueOf(xmlDeclFlag)); + + // set filter + writer.setFilter(new LSSerializerFilter() { + public short acceptNode(Node enode) { + return FILTER_REJECT; + + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ELEMENT; + } + }); + + Document doc = parser.parse(src); + return writer.writeToString(doc); + } + + private LSInput getXmlSource(String xml1) { + LSInput src = implLS.createLSInput(); + try { + if (xml1.endsWith(".xml")) + src.setByteStream(this.getClass().getResourceAsStream(XML_FILE_INTERNAL_DTD)); + else + src.setStringData(xml1); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + return src; + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/Bug6354955.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/Bug6354955.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom.ls; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.CDATASection; +import org.w3c.dom.Comment; +import org.w3c.dom.Document; +import org.w3c.dom.EntityReference; +import org.w3c.dom.Node; +import org.w3c.dom.ProcessingInstruction; +import org.w3c.dom.Text; +import org.w3c.dom.ls.DOMImplementationLS; +import org.w3c.dom.ls.LSSerializer; + + +/* + * @bug 6354955 + * @summary Test LSSerializer can writeToString on DOM Text node with white space. + */ +public class Bug6354955 { + + @Test + public void testTextNode() { + try { + Document xmlDocument = createNewDocument(); + + String whitespace = "\r\n "; + Text textNode = xmlDocument.createTextNode(whitespace); + + System.out.println("original text is:\r\n\"" + whitespace + "\""); + String outerXML = getOuterXML(textNode); + System.out.println("OuterXML Text Node is:\r\n\"" + outerXML + "\""); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testCommentNode() { + try { + Document xmlDocument = createNewDocument(); + String commentStr = "This is a comment node"; + Comment cmtNode = xmlDocument.createComment(commentStr); + String outerXML = getOuterXML(cmtNode); + System.out.println("OuterXML of Comment Node is:" + outerXML); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testPINode() { + try { + Document xmlDocument = createNewDocument(); + ProcessingInstruction piNode = xmlDocument.createProcessingInstruction("execute", "test"); + String outerXML = getOuterXML(piNode); + System.out.println("OuterXML of Comment Node is:" + outerXML); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testCDATA() { + try { + Document xmlDocument = createNewDocument(); + CDATASection cdataNode = xmlDocument.createCDATASection("See Data!!"); + String outerXML = getOuterXML(cdataNode); + System.out.println("OuterXML of Comment Node is:" + outerXML); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + @Test + public void testEntityReference() { + try { + Document xmlDocument = createNewDocument(); + EntityReference erefNode = xmlDocument.createEntityReference("entityref"); + String outerXML = getOuterXML(erefNode); + System.out.println("OuterXML of Comment Node is:" + outerXML); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Exception occured: " + e.getMessage()); + } + } + + private String getOuterXML(Node node) { + DOMImplementationLS domImplementation = (DOMImplementationLS) node.getOwnerDocument().getImplementation(); + LSSerializer lsSerializer = domImplementation.createLSSerializer(); + if (!(node instanceof Document)) { + lsSerializer.getDomConfig().setParameter("xml-declaration", false); + } + return lsSerializer.writeToString(node); + } + + private Document createNewDocument() throws Exception { + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + documentBuilderFactory.setNamespaceAware(true); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + return documentBuilder.newDocument(); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/Bug6376823.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/Bug6376823.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom.ls; + +import java.io.StringBufferInputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.ls.DOMImplementationLS; +import org.w3c.dom.ls.LSInput; +import org.w3c.dom.ls.LSParser; +import org.w3c.dom.ls.LSSerializer; +import org.w3c.dom.ls.LSSerializerFilter; +import org.w3c.dom.traversal.NodeFilter; + +/* + * @bug 6376823 + * @summary Test LSSerializer works. + */ +public class Bug6376823 { + + private static String XML_STRING = "test1"; + private static DOMImplementationLS implLS; + + @Test + public void testStringSourceWithXmlDecl() { + String result = prepare(XML_STRING, true); + System.out.println("testStringSource: output: " + result); + Assert.assertTrue(result.indexOf("test1"; + + /** + * Equivalence class partitioning + * with state, input and output values orientation + * for public Document parse(LSInput is), + *
    pre-conditions: set filter that REJECTs any CHILD* node, + *
    is: xml1 + *
    output: XML document with ELEMNENT1 and ELEMENT2 only. + */ + @Test + public void testfilter0001() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser!"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + return FILTER_ACCEPT; + } + + public short acceptNode(Node enode) { + if (enode.getNodeName().startsWith("CHILD")) { + return FILTER_REJECT; + } + return FILTER_ACCEPT; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + String expected = "test1"; + Document doc = parser.parse(getXmlSource(xml1)); + if (!match(expected, doc)) { + Assert.fail("DOM structure after parsing is not equal to a structure of XML document, that being parsed"); + } + + System.out.println("OKAY"); + } + + public LSParserTCKTest(String name) { + init(); + } + + protected void init() { + Document doc = null; + DocumentBuilder parser = null; + try { + parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } + StringBufferInputStream is = new StringBufferInputStream(xml1); + try { + doc = parser.parse(is); + } catch (SAXException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + DOMImplementation impl = doc.getImplementation(); + implLS = (DOMImplementationLS) impl.getFeature("LS", "3.0"); + } + + public LSInput getXmlSource(String xmldoc) { + LSInput srcdoc = createLSInput(); + srcdoc.setStringData(xmldoc); + return srcdoc; + } + + public LSInput createLSInput() { + return implLS.createLSInput(); + } + + public LSParser createLSParser() { + return implLS.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, "http://www.w3.org/2001/XMLSchema"); + } + + public boolean match(String template, Node source) { + LSParser dp = createLSParser(); + if (dp == null) { + System.out.println("Can not create LSParser."); + return false; + } + LSInput src = getXmlSource(template); + Document doc = dp.parse(src); + return checkXMLs(doc, source); + } + + // ========================== XML comparison code ============== + public boolean checkXMLs(Node template, Node source) { + if (source == null || template == null) { + return template == source; + } + String tname = template.getLocalName(); + String tvalue = template.getNodeValue(); + NamedNodeMap tattr = template.getAttributes(); + NodeList tchildren = template.getChildNodes(); + + String sname = source.getLocalName(); + String svalue = source.getNodeValue(); + NamedNodeMap sattr = source.getAttributes(); + NodeList schildren = source.getChildNodes(); + if (tname != null && !tname.equals(sname)) { + return false; + } + if (tvalue != null && !tvalue.equals(svalue)) { + return false; + } + if (tattr != null && sattr != null) { + if (sattr.getLength() != tattr.getLength()) { + return false; + } + for (int i = 0; i < tattr.getLength(); i++) { + Attr t = (Attr) tattr.item(i); + Attr s = (Attr) sattr.getNamedItem(t.getName()); + if (!checkXMLAttrs(t, s)) { + // ref.println(sname+": [expected attr: " + t + + // "; actual attr: " +s+"]"); + return false; + } + } + } else if (tattr != null || sattr != null) { + return false; + } + + for (int i = 0; i < tchildren.getLength(); i++) { + if (!checkXMLs(tchildren.item(i), schildren.item(i))) { + // ref.println(sname+": [expected node: "+tchildren.item(i) + // +"; actual node: "+schildren.item(i)+"]"); + return false; + } + } + return true; + } + + public boolean checkXMLAttrs(Attr template, Attr source) { + if (source == null || template == null) { + return template == source; + } + String tname = template.getName(); + String tvalue = template.getValue(); + String sname = source.getName(); + String svalue = source.getValue(); + System.out.println("Attr:" + tname + "?" + sname); + if (tname != null && !tname.equals(sname)) { + // ref.println("Attr Name:" + tname + "!=" + sname); + return false; + } + if (tvalue != null && !tvalue.equals(svalue)) { + // ref.println("Attr value:" + tvalue + "!=" + svalue); + return false; + } + // ref.println("Attr:" + tname + ":" + tvalue + "=" + sname + ":" + + // svalue); + return true; + } + + /** + * Equivalence class partitioning with state, input and output values + * orientation for public Document parse(LSInput is),
    + * pre-conditions: set filter that SKIPs ELEMENT1 node,
    + * is: xml1
    + * output: XML document with CHILD1 and ELEMENT2 only. + */ + @Test + public void testFilter0002() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser!"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + return FILTER_ACCEPT; + } + + public short acceptNode(Node enode) { + if (enode.getNodeName().startsWith("ELEMENT1")) { + return FILTER_SKIP; + } + return FILTER_ACCEPT; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + String expected = "test1"; + Document doc = parser.parse(getXmlSource(xml1)); + if (!match(expected, doc)) { + Assert.fail("DOM structure after parsing is not equal to a structure of XML document, that being parsed"); + } + System.out.println("OKAY"); + } + + /** + * Equivalence class partitioning with state, input and output values + * orientation for public Document parse(LSInput is),
    + * pre-conditions: set filter that SKIPs ELEMENT1 node,
    + * is: xml1
    + * output: XML document with ELEMENT1 only. + */ + @Test + public void testFilter0003() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser!"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + return FILTER_ACCEPT; + } + + public short acceptNode(Node enode) { + if (enode.getNodeName().startsWith("ELEMENT2")) { + return FILTER_INTERRUPT; + } + return FILTER_ACCEPT; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + String expected = ""; + Document doc = parser.parse(getXmlSource(xml1)); + if (!match(expected, doc)) { + Assert.fail("DOM structure after parsing is not equal to a structure of XML document, that being parsed"); + } + System.out.println("OKAY"); + } + + /** + * Equivalence class partitioning with state, input and output values + * orientation for public Document parse(LSInput is),
    + * pre-conditions: set filter that accepts all,
    + * is: xml1
    + * output: full XML document. + */ + @Test + public void testFilter0004() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser!"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + return FILTER_ACCEPT; + } + + public short acceptNode(Node enode) { + return FILTER_ACCEPT; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + String expected = "test1"; + Document doc = parser.parse(getXmlSource(xml1)); + if (!match(expected, doc)) { + Assert.fail("DOM structure after parsing is not equal to a structure of XML document, that being parsed"); + } + System.out.println("OKAY"); + } + + /** + * Equivalence class partitioning with state, input and output values + * orientation for public Document parse(LSInput is),
    + * pre-conditions: set filter that REJECTs all,
    + * is: xml1
    + * output: empty XML document. + */ + @Test + public void testFilter0005() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser!"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + return FILTER_ACCEPT; + } + + public short acceptNode(Node enode) { + return FILTER_REJECT; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + Document doc = parser.parse(getXmlSource(xml1)); + NodeList children = doc.getDocumentElement().getChildNodes(); + if (children.getLength() != 0) { + Assert.fail("Not all children skipped"); + } + System.out.println("OKAY"); + } + + /** + * Equivalence class partitioning with state, input and output values + * orientation for public Document parse(LSInput is),
    + * pre-conditions: set filter that SKIPs all,
    + * is: xml1
    + * output: empty XML document. + */ + @Test + public void testFilter0006() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser!"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + return FILTER_ACCEPT; + } + + public short acceptNode(Node enode) { + return FILTER_SKIP; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + Document doc = parser.parse(getXmlSource(xml1)); + NodeList children = doc.getDocumentElement().getChildNodes(); + if (children.getLength() != 0) { + Assert.fail("Not all children skipped"); + } + System.out.println("OKAY"); + } + + /** + * Equivalence class partitioning with state, input and output values + * orientation for public Document parse(LSInput is),
    + * pre-conditions: set filter that REJECTs any CHILD* start element,
    + * is: xml1
    + * output: XML document with ELEMENT1 and ELEMENT2 only. + */ + @Test + public void testFilter0007() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser!"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + if (elt.getTagName().startsWith("CHILD")) { + return FILTER_REJECT; + } + return FILTER_ACCEPT; + } + + public short acceptNode(Node enode) { + return FILTER_ACCEPT; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + String expected = "test1"; + Document doc = parser.parse(getXmlSource(xml1)); + if (!match(expected, doc)) { + Assert.fail("DOM structure after parsing is not equal to a structure of XML document, that being parsed"); + } + System.out.println("OKAY"); + } + + /** + * Equivalence class partitioning with state, input and output values + * orientation for public Document parse(LSInput is),
    + * pre-conditions: set filter that SKIPs ELEMENT1 start element,
    + * is: xml1
    + * output: XML document with CHILD1 and ELEMENT2 only. + */ + @Test + public void testFilter0008() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser!"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + if (elt.getTagName().equals("ELEMENT1")) { + return FILTER_SKIP; + } + return FILTER_ACCEPT; + } + + public short acceptNode(Node enode) { + return FILTER_ACCEPT; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + String expected = "test1"; + Document doc = parser.parse(getXmlSource(xml1)); + if (!match(expected, doc)) { + Assert.fail("DOM structure after parsing is not equal to a structure of XML document, that being parsed"); + } + System.out.println("OKAY"); + } + + /** + * Equivalence class partitioning with state, input and output values + * orientation for public Document parse(LSInput is),
    + * pre-conditions: set filter that SKIPs ELEMENT1 start element,
    + * is: xml1
    + * output: XML document with ELEMENT1 only. + */ + @Test + public void testFilter0009() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser!"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + if (elt.getTagName().startsWith("ELEMENT2")) { + return FILTER_INTERRUPT; + } + return FILTER_ACCEPT; + } + + public short acceptNode(Node enode) { + return FILTER_ACCEPT; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + String expected = ""; + Document doc = parser.parse(getXmlSource(xml1)); + if (!match(expected, doc)) { + Assert.fail("DOM structure after parsing is not equal to a structure of XML document, that being parsed"); + } + System.out.println("OKAY"); + } + + /** + * Equivalence class partitioning with state, input and output values + * orientation for public Document parse(LSInput is),
    + * pre-conditions: set filter that REJECTs all start element,
    + * is: xml1
    + * output: empty XML document. + */ + @Test + public void testFilter0010() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + return FILTER_REJECT; + } + + public short acceptNode(Node enode) { + return FILTER_ACCEPT; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + Document doc = parser.parse(getXmlSource(xml1)); + NodeList children = doc.getDocumentElement().getChildNodes(); + if (children.getLength() != 0) { + Assert.fail("Not all children skipped"); + } + System.out.println("OKAY"); + } + + /** + * Equivalence class partitioning with state, input and output values + * orientation for public Document parse(LSInput is),
    + * pre-conditions: set filter that SKIPs all,
    + * is: xml1
    + * output: empty XML document. + */ + @Test + public void testFilter0011() { + LSParser parser = createLSParser(); + if (parser == null) { + Assert.fail("Unable to create LSParser"); + } + // set filter + parser.setFilter(new LSParserFilter() { + public short startElement(Element elt) { + return FILTER_SKIP; + } + + public short acceptNode(Node enode) { + return FILTER_ACCEPT; + } + + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + }); + Document doc = parser.parse(getXmlSource(xml1)); + NodeList children = doc.getDocumentElement().getChildNodes(); + if (children.getLength() != 1) { + Assert.fail("Not all Element nodes skipped"); + } + System.out.println("OKAY"); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/LSParserTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/LSParserTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom.ls; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; +import org.w3c.dom.DOMException; +import org.w3c.dom.DOMImplementation; + +/* + * @summary Test LSParser's DOMConfiguration for supported properties. + */ +public class LSParserTest { + + @Test + public void testDOMConfiguration() { + + final DOMErrorHandler handler = new DOMErrorHandler() { + public boolean handleError(final DOMError error) { + return false; + } + }; + + final LSResourceResolver resolver = new LSResourceResolver() { + public LSInput resolveResource(final String type, final String namespaceURI, final String publicId, final String systemId, final String baseURI) { + return null; + } + }; + + final Object[][] values = { + // parameter, value + { "canonical-form", Boolean.FALSE }, { "cdata-sections", Boolean.FALSE }, { "cdata-sections", Boolean.TRUE }, + { "check-character-normalization", Boolean.FALSE }, { "comments", Boolean.FALSE }, { "comments", Boolean.TRUE }, + { "datatype-normalization", Boolean.FALSE }, { "entities", Boolean.FALSE }, { "entities", Boolean.TRUE }, { "error-handler", handler }, + { "infoset", Boolean.TRUE }, { "namespaces", Boolean.TRUE }, { "namespace-declarations", Boolean.TRUE }, + { "namespace-declarations", Boolean.FALSE }, { "normalize-characters", Boolean.FALSE }, { "split-cdata-sections", Boolean.TRUE }, + { "split-cdata-sections", Boolean.FALSE }, { "validate", Boolean.FALSE }, { "validate-if-schema", Boolean.FALSE }, + { "well-formed", Boolean.TRUE }, { "element-content-whitespace", Boolean.TRUE }, + + { "charset-overrides-xml-encoding", Boolean.TRUE }, { "charset-overrides-xml-encoding", Boolean.FALSE }, { "disallow-doctype", Boolean.FALSE }, + { "ignore-unknown-character-denormalizations", Boolean.TRUE }, { "resource-resolver", resolver }, { "resource-resolver", null }, + { "supported-media-types-only", Boolean.FALSE }, }; + + DOMImplementation domImpl = null; + try { + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + } catch (ParserConfigurationException parserConfigurationException) { + parserConfigurationException.printStackTrace(); + Assert.fail(parserConfigurationException.toString()); + } + + DOMImplementationLS lsImpl = (DOMImplementationLS) domImpl.getFeature("LS", "3.0"); + + LSParser lsParser = lsImpl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null); + + DOMConfiguration config = lsParser.getDomConfig(); + + for (int i = values.length; --i >= 0;) { + Object val = values[i][1]; + String param = (String) values[i][0]; + try { + config.setParameter(param, val); + Object returned = config.getParameter(param); + Assert.assertEquals(val, returned, "'" + param + "' is set to " + returned + ", but expected " + val); + System.out.println("set '" + param + "'" + " to '" + val + "'" + " and returned '" + returned + "'"); + } catch (DOMException e) { + String settings = "setting '" + param + "' to " + val; + System.err.println(settings); + e.printStackTrace(); + Assert.fail(settings + ", " + e.toString()); + } + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/LSSerializerTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/LSSerializerTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,293 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.w3c.dom.ls; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.StringReader; +import java.io.Writer; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import com.sun.org.apache.xerces.internal.impl.Constants; + +/* + * @summary Test LSSerializer. + */ +public class LSSerializerTest { + + class DOMErrorHandlerImpl implements DOMErrorHandler { + + boolean NoOutputSpecifiedErrorReceived = false; + + public boolean handleError(final DOMError error) { + // consume "no-output-specified" errors + if ("no-output-specified".equalsIgnoreCase(error.getType())) { + NoOutputSpecifiedErrorReceived = true; + return true; + } + + // unexpected error + Assert.fail("Unexpected Error Type: " + error.getType() + " @ (" + error.getLocation().getLineNumber() + ", " + + error.getLocation().getColumnNumber() + ")" + ", " + error.getMessage()); + + return false; + } + } + + class Output implements LSOutput { + public OutputStream getByteStream() { + return null; + } + + public void setByteStream(final OutputStream byteStream) { + } + + public Writer getCharacterStream() { + return null; + } + + public void setCharacterStream(final Writer characterStream) { + } + + public String getSystemId() { + return null; + } + + public void setSystemId(final String systemId) { + } + + public String getEncoding() { + return "UTF8"; + } + + public void setEncoding(final String encoding) { + } + } + + @Test + public void testDOMErrorHandler() { + + final String XML_DOCUMENT = "" + "" + "world" + ""; + + StringReader stringReader = new StringReader(XML_DOCUMENT); + InputSource inputSource = new InputSource(stringReader); + Document doc = null; + try { + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + // LSSerializer defaults to Namespace processing + // so parsing must also + documentBuilderFactory.setNamespaceAware(true); + DocumentBuilder parser = documentBuilderFactory.newDocumentBuilder(); + doc = parser.parse(inputSource); + + } catch (Throwable e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + + DOMImplementation impl = doc.getImplementation(); + DOMImplementationLS implLS = (DOMImplementationLS) impl.getFeature("LS", "3.0"); + LSSerializer writer = implLS.createLSSerializer(); + DOMErrorHandlerImpl eh = new DOMErrorHandlerImpl(); + writer.getDomConfig().setParameter("error-handler", eh); + + boolean serialized = false; + try { + serialized = writer.write(doc, new Output()); + + // unexpected success + Assert.fail("Serialized without raising an LSException due to " + "'no-output-specified'."); + } catch (LSException lsException) { + // expected exception + System.out.println("Expected LSException: " + lsException.toString()); + // continue processing + } + + Assert.assertFalse(serialized, "Expected writer.write(doc, new Output()) == false"); + + Assert.assertTrue(eh.NoOutputSpecifiedErrorReceived, "'no-output-specified' error was expected"); + } + + @Test + public void testFormatPrettyPrint() { + + final String XML_DOCUMENT = "\n" + "" + "world" + "" + + ""; + /**JDK-8035467 + * no newline in default output + */ + final String XML_DOCUMENT_DEFAULT_PRINT = + "" + + "" + + "world" + + "" + + ""; + + final String XML_DOCUMENT_PRETTY_PRINT = "" + "" + "world" + "" + "\n" + " " + + "" + "\n" + " " + "" + "\n" + " " + "" + "\n" + "" + "\n"; + + // it all begins with a Document + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = null; + try { + documentBuilder = documentBuilderFactory.newDocumentBuilder(); + } catch (ParserConfigurationException parserConfigurationException) { + parserConfigurationException.printStackTrace(); + Assert.fail(parserConfigurationException.toString()); + } + Document document = null; + + StringReader stringReader = new StringReader(XML_DOCUMENT); + InputSource inputSource = new InputSource(stringReader); + try { + document = documentBuilder.parse(inputSource); + } catch (SAXException saxException) { + saxException.printStackTrace(); + Assert.fail(saxException.toString()); + } catch (IOException ioException) { + ioException.printStackTrace(); + Assert.fail(ioException.toString()); + } + + // query DOM Interfaces to get to a LSSerializer + DOMImplementation domImplementation = documentBuilder.getDOMImplementation(); + DOMImplementationLS domImplementationLS = (DOMImplementationLS) domImplementation; + LSSerializer lsSerializer = domImplementationLS.createLSSerializer(); + + // get configuration + DOMConfiguration domConfiguration = lsSerializer.getDomConfig(); + + // query current configuration + Boolean defaultFormatPrettyPrint = (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT); + Boolean canSetFormatPrettyPrintFalse = (Boolean) domConfiguration.canSetParameter(Constants.DOM_FORMAT_PRETTY_PRINT, Boolean.FALSE); + Boolean canSetFormatPrettyPrintTrue = (Boolean) domConfiguration.canSetParameter(Constants.DOM_FORMAT_PRETTY_PRINT, Boolean.TRUE); + + System.out.println(Constants.DOM_FORMAT_PRETTY_PRINT + " default/can set false/can set true = " + defaultFormatPrettyPrint + "/" + + canSetFormatPrettyPrintFalse + "/" + canSetFormatPrettyPrintTrue); + + // test values + Assert.assertEquals(defaultFormatPrettyPrint, Boolean.FALSE, "Default value of " + Constants.DOM_FORMAT_PRETTY_PRINT + " should be " + Boolean.FALSE); + + Assert.assertEquals(canSetFormatPrettyPrintFalse, Boolean.TRUE, "Can set " + Constants.DOM_FORMAT_PRETTY_PRINT + " to " + Boolean.FALSE + " should be " + + Boolean.TRUE); + + Assert.assertEquals(canSetFormatPrettyPrintTrue, Boolean.TRUE, "Can set " + Constants.DOM_FORMAT_PRETTY_PRINT + " to " + Boolean.TRUE + " should be " + + Boolean.TRUE); + + // get default serialization + String prettyPrintDefault = lsSerializer.writeToString(document); + System.out.println("(default) " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT) + + ": \n\"" + prettyPrintDefault + "\""); + + Assert.assertEquals(XML_DOCUMENT_DEFAULT_PRINT, prettyPrintDefault, "Invalid serialization with default value, " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" + + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT)); + + // configure LSSerializer to not format-pretty-print + domConfiguration.setParameter(Constants.DOM_FORMAT_PRETTY_PRINT, Boolean.FALSE); + String prettyPrintFalse = lsSerializer.writeToString(document); + System.out.println("(FALSE) " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT) + + ": \n\"" + prettyPrintFalse + "\""); + + Assert.assertEquals(XML_DOCUMENT_DEFAULT_PRINT, prettyPrintFalse, "Invalid serialization with FALSE value, " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" + + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT)); + + // configure LSSerializer to format-pretty-print + domConfiguration.setParameter(Constants.DOM_FORMAT_PRETTY_PRINT, Boolean.TRUE); + String prettyPrintTrue = lsSerializer.writeToString(document); + System.out.println("(TRUE) " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT) + + ": \n\"" + prettyPrintTrue + "\""); + + Assert.assertEquals(XML_DOCUMENT_PRETTY_PRINT, prettyPrintTrue, "Invalid serialization with TRUE value, " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" + + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT)); + } + + @Test + public void testXML11() { + + /** + * XML 1.1 document to parse. + */ + final String XML11_DOCUMENT = "\n" + "" + "world" + "" + + ""; + + /**JDK-8035467 + * no newline in default output + */ + final String XML11_DOCUMENT_OUTPUT = + "" + + "" + + "world" + + "" + + ""; + + // it all begins with a Document + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = null; + try { + documentBuilder = documentBuilderFactory.newDocumentBuilder(); + } catch (ParserConfigurationException parserConfigurationException) { + parserConfigurationException.printStackTrace(); + Assert.fail(parserConfigurationException.toString()); + } + Document document = null; + + StringReader stringReader = new StringReader(XML11_DOCUMENT); + InputSource inputSource = new InputSource(stringReader); + try { + document = documentBuilder.parse(inputSource); + } catch (SAXException saxException) { + saxException.printStackTrace(); + Assert.fail(saxException.toString()); + } catch (IOException ioException) { + ioException.printStackTrace(); + Assert.fail(ioException.toString()); + } + + // query DOM Interfaces to get to a LSSerializer + DOMImplementation domImplementation = documentBuilder.getDOMImplementation(); + DOMImplementationLS domImplementationLS = (DOMImplementationLS) domImplementation; + LSSerializer lsSerializer = domImplementationLS.createLSSerializer(); + + // get default serialization + String defaultSerialization = lsSerializer.writeToString(document); + + System.out.println("XML 1.1 serialization = \"" + defaultSerialization + "\""); + + // output should == input + Assert.assertEquals(XML11_DOCUMENT_OUTPUT, defaultSerialization, "Invalid serialization of XML 1.1 document: "); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/note_in_dtd.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/note_in_dtd.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,15 @@ + + + + + + + +]> + +Tove +Jani +Reminder +Don't forget me this weekend! + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/test.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/test.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,2 @@ + +the test diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/test.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/test.xsd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,10 @@ + + + + + + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Attributes2ImplTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Attributes2ImplTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ext.Attributes2Impl; + +/* + * @summary Test Attributes2Impl. + */ +public class Attributes2ImplTest { + + @Test + public void test01() { + System.out.println("===in test01()==="); + Attributes2Impl impl = new Attributes2Impl(); + impl.addAttribute("http://www.cars.com/xml", "attr1", "Qname1", "type", "value"); + impl.addAttribute("http://www.cars.com/xml", "attr2", "Qname2", "type", "value"); + impl.addAttribute("http://www.cars.com/xml", "attr3", "Qname3", "type", "value"); + + Assert.assertTrue(impl.isDeclared(0)); + impl.setDeclared(0, false); + Assert.assertFalse(impl.isDeclared(0)); + + Assert.assertTrue(impl.isDeclared("Qname2")); + impl.setDeclared(1, false); + Assert.assertFalse(impl.isDeclared("Qname2")); + + Assert.assertTrue(impl.isDeclared("http://www.cars.com/xml", "attr3")); + impl.setDeclared(2, false); + Assert.assertFalse(impl.isDeclared(2)); + + try { + impl.isDeclared(3); + } catch (ArrayIndexOutOfBoundsException e) { + System.out.println("Expected ArrayIndexOutOfBoundsException"); + } + + try { + impl.isDeclared("wrongQname"); + } catch (IllegalArgumentException e) { + System.out.println("Expected IllegalArgumentException"); + } + + try { + impl.isDeclared("http://www.cars.com/xml", "attr4"); + } catch (IllegalArgumentException e) { + System.out.println("Expected IllegalArgumentException"); + } + + impl.removeAttribute(2); + try { + impl.isDeclared(2); + } catch (ArrayIndexOutOfBoundsException e) { + System.out.println("Expected ArrayIndexOutOfBoundsException on index=2 after removing"); + } + } + + @Test + public void test02() { + System.out.println("===in test02()==="); + Attributes2Impl impl = new Attributes2Impl(); + impl.addAttribute("http://www.cars.com/xml", "attr1", "Qname1", "type", "value"); + impl.addAttribute("http://www.cars.com/xml", "attr2", "Qname2", "type", "value"); + impl.addAttribute("http://www.cars.com/xml", "attr3", "Qname3", "type", "value"); + + Assert.assertTrue(impl.isSpecified(0)); + impl.setSpecified(0, false); + Assert.assertFalse(impl.isSpecified(0)); + + Assert.assertTrue(impl.isSpecified("Qname2")); + impl.setSpecified(1, false); + Assert.assertFalse(impl.isSpecified("Qname2")); + + Assert.assertTrue(impl.isSpecified("http://www.cars.com/xml", "attr3")); + impl.setSpecified(2, false); + Assert.assertFalse(impl.isSpecified(2)); + + try { + impl.isSpecified(3); + } catch (ArrayIndexOutOfBoundsException e) { + System.out.println("Expected ArrayIndexOutOfBoundsException"); + } + + try { + impl.isSpecified("wrongQname"); + } catch (IllegalArgumentException e) { + System.out.println("Expected IllegalArgumentException"); + } + + try { + impl.isSpecified("http://www.cars.com/xml", "attr4"); + } catch (IllegalArgumentException e) { + System.out.println("Expected IllegalArgumentException"); + } + + impl.removeAttribute(2); + try { + impl.isSpecified(2); + } catch (ArrayIndexOutOfBoundsException e) { + System.out.println("Expected ArrayIndexOutOfBoundsException on index=2 after removing"); + } + } + + @Test + public void test03() { + System.out.println("===in test03()==="); + Attributes2Impl impl1 = new Attributes2Impl(); + impl1.addAttribute("http://www.cars.com/xml", "attr1", "Qname1", "type", "value"); + impl1.addAttribute("http://www.cars.com/xml", "attr2", "Qname2", "type", "value"); + impl1.addAttribute("http://www.cars.com/xml", "attr3", "Qname3", "type", "value"); + + Attributes2Impl impl2 = new Attributes2Impl(impl1); + + Attributes2Impl impl3 = new Attributes2Impl(); + impl3.setAttributes(impl1); + + Assert.assertTrue(impl1.getQName(0).equals(impl2.getQName(0))); + Assert.assertTrue(impl1.getQName(0).equals(impl3.getQName(0))); + + Assert.assertTrue(impl1.getQName(1).equals(impl2.getQName(1))); + Assert.assertTrue(impl1.getQName(1).equals(impl3.getQName(1))); + + Assert.assertTrue(impl1.getQName(2).equals(impl2.getQName(2))); + Assert.assertTrue(impl1.getQName(2).equals(impl3.getQName(2))); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug6889654Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug6889654Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import java.io.IOException; +import java.io.StringReader; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6889654 + * @summary Test SAXException includes whole information. + */ +public class Bug6889654Test { + + final String MSG = "Failed to parse XML"; + + @Test + public void testException() { + try { + parse(); + } catch (SAXException e) { + // e.printStackTrace(); + String msg = e.toString(); + if (msg.indexOf("systemId") == -1) { + Assert.fail("CR6889654 -- details should be returned."); + } + if (msg.indexOf(MSG) == -1) { + Assert.fail("CR6889649 -- additional error message not returned."); + } + System.out.println("error message:\n" + msg); + } + } + + void parse() throws SAXException { + String xml = "\n\u0000"; + + try { + InputSource is = new InputSource(new StringReader(xml)); + is.setSystemId("file:///path/to/some.xml"); + // notice that exception thrown here doesn't include the line number + // information when reported by JVM -- CR6889654 + SAXParserFactory.newInstance().newSAXParser().parse(is, new DefaultHandler()); + } catch (SAXException e) { + // notice that this message isn't getting displayed -- CR6889649 + throw new SAXException(MSG, e); + } catch (ParserConfigurationException pce) { + + } catch (IOException ioe) { + + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug6925410Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug6925410Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import javax.xml.datatype.DatatypeConfigurationException; + +import org.testng.annotations.Test; +import org.testng.Assert; +import org.xml.sax.helpers.XMLReaderFactory; + +/* + * @bug 6925410 + * @summary Test XMLReaderFactory can createXMLReader repeatedly. + */ +public class Bug6925410Test { + + @Test + public void test() throws DatatypeConfigurationException { + try { + int times = 100; + long start = System.currentTimeMillis(); + for (int i = 0; i < times; i++) { + XMLReaderFactory.createXMLReader(); + } + long end = System.currentTimeMillis(); + double speed = ((end - start)); + System.out.println(speed + "ms"); + } catch (Throwable e) { + e.printStackTrace(); + Assert.fail(e.toString()); + } + + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug6949607Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug6949607Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import java.io.ByteArrayInputStream; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6949607 + * @summary Test Attributes.getValue returns null when parameter uri is empty. + */ +public class Bug6949607Test { + + final String MSG = "Failed to parse XML"; + String textXML = ""; + + @Test + public void testException() { + try { + SAXParserFactory factory = SAXParserFactory.newInstance(); + factory.setNamespaceAware(true); + factory.setValidating(true); + SAXParser saxParser = factory.newSAXParser(); + + saxParser.parse(new ByteArrayInputStream(textXML.getBytes()), new TestFilter()); + + } catch (Throwable t) { + t.printStackTrace(); + } + } + + class TestFilter extends DefaultHandler { + @Override + public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { + super.startElement(uri, localName, qName, atts); + + String attr_WithNs = atts.getValue("something", "attr"); + String attr_NoNs = atts.getValue("", "attr"); + + System.out.println("withNs: " + attr_WithNs); + System.out.println("NoNs: " + attr_NoNs); + + Assert.assertTrue(attr_NoNs == null, "Should return null when uri is empty."); + + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug6992561Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug6992561Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import java.io.ByteArrayInputStream; +import java.io.IOException; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.ContentHandler; +import org.xml.sax.InputSource; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6992561 + * @summary Test encoding of SystemId in Locator. + */ +public class Bug6992561Test { + + @Test + public void test() { + ContentHandler handler = new DefaultHandler() { + public void setDocumentLocator(Locator locator) { + String sysId = locator.getSystemId(); + System.out.println(locator.getSystemId()); + if (sysId.indexOf("%7") > 0) { + Assert.fail("the original system id should be left as is and not encoded."); + } + } + }; + + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser parser; + try { + parser = spf.newSAXParser(); + + XMLReader reader = parser.getXMLReader(); + reader.setContentHandler(handler); + String xml = "abc"; + ByteArrayInputStream bis = new ByteArrayInputStream(xml.getBytes()); + InputSource is = new InputSource("file:/home2/ramapulavarthi/w/bugs/jaxws861/foo~bla/test/src/wsdl/HelloTypes.xsd"); + is.setByteStream(bis); + reader.parse(is); + + } catch (ParserConfigurationException ex) { + Assert.fail(ex.toString()); + } catch (SAXException ex) { + Assert.fail(ex.toString()); + } catch (IOException ex) { + Assert.fail(ex.toString()); + } + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug7057778.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug7057778.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug7057778Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/Bug7057778Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.io.Writer; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.annotations.Test; +import org.testng.Assert; +import org.xml.sax.Attributes; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.XMLReader; +import org.xml.sax.ext.DefaultHandler2; + +/* + * @bug 7057778 + * @summary Test the file can be deleted after SAXParser.parse(File, DefaultHandler). + */ +public class Bug7057778Test { + + static final String xml = "Bug7057778.xml"; + static final String xml1 = "Bug7057778_1.xml"; + + @Test + public void testParse() { + File src = new File(getClass().getResource(xml).getFile()); + File dst = new File(src.getParent() + File.separator + xml1); + try { + copyFile(src, dst); + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser parser = spf.newSAXParser(); + XMLReader xmlReader = parser.getXMLReader(); + xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", new MyHandler1()); + parser.parse(dst, new MyHandler1()); + } catch (SAXException ex) { + ex.printStackTrace(); + } catch (IOException ex) { + // shouldn't happen + } catch (ParserConfigurationException ex) { + // shouldn't happen + } + if (dst != null) { + if (dst.delete()) { + System.out.println("Delete: OK"); + } else { + System.out.println("Delete: NG"); + Assert.fail("Error: denied to delete the file"); + } + } + + } + + private void copyFile(File src, File dst) throws FileNotFoundException, IOException { + InputStream in = new FileInputStream(src); + OutputStream out = new FileOutputStream(dst); + // Transfer bytes + byte[] buf = new byte[1024]; + int len; + while ((len = in.read(buf)) > 0) { + out.write(buf, 0, len); + } + in.close(); + out.close(); + } + + public class MyHandler1 extends DefaultHandler2 implements ErrorHandler { + private Writer out; + + StringBuffer textBuffer; + private String indentString = " "; // Amount to indent + private int indentLevel = 0; + + public MyHandler1() { + try { + out = new OutputStreamWriter(System.out, "UTF8"); + } catch (UnsupportedEncodingException ex) { + ex.printStackTrace(); + } + } + + public void startDocument() throws SAXException { + } + + public void endDocument() throws SAXException { + } + + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { + try { + System.out.println("uri: " + uri); + System.out.println("localName: " + localName); + System.out.println("qName: " + qName); + } catch (Exception e) { + throw new SAXException(e); + } + + } + + public void endElement(String uri, String localName, String qName) throws SAXException { + } + + public void characters(char ch[], int start, int length) throws SAXException { + } + + public void comment(char[] ch, int start, int length) { + String text = new String(ch, start, length); + // System.out.println(text); + try { + nl(); + emit("COMMENT: " + text); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void error(SAXParseException exception) { + exception.printStackTrace(); + } + + public void fatalError(SAXParseException exception) { + exception.printStackTrace(); + } + + public void warning(SAXParseException exception) { + exception.printStackTrace(); + } + + // Wrap I/O exceptions in SAX exceptions, to + // suit handler signature requirements + private void emit(String s) throws SAXException { + try { + out.write(s); + out.flush(); + } catch (IOException e) { + throw new SAXException("I/O error", e); + } + } + + // Start a new line + // and indent the next line appropriately + private void nl() throws SAXException { + String lineEnd = System.getProperty("line.separator"); + + try { + out.write(lineEnd); + + for (int i = 0; i < indentLevel; i++) + out.write(indentString); + } catch (IOException e) { + throw new SAXException("I/O error", e); + } + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/DefaultHandler2Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/DefaultHandler2Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import java.io.IOException; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.AssertJUnit; +import org.testng.annotations.Test; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.XMLReader; +import org.xml.sax.ext.DefaultHandler2; +import org.xml.sax.helpers.DefaultHandler; +import org.xml.sax.helpers.ParserAdapter; +import org.xml.sax.helpers.XMLFilterImpl; +import org.xml.sax.helpers.XMLReaderFactory; + +/* + * @summary Test DefaultHandler2. + */ +public class DefaultHandler2Test { + + @Test + public void testParse01() { + System.out.println("===in testParse01==="); + try { + DefaultHandler handler = new MyDefaultHandler2(); + SAXParserFactory saxFac = SAXParserFactory.newInstance(); + System.out.println(saxFac.getFeature("http://xml.org/sax/features/use-locator2")); + + // set use-entity-resolver2 as FALSE to use EntityResolver firstly. + saxFac.setFeature("http://xml.org/sax/features/use-entity-resolver2", false); + saxFac.setValidating(true); + + SAXParser parser = saxFac.newSAXParser(); + parser.setProperty("http://xml.org/sax/properties/lexical-handler", handler); + parser.setProperty("http://xml.org/sax/properties/declaration-handler", handler); + + parser.parse(this.getClass().getResource("toys.xml").getFile(), handler); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + Assert.fail("ParserConfigurationException in testParse01()"); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("SAXException in testParse01()"); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail("IOException in testParse01()"); + } + } + + @Test + public void testParse02() { + System.out.println("===in testParse02==="); + try { + DefaultHandler handler = new MyDefaultHandler2(); + SAXParserFactory saxFac = SAXParserFactory.newInstance(); + System.out.println(saxFac.getFeature("http://xml.org/sax/features/use-locator2")); + + // Enable namespace parsing + System.out.println(saxFac.getFeature("http://xml.org/sax/features/namespaces")); + saxFac.setNamespaceAware(true); + + saxFac.setValidating(true); + SAXParser parser = saxFac.newSAXParser(); + parser.setProperty("http://xml.org/sax/properties/lexical-handler", handler); + parser.setProperty("http://xml.org/sax/properties/declaration-handler", handler); + + parser.parse(this.getClass().getResource("toys.xml").getFile(), handler); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + Assert.fail("ParserConfigurationException in testParse02()"); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("SAXException in testParse02()"); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail("IOException in testParse02()"); + } + } + + @Test + public void testParse03() { + System.out.println("===in testParse03==="); + try { + DefaultHandler handler = new MyDefaultHandler2(); + + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + xmlReader.setProperty("http://xml.org/sax/properties/declaration-handler", handler); + System.out.println("XMLReader : " + xmlReader.getProperty("http://xml.org/sax/properties/declaration-handler")); + + SAXParserFactory saxFac = SAXParserFactory.newInstance(); + SAXParser parser = saxFac.newSAXParser(); + parser.setProperty("http://xml.org/sax/properties/declaration-handler", handler); + System.out.println("SAXParser : " + parser.getProperty("http://xml.org/sax/properties/declaration-handler")); + + // From https://docs.oracle.com/javase/7/docs/api, + // ParserAdapter.setProperty() and ParserAdapter.getProperty() does + // not support any property currently. + try { + ParserAdapter adapter = new ParserAdapter(parser.getParser()); + System.out.println("ParserAdapter : " + adapter.getProperty("http://xml.org/sax/properties/declaration-handler")); + } catch (SAXNotRecognizedException e) { + System.out.println("Expected SAXNotRecognizedException since ParserAdapter.getProperty() does not support any property currently"); + } + try { + ParserAdapter adapter = new ParserAdapter(parser.getParser()); + adapter.setProperty("http://xml.org/sax/properties/declaration-handler", handler); + } catch (SAXNotRecognizedException e) { + System.out.println("Expected SAXNotRecognizedException since ParserAdapter.setProperty() does not support any property currently"); + } + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("SAXException in testParse03()"); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + Assert.fail("ParserConfigurationException in testParse03()"); + } + + } + + @Test + public void testParse04() { + System.out.println("===in testParse04==="); + try { + DefaultHandler handler = new MyDefaultHandler2(); + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + System.out.println(xmlReader.getFeature("http://xml.org/sax/features/namespaces")); + xmlReader.setProperty("http://xml.org/sax/properties/declaration-handler", handler); + xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler); + xmlReader.setContentHandler(handler); + + xmlReader.parse(this.getClass().getResource("toys.xml").getFile()); + + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("SAXException in testParse04()"); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail("IOException in testParse04()"); + } + } + + @Test + public void testParse05() { + System.out.println("===in testParse05==="); + try { + DefaultHandler handler = new MyDefaultHandler2(); + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + XMLFilterImpl filterImpl = new XMLFilterImpl(xmlReader); + System.out.println(xmlReader.getFeature("http://xml.org/sax/features/namespaces")); + filterImpl.setProperty("http://xml.org/sax/properties/declaration-handler", handler); + filterImpl.setProperty("http://xml.org/sax/properties/lexical-handler", handler); + filterImpl.setContentHandler(handler); + + filterImpl.parse(this.getClass().getResource("toys.xml").getFile()); + + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("SAXException in testParse05()"); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail("IOException in testParse05()"); + } + } + + @Test + public void testParse06() { + System.out.println("===in testParse06==="); + try { + DefaultHandler handler = new MyDefaultHandler2(); + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + XMLFilterImpl filterImpl = new XMLFilterImpl(xmlReader); + System.out.println(xmlReader.getFeature("http://xml.org/sax/features/namespaces")); + filterImpl.setProperty("http://xml.org/sax/properties/declaration-handler", handler); + filterImpl.setProperty("http://xml.org/sax/properties/lexical-handler", handler); + filterImpl.setContentHandler(handler); + + AssertJUnit.assertTrue(filterImpl.getProperty("http://xml.org/sax/properties/declaration-handler") instanceof DefaultHandler2); + + // filterImpl.setFeature("http://xml.org/sax/features/external-general-entities", + // false) ; + // filterImpl.setFeature("http://xml.org/sax/features/external-parameter-entities", + // false) ; + filterImpl.skippedEntity("name2"); + + filterImpl.parse(this.getClass().getResource("toys.xml").getFile()); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("SAXException in testParse06()"); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail("IOException in testParse06()"); + } + } + + @Test + public void testParse07() { + System.out.println("===in testParse07==="); + try { + DefaultHandler handler = new MyDefaultHandler2(); + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + XMLFilterImpl filterImpl = new XMLFilterImpl(xmlReader); + System.out.println(xmlReader.getFeature("http://xml.org/sax/features/namespaces")); + filterImpl.setProperty("http://xml.org/sax/properties/declaration-handler", handler); + filterImpl.setProperty("http://xml.org/sax/properties/lexical-handler", handler); + filterImpl.setContentHandler(handler); + filterImpl.setErrorHandler(handler); + AssertJUnit.assertTrue(filterImpl.getProperty("http://xml.org/sax/properties/declaration-handler") instanceof DefaultHandler2); + + filterImpl.setFeature("http://apache.org/xml/features/continue-after-fatal-error", true); + filterImpl.parse(this.getClass().getResource("toys_error.xml").getFile()); + } catch (SAXException e) { + e.printStackTrace(); + Assert.fail("SAXException in testParse07()"); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail("IOException in testParse07()"); + } + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/IssueTracker56Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/IssueTracker56Test.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import java.io.IOException; +import java.io.StringReader; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.testng.Assert; +import org.testng.annotations.Test; +import org.xml.sax.Attributes; +import org.xml.sax.ErrorHandler; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +/* + * @bug 6809409 + * @summary Test SAXException has Cause. + */ +public class IssueTracker56Test { + + @Test + public void testException() { + try { + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser parser = spf.newSAXParser(); + String xmlToParse = "Issue 56: SAXException does not do the exception chaining properly"; + InputSource source = new InputSource(new StringReader(xmlToParse)); + parser.parse(source, new MyHandler()); + } catch (SAXException ex) { + System.out.println(ex.getCause()); + if (ex.getCause() == null) + Assert.fail("failed chaining exception properly."); + // ex.printStackTrace(); //will not print out root cause without the + // fix + } catch (IOException ex) { + // shouldn't happen + } catch (ParserConfigurationException ex) { + // shouldn't happen + } + } + + @Test + public void testWorkAround() throws Exception { + try { + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser parser = spf.newSAXParser(); + String xmlToParse = "Issue 56: SAXException does not do the exception chaining properly"; + InputSource source = new InputSource(new StringReader(xmlToParse)); + parser.parse(source, new MyHandler1()); + } catch (SAXException ex) { + System.out.println(ex.getCause()); + // ex.printStackTrace(); //will print out root cause + } catch (IOException ex) { + // shouldn't happen + } catch (ParserConfigurationException ex) { + // shouldn't happen + } + + } + + public class MyHandler extends DefaultHandler implements ErrorHandler { + + public void startDocument() throws SAXException { + } + + public void endDocument() throws SAXException { + } + + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { + try { + System.out.println(uri); + System.out.println(uri.charAt(56)); + } catch (Exception e) { + throw new SAXException(e); + } + + } + + public void endElement(String uri, String localName, String qName) throws SAXException { + } + + public void characters(char ch[], int start, int length) throws SAXException { + } + + } + + public class MyHandler1 extends DefaultHandler implements ErrorHandler { + + public void startDocument() throws SAXException { + } + + public void endDocument() throws SAXException { + } + + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXExceptionExt { + try { + System.out.println(uri); + System.out.println(uri.charAt(56)); + } catch (Exception e) { + throw new SAXExceptionExt(e); + } + + } + + public void endElement(String uri, String localName, String qName) throws SAXException { + } + + public void characters(char ch[], int start, int length) throws SAXException { + } + + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/MyDefaultHandler2.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/MyDefaultHandler2.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import java.io.IOException; + +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.ext.Attributes2Impl; +import org.xml.sax.ext.DefaultHandler2; +import org.xml.sax.ext.Locator2; +import org.xml.sax.ext.Locator2Impl; +import org.xml.sax.helpers.XMLFilterImpl; +import org.xml.sax.helpers.XMLReaderAdapter; + +public class MyDefaultHandler2 extends DefaultHandler2 { + Locator2Impl locator = new Locator2Impl(); + StringBuffer currentValue = new StringBuffer(); + String version = "customVersion"; + String encoding = "customEncoding"; + + public void setDocumentLocator(Locator locator) { + this.locator = new Locator2Impl((Locator2) locator); + this.locator.setXMLVersion(version); + this.locator.setEncoding(encoding); + } + + public void startDocument() throws SAXException { + super.startDocument(); + System.out.println("startDocument() is invoked"); + System.out.println(locator.getXMLVersion()); + System.out.println(locator.getEncoding()); + } + + public void attributeDecl(String ename, String aname, String type, String mode, String value) throws SAXException { + super.attributeDecl(ename, aname, type, mode, value); + System.out.println("attributeDecl() is invoked for attr :" + aname); + } + + public void elementDecl(String name, String model) throws SAXException { + super.elementDecl(name, model); + System.out.println("elementDecl() is invoked for element : " + name); + } + + public void internalEntityDecl(String name, String value) throws SAXException { + super.internalEntityDecl(name, value); + System.out.println("internalEntityDecl() is invoked for entity : " + name); + } + + public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException { + super.externalEntityDecl(name, publicId, systemId); + System.out.println("externalEntityDecl() is invoked for entity : " + name); + } + + public void comment(char[] ch, int start, int length) throws SAXException { + super.comment(ch, start, length); + System.out.println(new String(ch, start, length)); + } + + public void endDocument() throws SAXException { + super.endDocument(); + System.out.println("\nendDocument() is invoked"); + } + + public void startCDATA() throws SAXException { + super.startCDATA(); + System.out.println("startCDATA() is invoked"); + } + + public void endCDATA() throws SAXException { + super.endCDATA(); + System.out.println("endCDATA() is invoked"); + } + + public void startEntity(String name) throws SAXException { + super.startEntity(name); + // System.out.println("startEntity() is invoked for entity : " + name) ; + } + + public void endEntity(String name) throws SAXException { + super.endEntity(name); + // System.out.println("endEntity() is invoked for entity : " + name) ; + } + + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { + super.startElement(uri, localName, qName, attributes); + if (qName.equals("toy")) { + Attributes2Impl impl = new Attributes2Impl(); + impl.setAttributes(attributes); + System.out.println("\ntoy id=" + impl.getValue("id")); + } else if (qName.equals("price") || qName.equals("name")) { + System.out.print(" " + qName + " : "); + currentValue = new StringBuffer(); + } + } + + public void endElement(String uri, String localName, String qName) throws SAXException { + super.endElement(uri, localName, qName); + if (qName.equals("price") || qName.equals("name")) { + System.out.print(currentValue.toString()); + } + } + + public void startDTD(String name, String publicId, String systemId) throws SAXException { + super.startDTD(name, publicId, systemId); + System.out.println("startDTD() is invoked"); + } + + public void endDTD() throws SAXException { + super.endDTD(); + System.out.println("endDTD() is invoked"); + } + + public void characters(char[] ch, int start, int length) { + // System.out.println(start + " " + length) ; + currentValue.append(ch, start, length); + } + + public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { + System.out.println("resolveEntity(publicId, systemId) is invoked"); + return super.resolveEntity(publicId, systemId); + } + + public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) throws SAXException, IOException { + System.out.println("resolveEntity(name, publicId, baseURI, systemId) is invoked"); + return super.resolveEntity(name, publicId, baseURI, systemId); + } + + public InputSource getExternalSubset(String name, String baseURI) throws SAXException, IOException { + System.out.println("getExternalSubset() is invoked"); + return super.getExternalSubset(name, baseURI); + } + + public void startPrefixMapping(String prefix, String uri) { + System.out.println("startPrefixMapping() is invoked for " + prefix + " : " + uri); + try { + new XMLReaderAdapter().startPrefixMapping(prefix, uri); + } catch (SAXException e) { + e.printStackTrace(); + } + } + + public void endPrefixMapping(String prefix) { + System.out.println("\nendPrefixMapping() is invoked for " + prefix); + try { + new XMLReaderAdapter().endPrefixMapping(prefix); + } catch (SAXException e) { + e.printStackTrace(); + } + } + + public void skippedEntity(String name) { + try { + System.out.println("skippedEntity() is invoked for : " + name); + new XMLReaderAdapter().skippedEntity(name); + } catch (SAXException e) { + e.printStackTrace(); + } + } + + public void error(SAXParseException e) throws SAXException { + System.out.println("error() is invoked for in ErrorHandler"); + new XMLFilterImpl().warning(e); + } + + public void fatalError(SAXParseException e) throws SAXException { + System.out.println("fatalError() is invoked for in ErrorHandler"); + new XMLFilterImpl().warning(e); + } + + public void warning(SAXParseException e) throws SAXException { + System.out.println("warning() is invoked for in ErrorHandler"); + new XMLFilterImpl().warning(e); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/NSSupportTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/NSSupportTest.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import java.util.Enumeration; + +import org.testng.Assert; +import org.testng.AssertJUnit; +import org.testng.annotations.Test; +import org.xml.sax.helpers.NamespaceSupport; + +/* + * @summary Test NamespaceSupport. + */ +public class NSSupportTest { + + @Test + public void testProcessName() { + NamespaceSupport nssupport = new NamespaceSupport(); + + nssupport.pushContext(); + nssupport.declarePrefix("", "http://www.java.com"); + nssupport.declarePrefix("dc", "http://www.purl.org/dc"); + + String[] parts = new String[3]; + nssupport.processName("dc:name1", parts, false); + Assert.assertTrue(parts[0].equals("http://www.purl.org/dc")); + Assert.assertTrue(parts[1].equals("name1")); + Assert.assertTrue(parts[2].equals("dc:name1")); + + nssupport.processName("name2", parts, false); + Assert.assertTrue(parts[0].equals("http://www.java.com")); + Assert.assertTrue(parts[1].equals("name2")); + Assert.assertTrue(parts[2].equals("name2")); + } + + @Test + public void testNamespaceDeclUris() { + String[] parts = new String[3]; + NamespaceSupport nssupport = new NamespaceSupport(); + + nssupport.pushContext(); + Assert.assertFalse(nssupport.isNamespaceDeclUris()); + nssupport.declarePrefix("xmlns", ""); + nssupport.processName("xmlns:name", parts, true); + Assert.assertNull(parts[0]); + Assert.assertNull(parts[1]); + Assert.assertNull(parts[2]); + + nssupport.reset(); + + nssupport.setNamespaceDeclUris(true); + nssupport.declarePrefix("xmlns", ""); + nssupport.processName("xmlns:name", parts, true); + Assert.assertTrue(parts[0].equals(NamespaceSupport.NSDECL)); + Assert.assertTrue(parts[1].equals("name")); + Assert.assertTrue(parts[2].equals("xmlns:name")); + + nssupport.reset(); + + nssupport.setNamespaceDeclUris(true); + nssupport.declarePrefix("xml", ""); + nssupport.processName("xml:name", parts, true); + Assert.assertTrue(parts[0].equals(NamespaceSupport.XMLNS)); + Assert.assertTrue(parts[1].equals("name")); + Assert.assertTrue(parts[2].equals("xml:name")); + + } + + @Test + public void testPopContext() { + String[] parts = new String[3]; + NamespaceSupport nssupport = new NamespaceSupport(); + + nssupport.pushContext(); + nssupport.declarePrefix("dc", "http://www.purl.org/dc"); + Assert.assertEquals(nssupport.getPrefix("http://www.purl.org/dc"), "dc"); + + nssupport.popContext(); + Assert.assertNull(nssupport.getPrefix("http://www.purl.org/dc")); + nssupport.processName("dc:name1", parts, false); + Assert.assertNull(parts[0]); + Assert.assertNull(parts[1]); + Assert.assertNull(parts[2]); + } + + @Test + public void testPrefixAndUri1() { + boolean hasdc = false; + boolean hasdc1 = false; + boolean hasdc2 = false; + boolean hasdcnew = false; + NamespaceSupport nssupport = new NamespaceSupport(); + + nssupport.pushContext(); + nssupport.declarePrefix("dc", "http://www.purl.org/dc"); + + nssupport.pushContext(); + nssupport.declarePrefix("dc1", "http://www.purl.org/dc"); + nssupport.declarePrefix("dc2", "http://www.purl.org/dc2"); + nssupport.declarePrefix("dcnew", "http://www.purl.org/dcnew"); + + Enumeration enu1 = nssupport.getDeclaredPrefixes(); + while (enu1.hasMoreElements()) { + String str = (String) enu1.nextElement(); + if (str.equals("dc")) { + hasdc = true; + } else if (str.equals("dc1")) { + hasdc1 = true; + } else if (str.equals("dc2")) { + hasdc2 = true; + } else if (str.equals("dcnew")) { + hasdcnew = true; + } + } + AssertJUnit.assertTrue(hasdcnew && hasdc1 && hasdc2); + AssertJUnit.assertFalse(hasdc); + } + + @Test + public void testPrefixAndUri2() { + boolean hasdc = false; + boolean hasdc1 = false; + boolean hasdc2 = false; + boolean hasdcnew = false; + NamespaceSupport nssupport = new NamespaceSupport(); + + nssupport.pushContext(); + nssupport.declarePrefix("dc", "http://www.purl.org/dc"); + + nssupport.pushContext(); + nssupport.declarePrefix("dc1", "http://www.purl.org/dc"); + nssupport.declarePrefix("dc2", "http://www.purl.org/dc2"); + nssupport.declarePrefix("dcnew", "http://www.purl.org/dcnew"); + + Enumeration enu1 = nssupport.getPrefixes(); + while (enu1.hasMoreElements()) { + String str = (String) enu1.nextElement(); + if (str.equals("dc")) { + hasdc = true; + } else if (str.equals("dc1")) { + hasdc1 = true; + } else if (str.equals("dc2")) { + hasdc2 = true; + } else if (str.equals("dcnew")) { + hasdcnew = true; + } + } + AssertJUnit.assertTrue(hasdcnew && hasdc1 && hasdc2 && hasdc); + } + + @Test + public void testPrefixAndUri3() { + boolean hasdc = false; + boolean hasdc1 = false; + boolean hasdc2 = false; + boolean hasdcnew = false; + NamespaceSupport nssupport = new NamespaceSupport(); + + nssupport.pushContext(); + nssupport.declarePrefix("dc", "http://www.purl.org/dc"); + + nssupport.pushContext(); + nssupport.declarePrefix("dc1", "http://www.purl.org/dc"); + nssupport.declarePrefix("dc2", "http://www.purl.org/dc2"); + nssupport.declarePrefix("dcnew", "http://www.purl.org/dcnew"); + + Enumeration enu1 = nssupport.getPrefixes("http://www.purl.org/dc"); + while (enu1.hasMoreElements()) { + String str = (String) enu1.nextElement(); + if (str.equals("dc")) { + hasdc = true; + } else if (str.equals("dc1")) { + hasdc1 = true; + } else if (str.equals("dc2")) { + hasdc2 = true; + } else if (str.equals("dcnew")) { + hasdcnew = true; + } + } + AssertJUnit.assertTrue(hasdc1 && hasdc); + AssertJUnit.assertFalse(hasdc2); + AssertJUnit.assertFalse(hasdcnew); + } + + @Test + public void testPrefixAndUri4() { + NamespaceSupport nssupport = new NamespaceSupport(); + + nssupport.pushContext(); + nssupport.declarePrefix("dc", "http://www.purl.org/dc"); + + nssupport.pushContext(); + nssupport.declarePrefix("dc1", "http://www.purl.org/dc"); + nssupport.declarePrefix("dc2", "http://www.purl.org/dc2"); + nssupport.declarePrefix("dcnew", "http://www.purl.org/dcnew"); + + AssertJUnit.assertTrue(nssupport.getURI("dc").equals("http://www.purl.org/dc")); + AssertJUnit.assertTrue(nssupport.getURI("dc1").equals("http://www.purl.org/dc")); + AssertJUnit.assertTrue(nssupport.getURI("dc2").equals("http://www.purl.org/dc2")); + AssertJUnit.assertTrue(nssupport.getURI("dcnew").equals("http://www.purl.org/dcnew")); + + // Negative test + Assert.assertNull(nssupport.getURI("wrong_prefix")); + Assert.assertNull(nssupport.getURI("")); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/SAXExceptionExt.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/SAXExceptionExt.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.xml.sax; + +import org.xml.sax.SAXException; + +public class SAXExceptionExt extends SAXException { + private Exception exception; + + public SAXExceptionExt(Exception e) { + super(e); + exception = e; + } + + public Throwable getCause() { + return exception; + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/externalDTD.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/externalDTD.dtd Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,3 @@ + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/toys.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/toys.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,31 @@ + + +%external; + + + + +]> + + + + + + + Hello]]> + + &name1; + 98470 + + + &name2; + 345 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/toys_error.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/org/xml/sax/toys_error.xml Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,31 @@ + + +%external; + + + + +]> + + + + + + + Hello]]> + + &name1; + 98470 + + + &name3; + 345 + + + diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/policy/PolicyUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/policy/PolicyUtil.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package policy; + +import java.security.Policy; + +public class PolicyUtil { + + public static void changePolicy(String policyFile) { + System.setProperty("java.security.policy", policyFile); + Policy.getPolicy().refresh(); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/policy/common.policy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/policy/common.policy Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,27 @@ +grant { + permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; + permission java.lang.RuntimePermission "accessDeclaredMembers"; + + permission java.io.FilePermission "${test.classes}/../../-", "read, write, delete"; + permission java.io.FilePermission ".", "read, write, delete"; + permission java.util.PropertyPermission "*", "read, write"; + + permission java.lang.RuntimePermission "setSecurityManager"; + permission java.lang.RuntimePermission "createSecurityManager"; + permission java.lang.RuntimePermission "createClassLoader"; + permission java.lang.RuntimePermission "setIO"; + permission java.lang.RuntimePermission "setContextClassLoader"; + permission java.security.SecurityPermission "getPolicy"; + + permission java.io.FilePermission "${test.src}/-", "read, write, delete"; + permission java.io.FilePermission "${user.dir}/-", "read, write, delete"; + permission java.io.FilePermission "${java.io.tmpdir}/-", "read, write, delete"; + + permission java.lang.RuntimePermission "accessClassInPackage.com.sun.org.apache.bcel.internal.classfile"; + permission java.lang.RuntimePermission "accessClassInPackage.com.sun.org.apache.bcel.internal.generic"; + permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.stream.writers"; + permission java.lang.RuntimePermission "accessClassInPackage.com.sun.org.apache.xerces.internal.impl"; + permission java.lang.RuntimePermission "accessClassInPackage.com.sun.org.apache.xalan.internal"; + permission java.lang.RuntimePermission "accessClassInPackage.com.sun.org.apache.xalan.internal.xsltc.trax"; + permission java.lang.RuntimePermission "accessClassInPackage.com.sun.org.apache.xalan.internal.xslt"; +}; diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/util/BOMInputStream.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/util/BOMInputStream.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package util; + +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import java.util.Map; + +public class BOMInputStream { + public static InputStream createStream(String charset, InputStream input) { + + try { + byte[] content = read(input).getBytes(charset); + byte[] head = bom.get(charset); + if (head == null) + return null; + byte[] result = new byte[head.length + content.length]; + System.arraycopy(head, 0, result, 0, head.length); + System.arraycopy(content, 0, result, head.length, content.length); + return new ByteArrayInputStream(result); + } catch (UnsupportedEncodingException e) { + return null; + } + } + + private static String read(InputStream input) + { + try { + StringBuffer sb = new StringBuffer(); + InputStreamReader r = new InputStreamReader(new BufferedInputStream(input)); + int c = 0; + while ((c = r.read()) != -1) + sb.append((char)c); + return sb.toString(); + } catch (IOException e) { + return ""; + } finally { + try { + input.close(); + } catch (IOException e) + {} + } + } + + + private final static Map bom = new HashMap(); + private final static byte[][] bomBytes = {{(byte)0xEF, (byte)0xBB, (byte)0xBF}, + {(byte)0xFE, (byte)0xFF}}; + + static { + bom.put("UTF-8", bomBytes[0]); + bom.put("UTF-16BE", bomBytes[1]); + } + +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/util/BaseStAXUT.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/util/BaseStAXUT.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,559 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package util; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; +import java.io.UnsupportedEncodingException; +import java.util.HashMap; + +import javax.xml.stream.XMLEventFactory; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLResolver; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; + +import org.testng.Assert; + +/** + * Base class for all StaxTest unit test classes. Contains shared + * functionality for many common set up tasks, as well as for + * outputting diagnostics. + * + */ +public class BaseStAXUT implements XMLStreamConstants { + /** + * This is the de facto standard property that enables accurate reporting of + * CDATA events. + */ + final static String PROP_REPORT_CDATA = "http://java.sun.com/xml/stream/properties/report-cdata-event"; + + final static HashMap mTokenTypes = new HashMap(); + static { + mTokenTypes.put(new Integer(START_ELEMENT), "START_ELEMENT"); + mTokenTypes.put(new Integer(END_ELEMENT), "END_ELEMENT"); + mTokenTypes.put(new Integer(START_DOCUMENT), "START_DOCUMENT"); + mTokenTypes.put(new Integer(END_DOCUMENT), "END_DOCUMENT"); + mTokenTypes.put(new Integer(CHARACTERS), "CHARACTERS"); + mTokenTypes.put(new Integer(CDATA), "CDATA"); + mTokenTypes.put(new Integer(COMMENT), "COMMENT"); + mTokenTypes.put(new Integer(PROCESSING_INSTRUCTION), "PROCESSING_INSTRUCTION"); + mTokenTypes.put(new Integer(DTD), "DTD"); + mTokenTypes.put(new Integer(SPACE), "SPACE"); + mTokenTypes.put(new Integer(ENTITY_REFERENCE), "ENTITY_REFERENCE"); + mTokenTypes.put(new Integer(NAMESPACE), "NAMESPACE_DECLARATION"); + mTokenTypes.put(new Integer(NOTATION_DECLARATION), "NOTATION_DECLARATION"); + mTokenTypes.put(new Integer(ENTITY_DECLARATION), "ENTITY_DECLARATION"); + } + + /* + * /////////////////////////////////////////////////// // Consts for + * expected values /////////////////////////////////////////////////// + */ + + /** + * Expected return value for streamReader.getNamespaceURI() in + * non-namespace-aware mode. + */ + protected final String DEFAULT_URI_NON_NS = ""; + + protected final String DEFAULT_URI_NS = ""; + + /* + * /////////////////////////////////////////////////// // Other consts + * /////////////////////////////////////////////////// + */ + + /* + * /////////////////////////////////////////////////// // Cached instances + * /////////////////////////////////////////////////// + */ + + XMLInputFactory mInputFactory; + XMLOutputFactory mOutputFactory; + XMLEventFactory mEventFactory; + + protected XMLInputFactory getInputFactory() { + if (mInputFactory == null) { + mInputFactory = getNewInputFactory(); + } + return mInputFactory; + } + + protected static XMLInputFactory getNewInputFactory() { + return XMLInputFactory.newInstance(); + } + + protected XMLOutputFactory getOutputFactory() { + if (mOutputFactory == null) { + mOutputFactory = getNewOutputFactory(); + } + return mOutputFactory; + } + + protected static XMLOutputFactory getNewOutputFactory() { + return XMLOutputFactory.newInstance(); + } + + protected XMLEventFactory getEventFactory() { + if (mEventFactory == null) { + mEventFactory = XMLEventFactory.newInstance(); + } + return mEventFactory; + } + + protected static XMLStreamReader constructStreamReader(XMLInputFactory f, String content) throws XMLStreamException { + // return f.createXMLStreamReader(new StringReader(content)); + try { + byte[] data = content.getBytes("UTF-8"); + return constructStreamReader(f, data); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + protected static XMLStreamReader constructStreamReader(XMLInputFactory f, byte[] b) throws XMLStreamException { + return f.createXMLStreamReader(new ByteArrayInputStream(b)); + } + + protected static XMLStreamReader constructStreamReaderForFile(XMLInputFactory f, String filename) throws IOException, XMLStreamException { + File inf = new File(filename); + XMLStreamReader sr = f.createXMLStreamReader(inf.toURL().toString(), new FileReader(inf)); + Assert.assertEquals(START_DOCUMENT, sr.getEventType()); + return sr; + } + + protected XMLStreamReader constructNsStreamReader(String content) throws XMLStreamException { + XMLInputFactory f = getInputFactory(); + setNamespaceAware(f, true); + return f.createXMLStreamReader(new StringReader(content)); + } + + protected XMLStreamReader constructNsStreamReader(String content, boolean coal) throws XMLStreamException { + XMLInputFactory f = getInputFactory(); + setNamespaceAware(f, true); + setCoalescing(f, coal); + return f.createXMLStreamReader(new StringReader(content)); + } + + /* + * ////////////////////////////////////////////////// // Configuring input + * factory ////////////////////////////////////////////////// + */ + + protected static boolean isCoalescing(XMLInputFactory f) throws XMLStreamException { + return ((Boolean) f.getProperty(XMLInputFactory.IS_COALESCING)).booleanValue(); + } + + protected static void setCoalescing(XMLInputFactory f, boolean state) throws XMLStreamException { + Boolean b = state ? Boolean.TRUE : Boolean.FALSE; + f.setProperty(XMLInputFactory.IS_COALESCING, b); + // Let's just double-check it... + Assert.assertEquals(state, isCoalescing(f)); + } + + protected static boolean isValidating(XMLInputFactory f) throws XMLStreamException { + return ((Boolean) f.getProperty(XMLInputFactory.IS_VALIDATING)).booleanValue(); + } + + protected static void setValidating(XMLInputFactory f, boolean state) throws XMLStreamException { + try { + Boolean b = state ? Boolean.TRUE : Boolean.FALSE; + f.setProperty(XMLInputFactory.IS_VALIDATING, b); + } catch (IllegalArgumentException iae) { + Assert.fail("Could not set DTD validating mode to " + state + ": " + iae); + // throw new XMLStreamException(iae.getMessage(), iae); + } + Assert.assertEquals(state, isValidating(f)); + } + + protected static boolean isNamespaceAware(XMLInputFactory f) throws XMLStreamException { + return ((Boolean) f.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue(); + } + + /** + * @return True if setting succeeded, and property supposedly was + * succesfully set to the value specified; false if there was a + * problem. + */ + protected static boolean setNamespaceAware(XMLInputFactory f, boolean state) throws XMLStreamException { + try { + f.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, state ? Boolean.TRUE : Boolean.FALSE); + + /* + * 07-Sep-2005, TSa: Let's not assert, but instead let's see if it + * sticks. Some implementations might choose to silently ignore + * setting, at least for 'false'? + */ + return (isNamespaceAware(f) == state); + } catch (IllegalArgumentException e) { + /* + * Let's assume, then, that the property (or specific value for it) + * is NOT supported... + */ + return false; + } + } + + protected static void setReplaceEntities(XMLInputFactory f, boolean state) throws XMLStreamException { + Boolean b = state ? Boolean.TRUE : Boolean.FALSE; + f.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, b); + Assert.assertEquals(b, f.getProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES)); + } + + protected static void setSupportDTD(XMLInputFactory f, boolean state) throws XMLStreamException { + Boolean b = state ? Boolean.TRUE : Boolean.FALSE; + f.setProperty(XMLInputFactory.SUPPORT_DTD, b); + Assert.assertEquals(b, f.getProperty(XMLInputFactory.SUPPORT_DTD)); + } + + protected static boolean setSupportExternalEntities(XMLInputFactory f, boolean state) throws XMLStreamException { + Boolean b = state ? Boolean.TRUE : Boolean.FALSE; + try { + f.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, b); + Object act = f.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES); + return (act instanceof Boolean) && ((Boolean) act).booleanValue() == state; + } catch (IllegalArgumentException e) { + /* + * Let's assume, then, that the property (or specific value for it) + * is NOT supported... + */ + return false; + } + } + + protected static void setResolver(XMLInputFactory f, XMLResolver resolver) throws XMLStreamException { + f.setProperty(XMLInputFactory.RESOLVER, resolver); + } + + protected static boolean setReportCData(XMLInputFactory f, boolean state) throws XMLStreamException { + + Boolean b = state ? Boolean.TRUE : Boolean.FALSE; + if (f.isPropertySupported(PROP_REPORT_CDATA)) { + f.setProperty(PROP_REPORT_CDATA, b); + return true; + } + return false; + } + + /* + * ////////////////////////////////////////////////// // Stream reader + * accessors ////////////////////////////////////////////////// + */ + + /** + * Method that not only gets currently available text from the reader, but + * also checks that its consistenly accessible using different StAX methods. + */ + protected static String getAndVerifyText(XMLStreamReader sr) throws XMLStreamException { + String text = sr.getText(); + + /* + * 05-Apr-2006, TSa: Although getText() is available for DTD and + * ENTITY_REFERENCE, getTextXxx() are not. Thus, can not do more checks + * for those types. + */ + int type = sr.getEventType(); + if (type != ENTITY_REFERENCE && type != DTD) { + Assert.assertNotNull("getText() should never return null.", text); + int expLen = sr.getTextLength(); + /* + * Hmmh. Can only return empty text for CDATA (since empty blocks + * are legal). + */ + /* + * !!! 01-Sep-2004, TSa: note: theoretically, in coalescing mode, it + * could be possible to have empty CDATA section(s) get converted to + * CHARACTERS, which would be empty... may need to enhance this to + * check that mode is not coalescing? Or something + */ + if (sr.getEventType() == CHARACTERS) { + if (expLen == 0) { + Assert.fail("Stream reader should never return empty Strings."); + } + } + Assert.assertEquals(expLen, text.length(), "Expected text length of " + expLen + ", got " + text.length()); + char[] textChars = sr.getTextCharacters(); + int start = sr.getTextStart(); + String text2 = new String(textChars, start, expLen); + Assert.assertEquals("Expected getText() and getTextCharacters() to return same value for event of type (" + tokenTypeDesc(sr.getEventType()) + ")", + text, text2); + } else { // DTD or ENTITY_REFERENCE + // not sure if null is legal for these either, but... + if (text == null) { // let's prevent an NPE at caller + text = ""; + } + } + return text; + } + + protected static String getAllText(XMLStreamReader sr) throws XMLStreamException { + StringBuffer sb = new StringBuffer(); + while (true) { + int tt = sr.getEventType(); + if (tt != CHARACTERS && tt != SPACE) { + break; + } + sb.append(getAndVerifyText(sr)); + sr.next(); + } + return sb.toString(); + } + + protected static String getAllCData(XMLStreamReader sr) throws XMLStreamException { + StringBuffer sb = new StringBuffer(); + while (true) { + /* + * Note: CDATA sections CAN be reported as CHARACTERS, but not as + * SPACE + */ + int tt = sr.getEventType(); + if (tt != CHARACTERS && tt != CDATA) { + break; + } + sb.append(getAndVerifyText(sr)); + sr.next(); + } + return sb.toString(); + } + + /* + * ////////////////////////////////////////////////// // Derived assert/fail + * methods ////////////////////////////////////////////////// + */ + + protected static void assertTokenType(int expType, int actType) { + if (expType == actType) { + return; + } + Assert.fail("Expected token " + tokenTypeDesc(expType) + "; got " + tokenTypeDesc(actType) + "."); + } + + protected static void assertTokenType(int expType, int actType, XMLStreamReader sr) { + if (expType == actType) { + return; + } + Assert.fail("Expected token " + tokenTypeDesc(expType) + "; got " + tokenTypeDesc(actType, sr) + "."); + } + + protected static void assertTextualTokenType(int actType) { + if (actType != CHARACTERS && actType != SPACE && actType != CDATA) { + Assert.fail("Expected textual token (CHARACTERS, SPACE or CDATA)" + "; got " + tokenTypeDesc(actType) + "."); + } + } + + protected static void failStrings(String msg, String exp, String act) { + // !!! TODO: Indicate position where Strings differ + Assert.fail(msg + ": expected " + quotedPrintable(exp) + ", got " + quotedPrintable(act)); + } + + /** + * Specific method makes sense, since earlier it was not clear whether null + * or empty string (or perhaps both) would be the right answer when there is + * no prefix. + *

    + * However: as per javadocs of {@link XMLStreamReader#getPrefix}, from JDK + * 1.6 indicate, the current understanding is that null is the + * ultimate right answer here. + */ + protected static void assertNoPrefix(XMLStreamReader sr) throws XMLStreamException { + String prefix = sr.getPrefix(); + if (prefix != null) { + if (prefix.length() != 0) { + Assert.fail("Current element should not have a prefix: got '" + prefix + "'"); + } else { + Assert.fail("Expected null to signify missing prefix (see XMLStreamReader#getPrefix() JavaDocs): got empty String"); + } + } + } + + protected static void assertNoAttrPrefix(String attrPrefix) throws XMLStreamException { + if (attrPrefix != null) { + if (attrPrefix.length() != 0) { + Assert.fail("Attribute should not have a prefix: got '" + attrPrefix + "'"); + } else { + Assert.fail("Expected null to signify missing attribute prefix (see XMLStreamReader#getAttributePrefix() JavaDocs): got empty String"); + } + } + } + + /** + * Similar to {@link #assertNoPrefix}, but here we do know that unbound + * namespace URI should be indicated as empty String. + */ + protected static void assertNoNsURI(XMLStreamReader sr) throws XMLStreamException { + String uri = sr.getNamespaceURI(); + if (uri == null) { + Assert.fail("Expected empty String to indicate \"no namespace\": got null"); + } else if (uri.length() != 0) { + Assert.fail("Expected empty String to indicate \"no namespace\": got '" + uri + "'"); + } + } + + protected static void assertNoAttrNamespace(String attrNsURI) throws XMLStreamException { + if (attrNsURI == null) { + // refer to 6903561; accept null for now. + // fail("Expected empty String to indicate \"no namespace\" (for attribute): got null"); + } else if (attrNsURI.length() != 0) { + Assert.fail("Expected empty String to indicate \"no namespace\" (for attribute): got '" + attrNsURI + "'"); + } + } + + protected static void assertNoPrefixOrNs(XMLStreamReader sr) throws XMLStreamException { + assertNoPrefix(sr); + assertNoNsURI(sr); + } + + /** + * Helper assertion that assert that the String is either null or empty + * (""). + */ + protected static void assertNullOrEmpty(String str) { + if (str != null && str.length() > 0) { + Assert.fail("Expected String to be empty or null; was '" + str + "' (length " + str.length() + ")"); + } + } + + /* + * ////////////////////////////////////////////////// // Debug/output + * helpers ////////////////////////////////////////////////// + */ + + protected static String tokenTypeDesc(int tt) { + String desc = (String) mTokenTypes.get(new Integer(tt)); + if (desc == null) { + return "[" + tt + "]"; + } + return desc; + } + + protected static String tokenTypeDesc(XMLEvent evt) { + return tokenTypeDesc(evt.getEventType()); + } + + final static int MAX_DESC_TEXT_CHARS = 8; + + protected static String tokenTypeDesc(int tt, XMLStreamReader sr) { + String desc = tokenTypeDesc(tt); + // Let's show first 8 chars or so... + if (tt == CHARACTERS || tt == SPACE || tt == CDATA) { + String str = sr.getText(); + if (str.length() > MAX_DESC_TEXT_CHARS) { + desc = "\"" + str.substring(0, MAX_DESC_TEXT_CHARS) + "\"[...]"; + } else { + desc = "\"" + desc + "\""; + } + desc = " (" + desc + ")"; + } + return desc; + } + + protected static String valueDesc(String value) { + if (value == null) { + return "[NULL]"; + } + return "\"" + value + "\""; + } + + protected static String printable(char ch) { + if (ch == '\n') { + return "\\n"; + } + if (ch == '\r') { + return "\\r"; + } + if (ch == '\t') { + return "\\t"; + } + if (ch == ' ') { + return "_"; + } + if (ch > 127 || ch < 32) { + StringBuffer sb = new StringBuffer(6); + sb.append("\\u"); + String hex = Integer.toHexString((int) ch); + for (int i = 0, len = 4 - hex.length(); i < len; i++) { + sb.append('0'); + } + sb.append(hex); + return sb.toString(); + } + return null; + } + + protected static String printable(String str) { + if (str == null || str.length() == 0) { + return str; + } + + int len = str.length(); + StringBuffer sb = new StringBuffer(len + 64); + for (int i = 0; i < len; ++i) { + char c = str.charAt(i); + String res = printable(c); + if (res == null) { + sb.append(c); + } else { + sb.append(res); + } + } + return sb.toString(); + } + + protected static String quotedPrintable(String str) { + if (str == null || str.length() == 0) { + return "[0]''"; + } + return "[len: " + str.length() + "] '" + printable(str) + "'"; + } + + protected void reportNADueToProperty(String method, String prop) { + String clsName = getClass().getName(); + /* + * 27-Sep-2005, TSa: Should probably use some other mechanism for + * reporting this. Does JUnit have something applicable? + */ + System.err.println("Skipping " + clsName + "#" + method + ": property '" + prop + "' (or one of its values) not supported."); + } + + protected void reportNADueToNS(String method) { + reportNADueToProperty(method, "IS_NAMESPACE_AWARE"); + } + + protected void reportNADueToExtEnt(String method) { + reportNADueToProperty(method, "IS_SUPPORTING_EXTERNAL_ENTITIES"); + } + + protected void reportNADueToEntityExpansion(String method, int type) { + String clsName = getClass().getName(); + String msg = (type > 0) ? " (next event: " + tokenTypeDesc(type) + ")" : ""; + System.err.println("Skipping " + clsName + "#" + method + ": entity expansion does not seem to be functioning properly" + msg + "."); + } +} diff -r 82f4cb44b2d7 -r 85b0d46b0104 jaxp/test/javax/xml/jaxp/unittest/util/DraconianErrorHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxp/test/javax/xml/jaxp/unittest/util/DraconianErrorHandler.java Tue Nov 18 12:01:27 2014 -0800 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package util; + +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +public final class DraconianErrorHandler extends DefaultHandler { + public void error(SAXParseException e) throws SAXException { + throw e; + } + + public void fatalError(SAXParseException e) throws SAXException { + throw e; + } +}