< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java

Print this page
rev 964 : 8162598: XSLTC transformer swallows empty namespace declaration which is needed to undeclare default namespace


 617             DOMSource.FEATURE,
 618             DOMResult.FEATURE,
 619             SAXSource.FEATURE,
 620             SAXResult.FEATURE,
 621             StAXSource.FEATURE,
 622             StAXResult.FEATURE,
 623             StreamSource.FEATURE,
 624             StreamResult.FEATURE,
 625             SAXTransformerFactory.FEATURE,
 626             SAXTransformerFactory.FEATURE_XMLFILTER,
 627             XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
 628         };
 629 
 630         // feature name cannot be null
 631         if (name == null) {
 632             ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
 633             throw new NullPointerException(err.toString());
 634         }
 635 
 636         // Inefficient, but array is small
 637         for (int i =0; i < features.length; i++) {
 638             if (name.equals(features[i])) {
 639                 return true;
 640             }
 641         }
 642 
 643         if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
 644             return !_isNotSecureProcessing;
 645         }
 646 
 647         /** Check to see if the property is managed by the JdkXmlFeatues **/
 648         int index = _xmlFeatures.getIndex(name);
 649         if (index > -1) {
 650             return _xmlFeatures.getFeature(index);
 651         }
 652 
 653         // Feature not supported
 654         return false;
 655     }
 656     /**
 657      * Return the state of the services mechanism feature.


 906             }
 907             catch (ClassNotFoundException cnfe) {
 908                 ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName);
 909                 throw new TransformerConfigurationException(err.toString());
 910             }
 911             catch (Exception e) {
 912                 ErrorMsg err = new ErrorMsg(
 913                                      new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)
 914                                      + e.getMessage());
 915                 throw new TransformerConfigurationException(err.toString());
 916             }
 917         }
 918 
 919         // If _autoTranslet is true, we will try to load the bytecodes
 920         // from the translet classes without compiling the stylesheet.
 921         if (_autoTranslet)  {
 922             byte[][] bytecodes;
 923             String transletClassName = getTransletBaseName(source);
 924 
 925             if (_packageName != null)
 926                transletClassName = _packageName + "." + transletClassName;
 927 
 928             if (_jarFileName != null)
 929                 bytecodes = getBytecodesFromJar(source, transletClassName);
 930             else
 931                 bytecodes = getBytecodesFromClasses(source, transletClassName);
 932 
 933             if (bytecodes != null) {
 934                 if (_debug) {
 935                     if (_jarFileName != null)
 936                         System.err.println(new ErrorMsg(
 937                             ErrorMsg.TRANSFORM_WITH_JAR_STR, transletClassName, _jarFileName));
 938                     else
 939                         System.err.println(new ErrorMsg(
 940                             ErrorMsg.TRANSFORM_WITH_TRANSLET_STR, transletClassName));
 941                 }
 942 
 943                 // Reset the per-session attributes to their default values
 944                 // after each newTemplates() call.
 945                 resetTransientAttributes();
 946                 templates = new TemplatesImpl(bytecodes, transletClassName, null, _indentNumber, this);




 617             DOMSource.FEATURE,
 618             DOMResult.FEATURE,
 619             SAXSource.FEATURE,
 620             SAXResult.FEATURE,
 621             StAXSource.FEATURE,
 622             StAXResult.FEATURE,
 623             StreamSource.FEATURE,
 624             StreamResult.FEATURE,
 625             SAXTransformerFactory.FEATURE,
 626             SAXTransformerFactory.FEATURE_XMLFILTER,
 627             XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
 628         };
 629 
 630         // feature name cannot be null
 631         if (name == null) {
 632             ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
 633             throw new NullPointerException(err.toString());
 634         }
 635 
 636         // Inefficient, but array is small
 637         for (int i = 0; i < features.length; i++) {
 638             if (name.equals(features[i])) {
 639                 return true;
 640             }
 641         }
 642 
 643         if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
 644             return !_isNotSecureProcessing;
 645         }
 646 
 647         /** Check to see if the property is managed by the JdkXmlFeatues **/
 648         int index = _xmlFeatures.getIndex(name);
 649         if (index > -1) {
 650             return _xmlFeatures.getFeature(index);
 651         }
 652 
 653         // Feature not supported
 654         return false;
 655     }
 656     /**
 657      * Return the state of the services mechanism feature.


 906             }
 907             catch (ClassNotFoundException cnfe) {
 908                 ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName);
 909                 throw new TransformerConfigurationException(err.toString());
 910             }
 911             catch (Exception e) {
 912                 ErrorMsg err = new ErrorMsg(
 913                                      new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)
 914                                      + e.getMessage());
 915                 throw new TransformerConfigurationException(err.toString());
 916             }
 917         }
 918 
 919         // If _autoTranslet is true, we will try to load the bytecodes
 920         // from the translet classes without compiling the stylesheet.
 921         if (_autoTranslet)  {
 922             byte[][] bytecodes;
 923             String transletClassName = getTransletBaseName(source);
 924 
 925             if (_packageName != null)
 926                 transletClassName = _packageName + "." + transletClassName;
 927 
 928             if (_jarFileName != null)
 929                 bytecodes = getBytecodesFromJar(source, transletClassName);
 930             else
 931                 bytecodes = getBytecodesFromClasses(source, transletClassName);
 932 
 933             if (bytecodes != null) {
 934                 if (_debug) {
 935                     if (_jarFileName != null)
 936                         System.err.println(new ErrorMsg(
 937                             ErrorMsg.TRANSFORM_WITH_JAR_STR, transletClassName, _jarFileName));
 938                     else
 939                         System.err.println(new ErrorMsg(
 940                             ErrorMsg.TRANSFORM_WITH_TRANSLET_STR, transletClassName));
 941                 }
 942 
 943                 // Reset the per-session attributes to their default values
 944                 // after each newTemplates() call.
 945                 resetTransientAttributes();
 946                 templates = new TemplatesImpl(bytecodes, transletClassName, null, _indentNumber, this);


< prev index next >