From f6c148a1d4ec2f50ce3037a881219e17f046246c Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Tue, 21 Dec 2004 00:36:56 +0000 Subject: [PATCH] Use xref instead of link, this will automaticaly pickup the method name Fix DOMAttr->isId() docbook identifier Document and finalize DOMDocument->getElementsByTagNS(), DOMImplementation->hasFeature(), DOMXPath->evaluate(), dom_import_simplexml() git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@175207 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/dom/functions/dom-domattr-isid.xml | 6 +- ...dom-domdocument-getelementsbytagnamens.xml | 138 ++++++++++++--- .../dom-domimplementation-hasfeature.xml | 117 ++++++++----- .../dom/functions/dom-domxpath-evaluate.xml | 122 +++++++++++--- reference/dom/reference.xml | 158 +++++++++--------- 5 files changed, 370 insertions(+), 171 deletions(-) diff --git a/reference/dom/functions/dom-domattr-isid.xml b/reference/dom/functions/dom-domattr-isid.xml index aae592cf88..a13fd3f1ff 100644 --- a/reference/dom/functions/dom-domattr-isid.xml +++ b/reference/dom/functions/dom-domattr-isid.xml @@ -1,6 +1,6 @@ - - + + DOMAttr->isId @@ -23,7 +23,7 @@ According to the DOM standard this requires a DTD which defines the attribute ID to be of type ID. You need to validate your document with - DOMDocument->validate() + or DOMDocument::validateOnParse before using this function. diff --git a/reference/dom/functions/dom-domdocument-getelementsbytagnamens.xml b/reference/dom/functions/dom-domdocument-getelementsbytagnamens.xml index 7fb6948432..f0bb17dba8 100644 --- a/reference/dom/functions/dom-domdocument-getelementsbytagnamens.xml +++ b/reference/dom/functions/dom-domdocument-getelementsbytagnamens.xml @@ -1,31 +1,115 @@ - - - - DOMDocument->getElementsByTagNameNS - - Searches for all elements with given tag name in specified namespace - - - - &reftitle.description; - - DOMDocument - - DOMNodeList - getElementsByTagNameNS - stringnamespaceURI - stringlocalName - - - - This function returns a new instance of class - DOMNodeList containing the elements with tagnames - matching the localName parameter and in the namespaceURI namespace. - Use "*" for the name to return all elements within the document. - - - + + + + DOMDocument->getElementsByTagNameNS() + + Searches for all elements with given tag name in specified namespace + + + + &reftitle.description; + + DOMDocument + + DOMNodeList + getElementsByTagNameNS + stringnamespaceURI + stringlocalName + + + + Returns a DOMNodeList of all elements with a given + local name and a namespace URI. + + + + &reftitle.parameters; + + + + namespaceURI + + + The namespace URI of the elements to match on. + The special value * matches all namespaces. + + + + + localName + + + The local name of the elements to match on. + The special value * matches all local names. + + + + + + + + &reftitle.returnvalues; + + A new DOMNodeList object containing all the matched + elements. + + + + &reftitle.examples; + + + Get all the XInclude elements + + + +Books of the other guy.. + + + + xinclude: book.xml not found + + + + This is another namespace + + + +EOD; +$dom = new DOMDocument; + +// load the XML string defined above +$dom->loadXML($xml); + +foreach ($dom->getElementsByTagNameNS('http://www.w3.org/2001/XInclude', '*') as $element) { + echo 'local name: ', $element->localName, ', prefix: ', $element->prefix, "\n"; +} +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + + + + + + - - - DOMImplementation->hasFeature - - Test if the DOM implementation implements a specific feature - - - - &reftitle.description; - - DOMImplementation - - bool - hasFeature - stringfeature - stringversion - - - - Test if the DOM implementation implements a specific - feature. &return.success; - - - You can find a list of all features in the Conformance section of the DOM - specification. - - - version is the version number of the feature to - test. In level 2, this can be either 2.0 or - 1.0. - - - Testing your DOM Implementation - + + + + DOMImplementation->hasFeature() + + Test if the DOM implementation implements a specific feature + + + + &reftitle.description; + + DOMImplementation + + bool + hasFeature + stringfeature + stringversion + + + + Test if the DOM implementation implements a specific + feature. + + + You can find a list of all features in the Conformance section of the DOM + specification. + + + + &reftitle.parameters; + + + + feature + + + The feature to test. + + + + + version + + + The version number of the feature to test. In + level 2, this can be either 2.0 or + 1.0. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + Testing your DOM Implementation + $name) { ?> ]]> - - - - + + + + + &reftitle.seealso; + + + + + + + - - - DOMXPath->evaluate - - Evaluates the given XPath expression and returns a typed result - - - - &reftitle.description; - - DOMXPath - - mixed - evaluate - stringexpression - DOMNodecontextnode - - - &warn.undocumented.func; - - + + + + DOMXPath->evaluate() + + Evaluates the given XPath expression and returns a typed result if possible. + + + + &reftitle.description; + + DOMXPath + + mixed + evaluate + stringexpression + DOMNodecontextnode + + + + Executes the given XPath expression and returns + a typed result if possible. + + + + &reftitle.parameters; + + + + expression + + + The XPath expression to execute. + + + + + contextnode + + + The optional contextnode can be specified for + doing relative XPath queries. By default, the queries are relative to + the root element. + + + + + + + + &reftitle.returnvalues; + + Returns a typed result if possible or a DOMNodeList + containing all nodes matching the given XPath expression. + + + + &reftitle.examples; + + + Getting the count of all the english books + +load('book.xml'); + +$xpath = new DOMXPath($doc); + +$tbody = $doc->getElementsByTagName('tbody')->item(0); + +// our query is relative to the tbody node +$query = 'count(row/entry[. = "en"])'; + +$entries = $xpath->evaluate($query, $tbody); +echo "There are $entries english books\n"; + +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + + + + + + + DOM Functions DOM @@ -43,7 +43,7 @@ &reftitle.methods; - isId - Checks if attribute is a defined ID + - Checks if attribute is a defined ID @@ -106,19 +106,19 @@ &reftitle.methods; - appendData - Append a string to the end of the character data of the node + - Append a string to the end of the character data of the node - deleteData - Remove a range of characters from the node + - Remove a range of characters from the node - insertData - Insert a string at the specified 16-bit unit offset + - Insert a string at the specified 16-bit unit offset - replaceData - Replace a substring within the DOMCharacterData node + - Replace a substring within the DOMCharacterData node - substringData - Extracts a range of data from the node + - Extracts a range of data from the node @@ -163,7 +163,7 @@ &reftitle.constructor; - __construct - construct a new DOMDocument object + - construct a new DOMDocument object @@ -171,91 +171,91 @@ &reftitle.methods; - createAttribute - Create new attribute + - Create new attribute - createAttributeNS - Create new attribute node with an associated namespace + - Create new attribute node with an associated namespace - createCDATASection - Create new cdata node + - Create new cdata node - createComment - Create new comment node + - Create new comment node - createDocumentFragment - Create new document fragment + - Create new document fragment - createElement - Create new element node + - Create new element node - createElementNS - Create new element node with an associated namespace + - Create new element node with an associated namespace - createEntityReference - Create new entity reference node + - Create new entity reference node - createProcessingInstruction - Creates new PI node + - Creates new PI node - createTextNode - Create new text node + - Create new text node - getElementById - Searches for an element with a certain id + - Searches for an element with a certain id - getElementsByTagName - Searches for all elements with given tag name + - Searches for all elements with given tag name - getElementsByTagNameNS - Searches for all elements with given tag name in specified namespace + - Searches for all elements with given tag name in specified namespace - importNode - Import node into current document + - Import node into current document - load - Load XML from a file + - Load XML from a file - loadHTML - Load HTML from a string + - Load HTML from a string - loadHTMLFile - Load HTML from a file + - Load HTML from a file - loadXML - Load XML from a string + - Load XML from a string - normalize - Normalizes document + - Normalizes document - relaxNGValidate - Performs relaxNG validation on the document + - Performs relaxNG validation on the document - relaxNGValidateSource - Performs relaxNG validation on the document + - Performs relaxNG validation on the document - save - Dumps the internal XML tree back into a file + - Dumps the internal XML tree back into a file - saveHTML - Dumps the internal document into a string using HTML formatting + - Dumps the internal document into a string using HTML formatting - saveHTMLFile - Dumps the internal document back into a file using HTML formatting + - Dumps the internal document back into a file using HTML formatting - saveXML - Dumps the internal XML tree back into a string + - Dumps the internal XML tree back into a string - schemaValidate - Validates a document based on a schema + - Validates a document based on a schema - schemaValidateSource - Validates a document based on a schema + - Validates a document based on a schema - validate - Validates the document based on its DTD + - Validates the document based on its DTD - xinclude - Substitutes XIncludes in a DOMDocument Object + - Substitutes XIncludes in a DOMDocument Object @@ -504,49 +504,49 @@ &reftitle.methods; - getAttribute - Returns value of attribute + - Returns value of attribute - getAttributeNode - Returns attribute node + - Returns attribute node - getAttributeNodeNS - Returns attribute node + - Returns attribute node - getAttributeNS - Returns value of attribute + - Returns value of attribute - getElementsByTagName - Gets elements by tagname + - Gets elements by tagname - getElementsByTagNameNS - Get elements by namespaceURI and localName + - Get elements by namespaceURI and localName - hasAttribute - Checks to see if attribute exists + - Checks to see if attribute exists - hasAttributeNS - Checks to see if attribute exists + - Checks to see if attribute exists - removeAttribute - Removes attribute + - Removes attribute - removeAttributeNode - Removes attribute + - Removes attribute - removeAttributeNS - Removes attribute + - Removes attribute - setAttribute - Adds new attribute + - Adds new attribute - setAttributeNode - Adds new attribute node to element + - Adds new attribute node to element - setAttributeNodeNS - Adds new attribute node to element + - Adds new attribute node to element - setAttributeNS - Adds new attribute + - Adds new attribute @@ -722,13 +722,13 @@ &reftitle.methods; - createDocument - Creates a DOM Document object of the specified type with its document element + - Creates a DOM Document object of the specified type with its document element - createDocumentType - Creates an empty DOMDocumentType object + - Creates an empty DOMDocumentType object - hasFeature - Test if the DOM implementation implements a specific feature + - Test if the DOM implementation implements a specific feature @@ -744,10 +744,10 @@ &reftitle.methods; - getName - + - - getNamespaceURI - + - @@ -788,43 +788,43 @@ &reftitle.methods; - appendChild - Adds new child at the end of the children + - Adds new child at the end of the children - cloneNode - Clones a node + - Clones a node - hasAttributes - Checks if node has attributes + - Checks if node has attributes - hasChildNodes - Checks if node has children + - Checks if node has children - insertBefore - Adds new child at the end of the children + - Adds new child at the end of the children - isSameNode - Indicates if two nodes are the same node + - Indicates if two nodes are the same node - isSupported - Checks if feature is supported for specified version + - Checks if feature is supported for specified version - lookupNamespaceURI - Returns namespace URI of the node based on the prefix + - Returns namespace URI of the node based on the prefix - lookupPrefix - Returns name space prefix of the node based on namespaceURI + - Returns name space prefix of the node based on namespaceURI - normalize - Normalizes the node + - Normalizes the node - removeChild - Removes child from list of children + - Removes child from list of children - replaceChild - Replaces a child + - Replaces a child - +
&reftitle.properties; @@ -1060,7 +1060,7 @@ &reftitle.methods; - item - Return the specified index of the collection + - Return the specified index of the collection @@ -1101,16 +1101,16 @@ &reftitle.methods; - isElementContentWhitespace - + - - isWhitespaceInElementContent - + - - replaceWholeText - + - - splitText - + - @@ -1149,7 +1149,7 @@ &reftitle.constructor; - __construct - construct a new DOMXPath object + - construct a new DOMXPath object @@ -1157,13 +1157,13 @@ &reftitle.methods; - registerNamespace - Registers the namespace with the DOMXpath object + - Registers the namespace with the DOMXpath object - evaluate - Evaluates the given XPath expression and returns a typed result + - Evaluates the given XPath expression and returns a typed result if possible - query - Evaluates the given XPath expression + - Evaluates the given XPath expression