Skip to content

MultiDocumentSupport

tobiasz.cudnik edited this page Nov 19, 2008 · 4 revisions

Table of Contents

What MultiDocumentSupport is

 * support for working on several documents in same time
 * easy importing of nodes from one document to another
 * pointing document thought
   * phpQuery object
   * [http://www.php.net/manual/en/class.domnode.php DOMNode] object
   * [http://www.php.net/manual/en/class.domdocument.php DOMDocument] object
   * internal document ID
 * last created (or selected) document is assumed to be default in pq();

What MultiDocumentSupport is NOT

 * it's *not possible* to fetch nodes from several document in one query
 * it's *not possible* to operate on nodes from several document in one phpQuery object

Example

Static Methods

 * phpQuery::*newDocument*($html) Creates new document from markup
 * phpQuery::*newDocumentFile*($file) Creates new document from file
 * phpQuery::*getDocument*($id = null) Returns phpQueryObject containing document with id $id or  default document (last created/selected)
 * phpQuery::*selectDocument*($id) Sets default document to $id
 * phpQuery::*unloadDocuments*($id = null) Unloades all or specified document from memory
 * phpQuery::*getDocumentID*($source) Returns $source's document ID
 * phpQuery::*getDOMDocument*($source) Get DOMDocument object related to $source

Object Methods

 * $pq->*getDocument*() Returns object with stack set to document root
 * $pq->*getDocumentID*() Get object's Document ID
 * $pq->*getDocumentIDRef*(&$documentID) Saves object's DocumentID to $var by reference
 * $pq->*unloadDocument*() Unloads whole document from memory
Clone this wiki locally