You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@locus.apache.org on 2000/02/18 05:17:45 UTC

cvs commit: xml-xalan/src/org/apache/xalan/xslt StylesheetRoot.java XSLTEngineImpl.java

sboag       00/02/17 20:17:45

  Modified:    src/org/apache/xalan/xslt StylesheetRoot.java
                        XSLTEngineImpl.java
  Log:
  Use just the DOMFactory on the XMLParserLiaison, add a setDOMFactory method to XPathSupport, and throw errors if a DTM liaison is used with DOM input or output.
  
  Revision  Changes    Path
  1.25      +9 -1      xml-xalan/src/org/apache/xalan/xslt/StylesheetRoot.java
  
  Index: StylesheetRoot.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/StylesheetRoot.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- StylesheetRoot.java	2000/02/17 18:28:55	1.24
  +++ StylesheetRoot.java	2000/02/18 04:17:45	1.25
  @@ -89,6 +89,8 @@
     transient Vector m_traceListeners = null;
         
     static final String DEFAULT_ENCODING = "UTF-8";
  +  
  +  String m_liaisonClassUsedToCreate = null;
       
     /**
      * Read the stylesheet root from a serialization stream.
  @@ -192,6 +194,7 @@
       IOException,
       SAXException
     {
  +    m_liaisonClassUsedToCreate = ((Object)processor.getXMLProcessorLiaison()).getClass().getName();
       m_importStack = new Stack();
       // For some reason, the imports aren't working right if I 
       // don't set the baseIdent to full url.  I think this is OK, 
  @@ -255,7 +258,10 @@
              FileNotFoundException,
              IOException
     {
  -    XSLTProcessor iprocessor = new XSLTProcessorFactory().getProcessor();
  +    XSLTProcessor iprocessor =
  +                              (null != m_liaisonClassUsedToCreate) ? 
  +                              new XSLTProcessorFactory().getProcessorUsingLiaisonName(m_liaisonClassUsedToCreate)
  +                              : new XSLTProcessorFactory().getProcessor();
       process(iprocessor, iprocessor.getSourceTreeFromInput(xmlSource), outputTarget);
       // System.out.println("Number counters made: "+
       //                   ((XSLTEngineImpl)iprocessor).getCountersTable().m_countersMade);
  @@ -369,6 +375,8 @@
           }
           else if(null != outputTarget.getNode())
           {
  +          if(processor.getXMLProcessorLiaison() instanceof org.apache.xalan.xpath.dtm.DTMLiaison)
  +            processor.error("Can't use a DTMLiaison for an output DOM node... pass a org.apache.xalan.xpath.xdom.XercesLiaison instead!");
             switch(outputTarget.getNode().getNodeType())
             {
             case Node.DOCUMENT_NODE:
  
  
  
  1.39      +3 -0      xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java
  
  Index: XSLTEngineImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- XSLTEngineImpl.java	2000/02/17 22:07:33	1.38
  +++ XSLTEngineImpl.java	2000/02/18 04:17:45	1.39
  @@ -800,6 +800,9 @@
   
       if(null != inputSource.getNode())
       {
  +      if(getXMLProcessorLiaison() instanceof org.apache.xalan.xpath.dtm.DTMLiaison)
  +        error("Can't use a DTMLiaison for a input DOM node... pass a org.apache.xalan.xpath.xdom.XercesLiaison instead!");
  +
         sourceTree = inputSource.getNode();
       }
       else