morten      01/12/17 07:11:21

  Modified:    java/src/org/apache/xalan/xsltc/cmdline Transform.java
               java/src/org/apache/xalan/xsltc/dom DTDMonitor.java
  Log:
  A small cleanup in our native API.
  Submitted by: [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.15      +6 -7      xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Transform.java
  
  Index: Transform.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Transform.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Transform.java    2001/12/17 09:19:52     1.14
  +++ Transform.java    2001/12/17 15:11:21     1.15
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Transform.java,v 1.14 2001/12/17 09:19:52 morten Exp $
  + * @(#)$Id: Transform.java,v 1.15 2001/12/17 15:11:21 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -173,9 +173,7 @@
            }
            
            // Create a DTD monitor and pass it to the XMLReader object
  -         final DTDMonitor dtdMonitor = new DTDMonitor();
  -         dtdMonitor.handleDTD(reader);
  -
  +         final DTDMonitor dtdMonitor = new DTDMonitor(reader);
            AbstractTranslet _translet = (AbstractTranslet)translet;
            dom.setDocumentURI(_fileName);
            if (_uri)
  @@ -185,11 +183,9 @@
   
            builder = null;
   
  -         // Set size of key/id indices
  -         _translet.setIndexSize(dom.getSize());
            // If there are any elements with ID attributes, build an index
            dtdMonitor.buildIdIndex(dom, 0, _translet);
  -
  +         // Pass unparsed entity descriptions to the translet
            _translet.setDTDMonitor(dtdMonitor);
   
            // Pass global parameters
  @@ -209,6 +205,9 @@
            TextOutput textOutput =
                new TextOutput((ContentHandler)saxHandler,
                               (LexicalHandler)saxHandler, encoding);
  +
  +         // Transform and pass output to the translet output handler
  +         translet.transform(dom, textOutput);
        }
        catch (TransletException e) {
            if (_debug) e.printStackTrace();
  
  
  
  1.7       +11 -1     xml-xalan/java/src/org/apache/xalan/xsltc/dom/DTDMonitor.java
  
  Index: DTDMonitor.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DTDMonitor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DTDMonitor.java   2001/10/31 13:09:56     1.6
  +++ DTDMonitor.java   2001/12/17 15:11:21     1.7
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: DTDMonitor.java,v 1.6 2001/10/31 13:09:56 morten Exp $
  + * @(#)$Id: DTDMonitor.java,v 1.7 2001/12/17 15:11:21 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -101,6 +101,13 @@
       public DTDMonitor() { }
   
       /**
  +     * Constructor
  +     */
  +    public DTDMonitor(XMLReader reader) throws RuntimeException {
  +     handleDTD(reader);
  +    }
  +
  +    /**
        * Set an instance of this class as the DTD declaration handler for
        * an XMLReader object (using the setProperty() method).
        */
  @@ -205,6 +212,9 @@
   
        // These variables are put up here for speed
        int node, attr, type, typeCache;
  +
  +     // Set size of key/id indices
  +     translet.setIndexSize(dom.getSize());
   
        // Do nothing if there were no ID declarations in the DTD
        if ((_idAttributes == null) || (_idAttributes.isEmpty())) return;
  
  
  

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

Reply via email to