Examples of DTMManager


Examples of org.apache.xml.dtm.DTMManager

      SQLWarning        warn = m_LastSQLDocumentWithError.checkWarnings();


      try
      {
        DTMManager mgr =
          ((XPathContext.XPathExpressionContext)ctx).getDTMManager();
        DTMManagerDefault mgrDefault = (DTMManagerDefault) mgr;
        int dtmIdent = mgrDefault.getFirstFreeDTMID();

        eDoc = new SQLErrorDocument(
View Full Code Here

Examples of org.apache.xml.dtm.DTMManager

   * the document. This type of method may better placed inside the DTMDocument
   * code
   */
  public static SQLDocument getNewDocument(ExpressionContext exprContext)
  {
    DTMManager mgr =
      ((XPathContext.XPathExpressionContext)exprContext).getDTMManager();
    DTMManagerDefault  mgrDefault = (DTMManagerDefault) mgr;


    int dtmIdent = mgrDefault.getFirstFreeDTMID();
View Full Code Here

Examples of org.apache.xml.dtm.DTMManager

       
        base = base + java.io.File.separatorChar
               + source.getClass().getName();
      }
      setBaseURLOfSource(base);
      DTMManager mgr = m_xcontext.getDTMManager();
      DTM dtm = mgr.getDTM(source, false, this, true, true);
      dtm.setDocumentBaseURI(base);
     
      boolean hardDelete = true// %REVIEW% I have to think about this. -sb

      try
      {
        // NOTE: This will work because this is _NOT_ a shared DTM, and thus has
        // only a single Document node. If it could ever be an RTF or other
        // shared DTM, look at dtm.getDocumentRoot(nodeHandle).
        this.transformNode(dtm.getDocument());
      }
      finally
      {
        if (shouldRelease)
          mgr.release(dtm, hardDelete);
      }

      // Kick off the parse.  When the ContentHandler gets
      // the startDocument event, it will call transformNode( node ).
      // reader.parse( xmlSource );
View Full Code Here

Examples of org.apache.xml.dtm.DTMManager

        // w3cDOM -> DTM -> DOMImpl
  if (dom instanceof MultiDOM) {
            final MultiDOM multiDOM = (MultiDOM) dom;

      DTMDefaultBase dtm = (DTMDefaultBase)((DOMAdapter)multiDOM.getMain()).getDOMImpl();
      DTMManager dtmManager = dtm.getManager();
     
      SAXImpl idom = (SAXImpl)dtmManager.getDTM(new DOMSource(doc), false,
                  null, true, false);
      // Create DOMAdapter and register with MultiDOM
      DOMAdapter domAdapter = new DOMAdapter(idom,
                translet.getNamesArray(),
    translet.getNamespaceArray());
View Full Code Here

Examples of org.apache.xml.dtm.DTMManager

  /**
   * @see DTMIterator#getDTM(int)
   */
  public DTM getDTM(int nodeHandle)
  {
    DTMManager mgr = getDTMManager();
    if(null != mgr)
      return getDTMManager().getDTM(nodeHandle);
    else
    {
      assertion(false, "Can not get a DTM Unless a DTMManager has been set!");
View Full Code Here

Examples of org.apache.xml.dtm.DTMManager

   */
  public XObject execute(XPathContext xctxt, boolean destructiveOK)
    throws javax.xml.transform.TransformerException
  {
    XNodeSet xns = (XNodeSet)super.execute(xctxt, destructiveOK);
    DTMManager dtmMgr = xctxt.getDTMManager();
    int context = xctxt.getContextNode();
    if(dtmMgr.getDTM(xns.getRoot()).getDocument() !=
       dtmMgr.getDTM(context).getDocument())
    {
      Expression expr = (Expression)xns.getContainedIter();
      xns = (XNodeSet)expr.asIterator(xctxt, context);
    }
    return xns;
View Full Code Here

Examples of org.apache.xml.dtm.DTMManager

       
        base = base + java.io.File.separatorChar
               + source.getClass().getName();
      }
      setBaseURLOfSource(base);
      DTMManager mgr = m_xcontext.getDTMManager();
      /*
       * According to JAXP1.2, new SAXSource()/StreamSource()
       * should create an empty input tree, with a default root node.
       * new DOMSource()creates an empty document using DocumentBuilder.
       * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations,
       * since there is no clear spec. how to create an empty tree when
       * both SAXSource() and StreamSource() are used.
       */
      if ((source instanceof StreamSource && source.getSystemId()==null &&
         ((StreamSource)source).getInputStream()==null &&
         ((StreamSource)source).getReader()==null)||
         (source instanceof SAXSource &&
         ((SAXSource)source).getInputSource()==null &&
         ((SAXSource)source).getXMLReader()==null )||
         (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){
        try {
          DocumentBuilderFactory builderF =
                   DocumentBuilderFactory.newInstance();
          DocumentBuilder builder = builderF.newDocumentBuilder();
          String systemID = source.getSystemId();
          source = new DOMSource(builder.newDocument());

          // Copy system ID from original, empty Source to new Source
          if (systemID != null) {
            source.setSystemId(systemID);
          }
        } catch (ParserConfigurationException e) {
          fatalError(e);
        }          
      }
      DTM dtm = mgr.getDTM(source, false, this, true, true);
      dtm.setDocumentBaseURI(base);
     
      boolean hardDelete = true// %REVIEW% I have to think about this. -sb

      try
      {
        // NOTE: This will work because this is _NOT_ a shared DTM, and thus has
        // only a single Document node. If it could ever be an RTF or other
        // shared DTM, look at dtm.getDocumentRoot(nodeHandle).
        this.transformNode(dtm.getDocument());
      }
      finally
      {
        if (shouldRelease)
          mgr.release(dtm, hardDelete);
      }

      // Kick off the parse.  When the ContentHandler gets
      // the startDocument event, it will call transformNode( node ).
      // reader.parse( xmlSource );
View Full Code Here

Examples of org.apache.xml.dtm.DTMManager

    private static DTMAxisIterator document(DOM newdom,
                                            AbstractTranslet translet,
                                            DOM dom)
        throws Exception
    {
        DTMManager dtmManager = ((MultiDOM)dom).getDTMManager();
        // Need to migrate the cached DTM to the new DTMManager
        if (dtmManager != null && newdom instanceof DTM) {
            ((DTM)newdom).migrateTo(dtmManager);
        }
     
View Full Code Here

Examples of org.apache.xml.dtm.DTMManager

        // w3cDOM -> DTM -> DOMImpl
  if (dom instanceof MultiDOM) {
            final MultiDOM multiDOM = (MultiDOM) dom;

      DTMDefaultBase dtm = (DTMDefaultBase)((DOMAdapter)multiDOM.getMain()).getDOMImpl();
      DTMManager dtmManager = dtm.getManager();
     
      SAXImpl idom = (SAXImpl)dtmManager.getDTM(new DOMSource(doc), false,
                  null, true, false);
      // Create DOMAdapter and register with MultiDOM
      DOMAdapter domAdapter = new DOMAdapter(idom,
                translet.getNamesArray(),
    translet.getNamespaceArray());
View Full Code Here

Examples of org.apache.xml.dtm.DTMManager

   * the document. This type of method may better placed inside the DTMDocument
   * code
   */
  public static SQLDocument getNewDocument(ExpressionContext exprContext)
  {
    DTMManager mgr =
      ((XPathContext.XPathExpressionContext)exprContext).getDTMManager();
    DTMManagerDefault  mgrDefault = (DTMManagerDefault) mgr;


    int dtmIdent = mgrDefault.getFirstFreeDTMID();
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.