From 23edaea357459837fa67737880c490b8597006f6 Mon Sep 17 00:00:00 2001 From: Oliver Schinagl Date: Mon, 26 May 2008 21:13:55 +0000 Subject: check --- Report/Chapter4.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Report/Chapter4.tex b/Report/Chapter4.tex index dcb2b02..8d49a7c 100644 --- a/Report/Chapter4.tex +++ b/Report/Chapter4.tex @@ -28,16 +28,16 @@ foreach ($nodes as $node) The \textit{\$query} keyword denotes a variable which, in this case, is our query to retrieve the items from our database. The \textit{\$nodes = \$xpath$\rightarrow$query(\$query)} line actually performs the query and retrieves the nodes from the database. \\ -We then go through each item with the \textit{foreach} statement. Then, from that element, we get the title with the \textit{getElementsByTagName()} function. This gives us again a XML tree with nodes. We know that there is only one title, so we get the value of that node with \textit{\$item$\rightarrow$item(0)$\rightarrow$nodeValue}. +We then go through each item with the \textit{foreach} statement. Then, from that element, we get the title with the \textit{getElementsByTagName()} function. This gives us again an XML tree with nodes. We know that there is only one title, so we get the value of that node with \textit{\$item$\rightarrow$item(0)$\rightarrow$nodeValue}. \subsection{Search queries} -The search the database for your favorite beer, you can fill in a small search-form. The PHP script will then return all items that apply yo the search query. Such a query is shown below. +To search the database for your favorite beer, you can fill in a small search-form. The PHP script will then return all items that apply the search query. Such a query is shown below. $$ \textit{//item[contains(title/text(), "bier") or contains(descr/text(), "bier")]} $$ $$ \textit{[LiquorTypeID/text()="2"][NewsCategoryID/text()="2"]} $$ -The query begins the same as that of the previous query. The main difference here are the extra filters applied to the query. It checks if either the title or description of the news-item contains a string with the XPath function $ contains $ which returns a boolean value. It also check the type of liquor and news category. +The query begins the same as that of the previous query. The main difference here is that the extra filters applied to the query. It checks if either the title or description of the news-item contains a string with the XPath function $ contains $ which returns a boolean value. It also checks the type of liquor and news category. \subsection{Update information} @@ -48,4 +48,4 @@ $item = $node->getElementsByTagName("description"); $item->item(0)->nodeValue = "Changed your value... Joink!"; \end{verbatim} -As you can see, the nodeValue can easily be changed. Once the right news-item is retrieved, it's values can be changed with an assignment statement. \\ \ No newline at end of file +As you can see, the nodeValue can easily be changed. Once the right news-item is retrieved, its value can be changed with an assignment statement. \\ -- cgit v0.12