Examples of DTDMonitor


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

      // Set the DOM's DOM builder as the XMLReader's SAX2 content handler
      final 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 = (AbstractTranslet)translet;
      dom.setDocumentURI(_fileName);
      if (_uri)
    reader.parse(_fileName);
      else
    reader.parse("file:"+(new File(_fileName).getAbsolutePath()));
     
      // 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);

      _translet.setDTDMonitor(dtdMonitor);

      // Pass global parameters
      int n = _params.size();
View Full Code Here

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

      // Set the DOM's DOM builder as the XMLReader's SAX2 content handler
      final 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);
      dom.setDocumentURI(xmlDocName);
         /****************
             if (_uri)
                 reader.parse(xmlDocName);
             else
         *******************/
      reader.parse("file:"+(new File(xmlDocName).getAbsolutePath()));

      // Set size of key/id indices
      setIndexSize(dom.getSize());
      // If there are any elements with ID attributes, build an index
      dtdMonitor.buildIdIndex(dom, 0, this);
      setDTDMonitor(dtdMonitor);
      // Transform the document
      TextOutput textOutput = new TextOutput(saxHandler, encoding);
View Full Code Here

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

     
  }

  // 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());

  return(doc.getDocument());
    }
View Full Code Here

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

   * 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();

    _reader.setContentHandler(_dom.getBuilder());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.