sboag       00/12/27 14:40:17

  Modified:    test/java/src/org/apache/qetest/xslwrapper TraxWrapper.java
  Log:
  In processSAXToSAX, call setDTDHandler on the reader,
  and set namespace processing and Xerces dynamic validation.
  Also, call setSystemId on the stylesheet handler.
  Things are still not perfect yet, since newTransformerHandler is
  returning a StreeHandler that has a Document node as the base,
  instead of the needed DocumentFragment, so that multi-node
  roots can be handled.  I think this is the current reason for most
  of the failures in the conformance test when trax.s2s.
  
  Revision  Changes    Path
  1.8       +21 -2     
xml-xalan/test/java/src/org/apache/qetest/xslwrapper/TraxWrapper.java
  
  Index: TraxWrapper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/xslwrapper/TraxWrapper.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TraxWrapper.java  2000/12/21 15:22:45     1.7
  +++ TraxWrapper.java  2000/12/27 22:40:16     1.8
  @@ -107,7 +107,7 @@
    * @todo share constants between TraxWrapper, SaxonWrapper
    * @todo document how we perform various types of transforms
    * @author Shane Curcuru
  - * @version $Id: TraxWrapper.java,v 1.7 2000/12/21 15:22:45 curcuru Exp $
  + * @version $Id: TraxWrapper.java,v 1.8 2000/12/27 22:40:16 sboag Exp $
    */
   public class TraxWrapper extends ProcessorWrapper
   {
  @@ -517,13 +517,32 @@
   
           // Use a new XMLReader to parse the XML document
           XMLReader xmlReader = XMLReaderFactory.createXMLReader();
  -        xmlReader.setContentHandler(stylesheetHandler);  
  +        xmlReader.setContentHandler(stylesheetHandler); 
   
           // Set the ContentHandler to also function as LexicalHandler,
           // includes "lexical" events (e.g., comments and CDATA). 
           xmlReader.setProperty(
                   "http://xml.org/sax/properties/lexical-handler";, 
                   stylesheetHandler);
  +        
xmlReader.setProperty("http://xml.org/sax/properties/declaration-handler";,
  +                           stylesheetHandler);
  +        
  +        // These two lines were added by sb.
  +        xmlReader.setDTDHandler(stylesheetHandler);
  +        stylesheetHandler.setSystemId(xmlSource);
  +        
  +        try
  +        {
  +          
xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes";,
  +                            true);
  +          
xmlReader.setFeature("http://apache.org/xml/features/validation/dynamic";,
  +                            true);
  +        }
  +        catch (org.xml.sax.SAXException se)
  +        {
  +          // We don't care.
  +        }
  +
   
           // Create a 'pipe'-like identity transformer, so we can 
           //  easily get our results serialized to disk
  
  
  

Reply via email to