Package org.apache.xalan.xsltc.dom

Examples of org.apache.xalan.xsltc.dom.DOMImpl


  else {
      // Get a reference to the translet wrapped inside the transformer
      _translet = _transformer.getTranslet();

      // Create a DOMBuilder object and get the handler
      _dom = new DOMImpl();
      _handler = _dom.getBuilder();
      _lexHandler = (LexicalHandler) _handler;

      // Create a new DTD monitor
      _dtd = new DTDMonitor();
View Full Code Here


      }
      final SAXParser parser = factory.newSAXParser();
      final XMLReader reader = parser.getXMLReader();

      // Set the DOM's DOM builder as the XMLReader's SAX2 content handler
      final DOMImpl dom = new DOMImpl();
      DOMBuilder builder = dom.getBuilder();
      reader.setContentHandler(builder);

      try {
    String prop = "http://xml.org/sax/properties/lexical-handler";
    reader.setProperty(prop, builder);
      }
      catch (SAXException e) {
    // quitely ignored
      }
     
      // Create a DTD monitor and pass it to the XMLReader object
      final DTDMonitor dtdMonitor = new DTDMonitor(reader);
      AbstractTranslet _translet = (AbstractTranslet)translet;
      dom.setDocumentURI(_fileName);
      if (_uri)
    reader.parse(_fileName);
      else
    reader.parse(new File(_fileName).toURL().toExternalForm());
View Full Code Here

      }
     
  }

  // Get the references to the actual DOM and DTD handler
  final DOMImpl    dom = doc.getDocument();
  final DTDMonitor dtd = doc.getDTDMonitor();

  // The dom reference may be null if the URL pointed to a
  // non-existing document
  if (dom == null) return null;

  doc.incAccessCount(); // For statistics

  final AbstractTranslet translet = (AbstractTranslet)trs;

  // Set minimum needed size for key/id indices in the translet
  translet.setIndexSize(dom.getSize());
  // Create index for any ID attributes defined in the document DTD
  dtd.buildIdIndex(dom, mask, translet);
  // Pass all unparsed entities to the translet
  translet.setUnparsedEntityURIs(dtd.getUnparsedEntityURIs());
View Full Code Here

  /**
   * Loads the document and updates build-time (latency) statistics
   */
  public void loadDocument(String uri) {

      _dom = new DOMImpl();
      _dtdMonitor = new DTDMonitor();

      try {
    final long stamp = System.currentTimeMillis();

View Full Code Here

        // Copy all the nodes in the nodelist to be under the top element
        copyNodes(nodeList, doc, topElementNode);
       
  // w3c DOM -> DOM2SAX -> DOMBuilder -> DOMImpl
  DOMImpl idom = new DOMImpl();
  final DOM2SAX dom2sax = new DOM2SAX(doc);
  final DOMBuilder domBuilder = idom.getBuilder();
  dom2sax.setContentHandler(domBuilder);
  try {
      dom2sax.parse();
  }
        catch (java.io.IOException e){
View Full Code Here

     * Create a new XSLTC-specific DOM source
     * @param size The estimated node-count for this DOM. A good guess here
     * speeds up the DOM build process.
     */
    public XSLTCSource(int size) {
  _dom = new DOMImpl(size);
  _dtd = new DTDMonitor();
    }
View Full Code Here

    /**
     * Create a new XSLTC-specific DOM source
     */
    public XSLTCSource() {
  _dom = new DOMImpl();
  _dtd = new DTDMonitor();
    }
View Full Code Here

      }
      final SAXParser parser = factory.newSAXParser();
      final XMLReader reader = parser.getXMLReader();

      // Set the DOM's builder as the XMLReader's SAX2 content handler
      _dom = new DOMImpl();
      reader.setContentHandler(_dom.getBuilder());

      // Create a DTD monitor and pass it to the XMLReader object
      _dtdMonitor = new DTDMonitor();
      _dtdMonitor.handleDTD(reader);
View Full Code Here

  }
  final SAXParser parser = factory.newSAXParser();
  final XMLReader reader = parser.getXMLReader();

  // Set the DOM's builder as the XMLReader's SAX2 content handler
  DOMImpl dom = new DOMImpl();
  reader.setContentHandler(dom.getBuilder());

  // Create a DTD monitor and pass it to the XMLReader object
  final DTDMonitor dtdMonitor = new DTDMonitor();
  dtdMonitor.handleDTD(reader);
  translet.setDTDMonitor(dtdMonitor);
View Full Code Here

    // Instanciate a translet object (inherits AbstractTranslet)
          Class tc = Class.forName(transletName);
    AbstractTranslet translet = (AbstractTranslet)tc.newInstance();

    // Read input document from the DOM cache
    DOMImpl dom = getDOM(document, translet);

    // Create output handler
    TransletOutputHandlerFactory tohFactory =
        TransletOutputHandlerFactory.newInstance();
    tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM);
View Full Code Here

TOP

Related Classes of org.apache.xalan.xsltc.dom.DOMImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.