tmiller     01/07/20 13:07:14

  Modified:    java/src/org/apache/xalan/xsltc/trax
                        TransformerFactoryImpl.java
  Log:
  Added DOMSource support for stylesheet
  
  Revision  Changes    Path
  1.13      +7 -11     
xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
  
  Index: TransformerFactoryImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TransformerFactoryImpl.java       2001/07/20 15:24:33     1.12
  +++ TransformerFactoryImpl.java       2001/07/20 20:07:14     1.13
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: TransformerFactoryImpl.java,v 1.12 2001/07/20 15:24:33 morten 
Exp $
  + * @(#)$Id: TransformerFactoryImpl.java,v 1.13 2001/07/20 20:07:14 tmiller 
Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -381,15 +381,12 @@
            }
            // handle  DOMSource  
            else if (source instanceof DOMSource) {
  -             throw new TransformerConfigurationException(
  -                                                         "DOMSource not 
supported yet.");
  -             /****
  -                  final DOMSource domsrc = (DOMSource)source;
  -                  final Document dom = (Document)domsrc.getNode();
  -                  final DOM2SAX dom2sax = new DOM2SAX(dom);
  -                  xsltc.setXMLReader(dom2sax);  
  -                  input = null;
  -             ****/
  +             final DOMSource domsrc = (DOMSource)source;
  +             final Document dom = (Document)domsrc.getNode();
  +             final DOM2SAX dom2sax = new DOM2SAX(dom);
  +             xsltc.setXMLReader(dom2sax);  
  +             // try to get SAX InputSource from DOM Source.
  +             input = SAXSource.sourceToInputSource(source);
            }
            // Try to get InputStream or Reader from StreamSource
            else if (source instanceof StreamSource) {
  @@ -405,7 +402,6 @@
            else {
                throw new TransformerConfigurationException(UNKNOWN_SOURCE_ERR);
            }
  -     
            // Try to create an InputStream from the SystemId if no input so far
            if (input == null) {
                if ((new File(systemId)).exists())
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to