private static extern RCODE xflaim_Db_importIntoDocument( IntPtr pDb, IntPtr pIStream, IntPtr pNodeToLinkTo, eNodeInsertLoc insertLocation, CS_XFLM_IMPORT_STATS importStats);
//----------------------------------------------------------------------------- // importIntoDocument //----------------------------------------------------------------------------- /// <summary> /// Imports an XML fragment into a document. The import requires /// an update transaction. /// </summary> /// <param name="istream"> /// Input stream containing the nodes to be imported. /// </param> /// <param name="nodeToLinkTo"> /// Existing node that imported nodes will link to. /// </param> /// <param name="insertLocation"> /// Where imported XML fragment is to be linked with respect /// to nodeToLinkTo. /// </param> /// <returns> /// Returns import statistics <see cref="CS_XFLM_IMPORT_STATS"/>. /// </returns> public CS_XFLM_IMPORT_STATS importIntoDocument( IStream istream, DOMNode nodeToLinkTo, eNodeInsertLoc insertLocation) { RCODE rc; CS_XFLM_IMPORT_STATS importStats = new CS_XFLM_IMPORT_STATS(); if ((rc = xflaim_Db_importIntoDocument( m_pDb, istream.getIStream(), nodeToLinkTo.getNode(), insertLocation, importStats)) != 0) { throw new XFlaimException(rc); } return( importStats); }
private static extern RCODE xflaim_Db_importDocument( IntPtr pDb, IntPtr pIStream, uint uiCollection, ref IntPtr ppDocumentNode, CS_XFLM_IMPORT_STATS pImportStats);
//----------------------------------------------------------------------------- // importDocument //----------------------------------------------------------------------------- /// <summary> /// Imports an XML document into the XFlaim database. The import requires /// an update transaction. /// </summary> /// <param name="istream"> /// Input stream containing the document(s) to be imported /// </param> /// <param name="uiCollection"> /// Destination collection for imported document(s). /// </param> /// <param name="nodeToReuse"> /// An existing DOM node object can optionally be passed in. It will /// be reused rather than allocating a new object. /// </param> /// <param name="importStats"> /// Import statistics is returned here if a non-null value is passed in. /// </param> /// <returns> /// Returns a <see cref="DOMNode"/> that is the root of the imported document. /// </returns> public DOMNode importDocument( IStream istream, uint uiCollection, DOMNode nodeToReuse, CS_XFLM_IMPORT_STATS importStats) { RCODE rc; IntPtr pDocumentNode = (nodeToReuse != null) ? nodeToReuse.getNode() : IntPtr.Zero; if (importStats == null) { importStats = new CS_XFLM_IMPORT_STATS(); } if ((rc = xflaim_Db_importDocument( m_pDb, istream.getIStream(), uiCollection, ref pDocumentNode, importStats)) != 0) { throw new XFlaimException(rc); } if( nodeToReuse != null) { nodeToReuse.setNodePtr( pDocumentNode, this); return( nodeToReuse); } return( new DOMNode( pDocumentNode, this)); }